Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The specified file name or path is too long #967

Closed
seoushi opened this issue Jul 15, 2022 · 8 comments
Closed

The specified file name or path is too long #967

seoushi opened this issue Jul 15, 2022 · 8 comments

Comments

@seoushi
Copy link

seoushi commented Jul 15, 2022

I just ported my emacs setup to my m1 macbook pro which uses eglot and fsautocomplete for work with fsharp. While trying to find references it errors out and complains about the file path being too long. I'm not sure what file path it's trying but mine is even below the windows file path limit of 260 characters. In case it helps here is a link to the source code I'm trying it on https://seoushi.dynu.net/sean/inulang/-/blob/fsharp/inulang/inulang/Cli.fs . I've also seen this happen on my gentoo machine but it's not 100% as it is on my m1 macbook.

More Information:
dotnet 6.0.302
fsautocomplete version 0.55.0+1fe4bb9fc5a7cedd00d35e34d347de2c74abe8b1

Here is the event log of the error from emacs.
error.txt

@baronfel
Copy link
Contributor

Oh this is very weird - that's way down in the compiler itself. The inputs to that are always null for the path name, so I'm not entirely sure where to go from there.

@baronfel
Copy link
Contributor

Based on a cursory look you may be hitting this branch of the unix-specific memory-mapped file code: https://github.com/dotnet/runtime/blob/main/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.Unix.cs#L246-L267

Do you have a way of finding what SHM_NAME_MAX is on your system?

@seoushi
Copy link
Author

seoushi commented Jul 15, 2022

I couldn't find a straight forward way to find that information so I wrote a small c program with shm_open and from trial and error it looks like the max is 31.

@razzmatazz
Copy link
Contributor

@baronfel
Copy link
Contributor

Good call, can you try installing a .net 7 preview and running FSAC with it? It should just work.

@seoushi
Copy link
Author

seoushi commented Jul 15, 2022

I tried using dotnet 7.0.100 and while it no longer throws exceptions no results are given. Finding reference or definitions returns.

Messages

user-error: No definitions found for: LSP identifier at point [2 times]
user-error: No references found for: LSP identifier at point

Eglot Events

[client-request] (id:68) Fri Jul 15 08:19:48 2022:
(:jsonrpc "2.0" :id 68 :method "textDocument/definition" :params
          (:textDocument
           (:uri "file:///Users/sean/repos/inulang/inulang/inulang/Ast.fs")
           :position
           (:line 38 :character 32)))
[server-reply] (id:68) Fri Jul 15 08:19:48 2022:
(:jsonrpc "2.0" :id 68 :result nil)

dotnet 6.0 at least worked with finding the definition so I will be returning to that. Given this is a dotnet issue feel free to close this issue. I recommend adding something in the readme for other mac m1 users tho. Thanks for all the help!

@baronfel
Copy link
Contributor

I can look into if there's something critical we fail with on 7.0.100 previews in the meantime.

@TheAngryByrd
Copy link
Member

Seems like it was an issue with dotnet runtime and M1 macbooks dotnet/fsharp#14061.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants