External Publication
Visit Post

Problems using Stack in a MSYS2 shell

Haskell Community [Unofficial] April 22, 2026
Source

On Sun, 19 Apr 2026, Mike Pilgrem wrote:

and in the Stack-supplied MSYS2 shell (extracts only):

$ env
...
MSYSTEM=MSYS

I was running stack in a UCRT64 environment shell

MSYSTEM=UCRT64 MSYSTEM_PREFIX=/ucrt64

I will try again in a plain MSYS one.

GHCUP_MSYS2_ENV was the same, but I didn’t have GHCUP_MSYS2 or any STACK ones.

$ cygpath -w /
D:\sr\programs\x86_64-windows\msys2-20240727\

Here, $ cygpath -w / C:\msy64\

Extra verbosity might reveal something. For full-fat verbosity (Stack’s, Cabal’s and GHC’s), command:

stack --verbose build --cabal-verbose --ghc-options=-v turtle

This is with snapshot lts-24.37

I tried posting all the output, but failed, exceeding the 32000 character limit.

Posting just a few lines before the failure,

%< cut >%

2026-04-21 17:22:59.659342: [info] assoc                              > Wanted build ways: [StaticWay]
2026-04-21 17:22:59.659342: [info] assoc                              > Running: "C:\ghcup\bin\ghc-9.10.3.exe" "--make" "-fbuilding-cabal-package" "-O" "-outputdir" ".stack-work\dist\1a191874\build" "-odir" ".stack-work\dist\1a191874\build" "-hidir" ".stack-work\dist\1a191874\build" "-hiedir" ".stack-work\dist\1a191874\build\extra-compilation-artifacts\hie" "-stubdir" ".stack-work\dist\1a191874\build" "-i" "-isrc" "-i.stack-work\dist\1a191874\build" "-i.stack-work\dist\1a191874\build\autogen" "-i.stack-work\dist\1a191874\build\global-autogen" "-I.stack-work\dist\1a191874\build\autogen" "-I.stack-work\dist\1a191874\build\globa
+l-autogen" "-I.stack-work\dist\1a191874\build" "-IC:\ghcup\msys64\ucrt64\include" "-IC:\Users\drbean\AppData\Roaming\stack\programs\x86_64-windows\msys2-20240727\ucrt64\include" "-optP-include" "-optP.stack-work\dist\1a191874\build\autogen\cabal_macros.h" "-this-unit-id" "assoc-1.1.1-F1tRInYZuki6uqqOQoYdnz" "-hide-all-packages" "-Wmissing-home-modules" "-no-user-package-db" "-package-db" "C:\Users\drbean\AppData\Roaming\stack\snapshots\abda8635\pkgdb" "-package-db" ".stack-work\dist\1a191874\package.conf.inplace" "-package-id" "base-4.20.2.0-39f9" "-XHaskell2010" "Data.Bifunctor.Assoc" "Data.Bifunctor.Swap" "-fhide-source-pa
+ths"
2026-04-21 17:22:59.659342: [info] StateVar                           > creating .stack-work\dist\1a191874\build
2026-04-21 17:22:59.659342: [info] StateVar                           > creating .stack-work\dist\1a191874\build\autogen
2026-04-21 17:22:59.674965: [info] StateVar                           > creating .stack-work\dist\1a191874\build\autogen
2026-04-21 17:22:59.674965: [info] StateVar                           > creating .stack-work\dist\1a191874\build\autogen
2026-04-21 17:22:59.674965: [info] StateVar                           > creating .stack-work\dist\1a191874\build\autogen
2026-04-21 17:22:59.674965: [info] StateVar                           > Preprocessing library for StateVar-1.2.2...
2026-04-21 17:22:59.674965: [info] StateVar                           > Building library for StateVar-1.2.2...
2026-04-21 17:22:59.674965: [info] StateVar                           > creating .stack-work\dist\1a191874\build
2026-04-21 17:22:59.674965: [info] StateVar                           > creating .stack-work\dist\1a191874\build
2026-04-21 17:22:59.674965: [info] StateVar                           > Wanted build ways: [StaticWay]
2026-04-21 17:22:59.674965: [info] StateVar                           > Running: "C:\ghcup\bin\ghc-9.10.3.exe" "--make" "-fbuilding-cabal-package" "-O" "-outputdir" ".stack-work\dist\1a191874\build" "-odir" ".stack-work\dist\1a191874\build" "-hidir" ".stack-work\dist\1a191874\build" "-hiedir" ".stack-work\dist\1a191874\build\extra-compilation-artifacts\hie" "-stubdir" ".stack-work\dist\1a191874\build" "-i" "-isrc" "-i.stack-work\dist\1a191874\build" "-i.stack-work\dist\1a191874\build\autogen" "-i.stack-work\dist\1a191874\build\global-autogen" "-I.stack-work\dist\1a191874\build\autogen" "-I.stack-work\dist\1a191874\build\globa
+l-autogen" "-I.stack-work\dist\1a191874\build" "-IC:\ghcup\msys64\ucrt64\include" "-IC:\Users\drbean\AppData\Roaming\stack\programs\x86_64-windows\msys2-20240727\ucrt64\include" "-optP-DUSE_DEFAULT_SIGNATURES=1" "-optP-include" "-optP.stack-work\dist\1a191874\build\autogen\cabal_macros.h" "-this-unit-id" "StateVar-1.2.2-CdQlFIDAcAmBWGT95jJYkz" "-hide-all-packages" "-Wmissing-home-modules" "-no-user-package-db" "-package-db" "C:\Users\drbean\AppData\Roaming\stack\snapshots\abda8635\pkgdb" "-package-db" ".stack-work\dist\1a191874\package.conf.inplace" "-package-id" "base-4.20.2.0-39f9" "-package-id" "stm-2.5.3.1-7044" "-packag
+e-id" "transformers-0.6.1.1-bf2e" "-XHaskell2010" "Data.StateVar" "-Wall" "-Wcompat" "-Winferred-safe-imports" "-Wmissing-safe-haskell-mode" "-fhide-source-paths"
2026-04-21 17:23:04.921584: [warn] StateVar                           > C:\WINDOWS\ghc7744_0: CreateDirectory "\\\\?\\C:\\WINDOWS\\ghc7744_0": permission denied (アクセスが拒否されました。)
2026-04-21 17:23:04.921584: [warn] assoc                              > C:\WINDOWS\ghc6016_0: CreateDirectory "\\\\?\\C:\\WINDOWS\\ghc6016_0": permission denied (アクセスが拒否されました。)
2026-04-21 17:23:05.030953: [debug] Checking for project config at: C:\Users\drbean\turtle-1.6.2\stack.yaml
2026-04-21 17:23:05.030953: [debug] Checking for project config at: C:\Users\drbean\stack.yaml
2026-04-21 17:23:05.030953: [debug] Checking for project config at: C:\Users\stack.yaml
2026-04-21 17:23:05.030953: [debug] Checking for project config at: C:\stack.yaml
2026-04-21 17:23:05.030953: [debug] No project config file found, using defaults.
2026-04-21 17:23:05.046577: [debug] Use of Casa server enabled: (CasaRepoPrefix "https://casa.stackage.org", 1280).
2026-04-21 17:23:05.046577: [debug] (SQL) SELECT COUNT(*) FROM "last_performed" WHERE ("action"=?) AND ("timestamp">=?); [PersistInt64 1,PersistUTCTime 2026-04-20 08:23:05.0465775 UTC]
2026-04-21 17:23:05.046577: [error]
Error: [S-7282]
       Stack failed to execute the build plan.

       While executing the build plan, Stack encountered the following errors:

       [S-7011]
       While building package assoc-1.1.1 (scroll up to its section to see the error) using:
       C:\Users\drbean\AppData\Roaming\stack\setup-exe-cache\x86_64-windows\Cabal-simple_O_vy6YIf_3.12.1.0_ghc-9.10.3.exe --verbose=2 --builddir=.stack-work\dist\1a191874 build --ghc-options ""
       Process exited with code: ExitFailure 1

       [S-7011]
       While building package StateVar-1.2.2 (scroll up to its section to see the error) using:
       C:\Users\drbean\AppData\Roaming\stack\setup-exe-cache\x86_64-windows\Cabal-simple_O_vy6YIf_3.12.1.0_ghc-9.10.3.exe --verbose=2 --builddir=.stack-work\dist\1a191874 build --ghc-options ""
       Process exited with code: ExitFailure 1

