External Publication
Visit Post

Problems using Stack in a MSYS2 shell

Haskell Community [Unofficial] May 7, 2026
Source

Taking a hint from 2.2. Installing on Windows

which says it uses Windows GetTempPath, which uses:

  • The path in the environment variable TMP, if TMP is set.

    Otherwise, the path in the environment variable TEMP, if TEMP is set.
    
    Otherwise, there is a per-user default which varies between versions of Windows. On NT and XP-ish versions, it might be: c:\Documents and Settings\<username>\Local Settings\Temp
    

(This looks like old documentation.),

I removed TMP and TEMP from the environment, (and ran stack build in the MINGW64 MSYS environment because ghcup appears to want it, with GHCUP_MSYS2_ENV=MINGW64).

It failed after getting I guess dependencies, with

2026-05-07 21:38:16.040999: [debug] Checking if we are going to build multiple executables with the same name 2026-05-07 21:38:16.056613: [debug] Executing the build plan 2026-05-07 21:38:16.119120: [error] C:\Users\drbean\AppData\Roaming\stack\䧩\stack-e3aa6d2b091e2520: CreateDirectory “\?\C:\Users\drbean\AppData\Roaming\stack\\18921\stack-e3aa6d2b091e2520”: does not exist (指定され たパスが見つかりません。)

The strange Chinese character appears to be the spurious ‘\18921’ in the other locale. The Japanese says, 'The specified path cannot be found.

If I run ‘stack build’ in c:\Users\drbean\AppData\Local\Temp rather than the stack directory it appears to be looking for a subdir there..

2026-05-07 22:44:35.295976: [debug] Checking if we are going to build multiple executables with the same name
2026-05-07 22:44:35.295976: [debug] Executing the build plan
2026-05-07 22:44:35.311596: [error] C:\Users\drbean\AppData\Local\Temp\濠\stack-d06f3642425d3259: CreateDirectory "\\\\?\\C:\\Users\\drbean\\AppData\\Local\\Temp\\\28640\\stack-d06f3642425d3259": does not exist (指定されたパス
が見つかりません。)

And if I set TMP=C:\Users\drbean\AppData\Local\Temp it goes back to ‘Permission denied’ in C:\Windows

Discussion in the ATmosphere

Loading comments...