External Publication
Visit Post

Problems using Stack in a MSYS2 shell

Haskell Community [Unofficial] April 19, 2026
Source

According to a note at the end of setup - Stack

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.

Shouldn’t it be trying to create one in the USER temporary directory,

C:\Users\drbean>echo %TMP% or %TEMP%
C:\Users\drbean\AppData\Local\Temp or C:\Users\drbean\AppData\Local\Temp

I cannot access C:\WINDOWS\Temp

C:\Users\drbean>dir C:\WINDOWS
 Volume in drive C has no label.
 Volume Serial Number is 600C-007E

 Directory of C:\WINDOWS

2026/01/25  15:14    <DIR>          .
2026/01/25  15:14    <DIR>          ..
2019/12/08  00:11    <DIR>          addins
2024/10/18  20:01    <DIR>          appcompat
2025/10/15  17:26    <DIR>          apppatch
2026/04/19  16:19    <DIR>          AppReadiness
2016/04/06  19:08           175,956 ARIALN.tt2
...
2022/12/21  11:04    <DIR>          Tasks
2026/04/19  16:33    <DIR>          Temp
2022/12/01  10:12    <DIR>          TextInput
2015/11/20  21:15    <DIR>          ToastData
2019/12/07  18:14    <DIR>          tracing
2023/11/15  23:40    <DIR>          twain_32
2025/05/15  16:54            76,800 twain_32.dll
2022/12/02  14:20    <DIR>          UpdateAssistant
2013/08/23  00:36    <DIR>          vpnplugins
2019/12/07  18:14    <DIR>          Vss
2019/12/07  18:14    <DIR>          WaaS
2019/12/07  18:31    <DIR>          Web
...
C:\Users\drbean>dir C:\WINDOWS\Temp
 Volume in drive C has no label.
 Volume Serial Number is 600C-007E

 Directory of C:\WINDOWS\Temp

File Not Found

C:\Users\drbean>dir C:\WINDOWS\Web
 Volume in drive C has no label.
 Volume Serial Number is 600C-007E

 Directory of C:\WINDOWS\Web

2019/12/07  18:31    <DIR>          .
2019/12/07  18:31    <DIR>          ..
2019/12/07  18:31    <DIR>          4K
2019/12/07  18:15    <DIR>          Screen
2024/03/14  19:32    <DIR>          Wallpaper
               0 File(s)              0 bytes
               5 Dir(s)  282,429,677,568 bytes free

The 2 ghc files in the user tmp directory from today,

C:\Users\drbean>dir C:\Users\drbean\AppData\Local\Temp\ghc*
 Volume in drive C has no label.
 Volume Serial Number is 600C-007E

 Directory of C:\Users\drbean\AppData\Local\Temp

2026/04/19  15:55    <DIR>          ghc11132_tmp_0_0
2026/04/16  16:08            78,336 ghc11D2.exe
2026/04/16  16:08            78,336 ghc3E12.exe
2026/04/19  15:54            81,408 ghcCD21.exe
2026/04/19  15:54            81,408 ghcCD22.exe
2026/04/16  18:23            81,408 ghcD835.exe
               5 File(s)        400,896 bytes
               1 Dir(s)  282,432,884,736 bytes free

Would they be from stack’s MSYS2 builds or the 'C:\msys64 ones?

Discussion in the ATmosphere

Loading comments...