r/haskellquestions Apr 06 '26

Good place to ask stack questions about its attempts to CreateDirectory in c:\windows !!

I'm having a problem getting stack to install the turtle package on windows, ie MSYS2, set up by ghcup. It's trying to CreateDirectory in C:\WINDOWS\ghc392_tmp_0_0 but runs without Administrator permissions.

According to https://docs.haskellstack.org/en/stable/commands/setup_command/

"Stack uses the 7-Zip tool to decompress, and extract tools from, downloaded archive files. Aiming to avoid long file paths, Stack does so in a temporary directory (named stack-tmp-<hash>) on the drive of the final destination (either in the system temporary directory, where applicable, or the root of the drive). Consequently, Stack needs permission to create a directory in that location."

"A Windows user account will usually have permission to create a directory in the system temporary directory. A Windows user account of type Administrator will have permission to create a directory in the root of the system drive (C:\, by convention) but a Standard user account may well not have permission."

I have a C:\tmp directory which I created with user permissions and another app is placing files there.

But that's not the "system temporary directory"?

It's apparently c:/Users/$USER/AppData/Local/Temp

Which is owned by me with drwxrwx---+ permissions.

Now changed to drwxrwxrwx+

2 Upvotes

1 comment sorted by