Diffing this with the corresponding output when run in stack’s MSYS2 shell doesn’t reveal any differences which seem significant (on a quick look).

But at the point where the build fails above, it has:

2026-04-21 17:47:15.379025: [info] StateVar                           > Wanted build ways: [StaticWay]
2026-04-21 17:47:15.379025: [info] assoc                              > Preprocessing library for assoc-1.1.1...
2026-04-21 17:47:15.379025: [info] StateVar                           > Running: "C:\ghcup\bin\ghc-9.10.3.exe" "--make" "-fbuilding-cabal-package" "-O" "-outputdir" ".stack-work\dist\1a191874\build" "-odir" ".stack-work\dist\1a191874\build" "-hidir" ".stack-work\dist\1a1
91874\build" "-hiedir" ".stack-work\dist\1a191874\build\extra-compilation-artifacts\hie" "-stubdir" ".stack-work\dist\1a191874\build" "-i" "-isrc" "-i.stack-work\dist\1a191874\build" "-i.stack-work\dist\1a191874\build\autogen" "-i.stack-work\dist\1a191874\build\global-au
togen" "-I.stack-work\dist\1a191874\build\autogen" "-I.stack-work\dist\1a191874\build\global-autogen" "-I.stack-work\dist\1a191874\build" "-IC:\ghcup\msys64\ucrt64\include" "-IC:\Users\drbean\AppData\Roaming\stack\programs\x86_64-windows\msys2-20240727\ucrt64\include" "-
optP-DUSE_DEFAULT_SIGNATURES=1" "-optP-include" "-optP.stack-work\dist\1a191874\build\autogen\cabal_macros.h" "-this-unit-id" "StateVar-1.2.2-CdQlFIDAcAmBWGT95jJYkz" "-hide-all-packages" "-Wmissing-home-modules" "-no-user-package-db" "-package-db" "C:\Users\drbean\AppDat
a\Roaming\stack\snapshots\abda8635\pkgdb" "-package-db" ".stack-work\dist\1a191874\package.conf.inplace" "-package-id" "base-4.20.2.0-39f9" "-package-id" "stm-2.5.3.1-7044" "-package-id" "transformers-0.6.1.1-bf2e" "-XHaskell2010" "Data.StateVar" "-Wall" "-Wcompat" "-Winferred-safe-imports" "-Wmissing-safe-haskell-mode" "-fhide-source-paths"
2026-04-21 17:47:15.379025: [info] assoc                              > Building library for assoc-1.1.1...
2026-04-21 17:47:15.379025: [info] assoc                              > creating .stack-work\dist\1a191874\build
2026-04-21 17:47:15.379025: [info] assoc                              > creating .stack-work\dist\1a191874\build
2026-04-21 17:47:15.379025: [info] assoc                              > Wanted build ways: [StaticWay]
2026-04-21 17:47:15.379025: [info] assoc                              > Running: "C:\ghcup\bin\ghc-9.10.3.exe" "--make" "-fbuilding-cabal-package" "-O" "-outputdir" ".stack-work\dist\1a191874\build" "-odir" ".stack-work\dist\1a191874\build" "-hidir" ".stack-work\dist\1a191874\build" "-hiedir" ".stack-work\dist\1a191874\build\extra-compilation-artifacts\hie" "-stubdir" ".stack-work\dist\1a191874\build" "-i" "-isrc" "-i.stack-work\dist\1a191874\build" "-i.stack-work\dist\1a191874\build\autogen" "-i.stack-work\dist\1a191874\build\global-autogen" "-I.stack-work\dist\1a191874\build\autogen" "-I.stack-work\dist\1a191874\build\global-autogen" "-I.stack-work\dist\1a191874\build" "-IC:\ghcup\msys64\ucrt64\include" "-IC:\Users\drbean\AppData\Roaming\stack\programs\x86_64-windows\msys2-20240727\ucrt64\include" "-optP-include" "-optP.stack-work\dist\1a191874\build\autogen\cabal_macros.h" "-this-unit-id" "assoc-1.1.1-F1tRInYZuki6uqqOQoYdnz" "-hide-all-packages" "-Wmissing-home-modules" "-no-user-package-db" "-package-db" "C:\Users\drbean\AppData\Roaming\stack\snapshots\abda8635\pkgdb" "-package-db" ".stack-work\dist\1a191874\package.conf.inplace" "-package-id" "base-4.20.2.0-39f9" "-XHaskell2010" "Data.Bifunctor.Assoc" "Data.Bifunctor.Swap" "-fhide-source-paths"
2026-04-21 17:47:17.548427: [info] assoc                              > [1 of 2] Compiling Data.Bifunctor.Assoc
2026-04-21 17:47:17.564054: [info] StateVar                           > [1 of 1] Compiling Data.StateVar
2026-04-21 17:47:21.391836: [warn] StateVar                           > C:\Users\drbean\AppData\Roaming\stack\programs\x86_64-windows\msys2-20240727\tmp\stack-6c0733bca89f22e2\StateVar-1.2.2\src\Data\StateVar.hs:220:33: warning: [GHC-58520] [-Wtype-equality-requires-operators]
2026-04-21 17:47:21.391836: [warn] StateVar                           >     The use of ‘~’ without TypeOperators
2026-04-21 17:47:21.391836: [warn] StateVar                           >     will become an error in a future GHC release.
2026-04-21 17:47:21.407463: [warn] StateVar                           >     Suggested fix: Perhaps you intended to use TypeOperators
2026-04-21 17:47:21.407463: [warn] StateVar                           >     |
2026-04-21 17:47:21.407463: [warn] StateVar                           > 220 |   default ($~) :: (MonadIO m, a ~ b, HasGetter t a) => t -> (a -> b) -> m ()
2026-04-21 17:47:21.407463: [warn] StateVar                           >     |                                 ^
2026-04-21 17:47:21.407463: [warn] StateVar                           >
...
etc
%< cut >%

There doesn’t seem to be any indication of where it’s storing the result of the assoc, StateVar package(?) precompilications.

Discussion in the ATmosphere

Loading comments...