Error when executing stack on Windows

139 views
Skip to first unread message

Louis-Simon Houde

unread,
Sep 17, 2022, 12:56:02 PM9/17/22
to haskell-stack
Hello,

I juste downloaded stack on my Windows PC. I get the following error when trying to compile a simple Haskell program.

Extracted 15 filesERROR: Cannot create symbolic link : A required privilege is not held by the client
Problem while decompressing msys2-20220503.tar

BTW, anyone programming Haskell on Windows ? Should I switch to Linux ?

Thanks

Mike Pilgrem

unread,
Sep 18, 2022, 3:24:31 PM9/18/22
to haskell-stack
I use Stack on Windows 11, but I have not encountered that problem myself and cannot recreate it with Stack 2.7.5 or 2.9.1 (pre-release). Please can you raise an issue on Stack's GitHub repository (https://github.com/commercialhaskell/stack) and include your version of Windows and the full output of the Stack command. Perhaps we can work out how your Windows system and mine differ, with a view to finding a solution for you.

Louis-Simon Houde

unread,
Sep 18, 2022, 6:37:37 PM9/18/22
to Mike Pilgrem, haskell-stack
Thanks for the reply.

I noticed that files in C:\Users\houde\AppData\Local\Programs\stack always revert back to read-only even if I change permissions or uncheck "read-only" . It does not seem to be due to "Controlled Folder Access" feature that comes with Windows Defender because I have another antivirus. Should I still open an issue on github because it does not seem related to stack. All my folders under AppData are read-only. Is there a way to tell stack to install ghc and other binaries to another folder ?

I'm on Windows 10 and installed stack with ghcup.

Thanks

--
You received this message because you are subscribed to a topic in the Google Groups "haskell-stack" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/haskell-stack/1oVxBPTSW4M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to haskell-stac...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/haskell-stack/6f18c8c2-4014-4b36-86eb-c10e51075061n%40googlegroups.com.

Mike Pilgrem

unread,
Sep 19, 2022, 12:57:52 PM9/19/22
to haskell-stack
The Stack option `local-programs-path` can be set in Stack's project-level YAML configuration file (`stack.yaml`) or its global-level YAML configuration file (`config.yaml`) - see https://docs.haskellstack.org/en/stable/yaml_configuration/#local-programs-path.

I think this is unlikely to be the solution, but if you delete `7z.dll` and `7z.exe` in Stack's programs directory (its location reported by `stack path --programs`), Stack will fetch the most up-to-date version of 7-Zip (that is a recent development).

Louis-Simon Houde

unread,
Sep 19, 2022, 7:19:45 PM9/19/22
to Mike Pilgrem, haskell-stack
Thank you,

The option worked like a charm but I still got the same error. I will open an issue. I'm starting to think maybe the install program checks if it can create a symlink and it detects it cannot because of the read-only flag even if it could create it. I even tried it as admin. Thanks for your help, I will open a ticket with the full output.

Louis-Simon Houde

unread,
Sep 19, 2022, 7:26:32 PM9/19/22
to Mike Pilgrem, haskell-stack
Okay, it finally worked as admin with the local path option !
Reply all
Reply to author
Forward
0 new messages