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

Reaching path length limit in Windows #4365

Open
ThereIsNoPie opened this issue Jul 23, 2024 · 2 comments
Open

Reaching path length limit in Windows #4365

ThereIsNoPie opened this issue Jul 23, 2024 · 2 comments
Labels
os: windows type: support User support tickets, questions, help with setup etc.

Comments

@ThereIsNoPie
Copy link

Your environment

Which OS do you use?
Windows

Which version of GHC do you use and how did you install it?
ghcup, ghc 9.4.8

How is your project built (alternative: link to the project)?
cabal

Which LSP client (editor/plugin) do you use?
VS code

Which version of HLS do you use and how did you install it?
ghcup is set to 2.7.0.0, however in my logs it says 2.9.0.1

Have you configured HLS in any way (especially: a hie.yaml file)?
No

What's wrong?

I'm running into this issue when navigating to a file in my projects executable directory (in this case Main.hs).

C:\Users\user1\AppData\Local\hie-bios\dist-super-duper-long-project-name-api-8be09479ad30bccd6705fcb1123451\build\x86_64-windows\ghc-9.4.8\super-duper-long-project-name-api-0.1.0.0\x\super-duper-long-project-name-api\build\super-duper-long-project-name-api\autogen\: openBinaryTempFileWithDefaultPermissions: invalid argument (invalid argument)Error: cabal-3.10.3.0.exe: repl failed for exe:super-duper-long-project-name-api super-duper-long-project-name-api-0.1.0.0.

This removes syntax highlighting in VSCode

Debug information

When I change the project name to "short-name" it works fine.

I have enabled long paths on Windows (Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem
c. Enable "Enable Win32 long paths")

Fix long paths issue on windows
In the hie-bios 0.1.1 changelog https://hackage.haskell.org/package/hie-bios-0.4.0/candidate/changelog

If I run cabal build and cabal run from terminal it seems to work fine (90% sure). Only fails in VS Code.

@ThereIsNoPie ThereIsNoPie added status: needs triage type: support User support tickets, questions, help with setup etc. labels Jul 23, 2024
@fendor
Copy link
Collaborator

fendor commented Aug 6, 2024

Hi, thank you for your bug report!

It is amazing that this issue keeps biting us. I'd be curious whether cabal build is seriously fine. Since this directory (C:\Users\user1\AppData\Local\hie-bios\dist-super-duper-long-project-name-api-8be09479ad30bccd6705fcb1123451\) is only touched by cabal repl. I expect for example a project like super-duper-long-project-name-apisuper-duper-long-project-name-apisuper-duper-long-project-name-api.cabal to be broken as well.

EDIT: You are sure user1 doesn't contain any spaces or other special characters?

@ThereIsNoPie
Copy link
Author

Yeah user1 doesn't contain any spaces or special characters.

I ended up switching to wsl and everything just worked immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os: windows type: support User support tickets, questions, help with setup etc.
Projects
None yet
Development

No branches or pull requests

2 participants