{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreih5dudonlxpfd37zcxg3ew2gyru2msgwaup4zvs5b47s3vt5szlua",
    "uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mjm5gbmu6ga2"
  },
  "path": "/t/stack-tries-to-create-temporary-folder-in-drive-root/12155#post_16",
  "publishedAt": "2026-04-16T09:29:04.000Z",
  "site": "https://discourse.haskell.org",
  "textContent": "This appears to have interoperatability problems running `stack install turtle` in a MSYS2 shell. Perhaps because MSYS2 is setting TMP envar to /tmp.\n\n\n    drbean@ESPRIMO MSYS ~/turtle\n    $ stack install turtle\n\n    Warning: Trouble loading CompilerPaths cache:\n\n             Error: [S-8196]\n             Compiler file metadata mismatch, ignoring cache.\n             HasCallStack backtrace:\n               collectBacktraces, called at libraries\\ghc-internal\\src\\GHC\\Internal\\Exception.hs:169:13 in ghc-internal:GHC.Internal.Excep\n    tion\n               toExceptionWithBacktrace, called at libraries\\ghc-internal\\src\\GHC\\Internal\\IO.hs:260:11 in ghc-internal:GHC.Internal.IO\n               throwIO, called at src\\UnliftIO\\Exception.hs:441:20 in unliftio-0.2.25.1-JcxvxdKc0Ho9WcM1iVvrDp:UnliftIO.Exception\n\n\n    C:\\WINDOWS\\ghc7176_tmp_0_0: CreateDirectory \"\\\\\\\\?\\\\C:\\\\WINDOWS\\\\ghc7176_tmp_0_0\": permission denied (アクセスが拒否されました。)\n\n    Error: [S-6374]\n           While building simple Setup.hs (scroll up to its section to see the error) using:\n           C:\\ghcup\\bin\\ghc-9.14.1.exe -rtsopts -threaded -clear-package-db -global-package-db -hide-all-packages -package base -main-is S\n    tackSetupShim.mainOverride -package Cabal-3.16.0.0 C:\\Users\\drbean\\AppData\\Roaming\\stack\\setup-exe-src\\setup-O_vy6YIf.hs C:\\Users\\drbe\n    an\\AppData\\Roaming\\stack\\setup-exe-src\\setup-shim-O_vy6YIf.hs -o C:\\Users\\drbean\\AppData\\Roaming\\stack\\setup-exe-cache\\x86_64-windows\\\n    tmp-Cabal-simple_O_vy6YIf_3.16.0.0_ghc-9.14.1.exe\n           Process exited with code: ExitFailure 1\n\n    But run in a Windows cmd shell:\n\n        C:\\Users\\drbean\\turtle>\\ghcup\\bin\\stack.exe install turtle\n\n    Warning: Stack is not using a Stack-supplied MSYS2.\n    [1 of 3] Compiling Main             ( C:\\Users\\drbean\\AppData\\Roaming\\stack\\setup-exe-src\\setup-O_vy6YIf.hs, C:\\Users\\drbean\\AppData\\Roaming\\stack\\setup-exe-src\\setup-O_vy6YIf.o )\n    [2 of 3] Compiling StackSetupShim   ( C:\\Users\\drbean\\AppData\\Roaming\\stack\\setup-exe-src\\setup-shim-O_vy6YIf.hs, C:\\Users\\drbean\\AppData\\Roaming\\stack\\setup-exe-src\\setup-shim-O_vy6YIf.o )\n    [3 of 3] Linking C:\\\\Users\\\\drbean\\\\AppData\\\\Roaming\\\\stack\\\\setup-exe-cache\\\\x86_64-windows\\\\tmp-Cabal-simple_O_vy6YIf_3.16.0.0_ghc-9.14.1.exe\n    turtle> configure (lib + exe)\n    Configuring turtle-0.1.0.0...\n    turtle> build (lib + exe) with ghc-9.14.1\n    Preprocessing library for turtle-0.1.0.0...\n    Building library for turtle-0.1.0.0...\n    [1 of 2] Compiling Lib\n    [2 of 2] Compiling Paths_turtle\n    Preprocessing executable 'turtle-exe' for turtle-0.1.0.0...\n    Building executable 'turtle-exe' for turtle-0.1.0.0...\n    [1 of 2] Compiling Main\n    [2 of 2] Compiling Paths_turtle\n    [3 of 3] Linking .stack-work\\dist\\505eed1c\\build\\turtle-exe\\turtle-exe.exe\n    turtle> copy/register\n    Installing library in C:\\Users\\drbean\\turtle\\.stack-work\\install\\111e7964\\lib\\x86_64-windows-ghc-9.14.1-bd8b\\turtle-0.1.0.0-LODE549nfonHFTMblztAkN\n    Installing executable turtle-exe in C:\\Users\\drbean\\turtle\\.stack-work\\install\\111e7964\\bin\n    Registering library for turtle-0.1.0.0...\n    Copying from C:\\Users\\drbean\\turtle\\.stack-work\\install\\111e7964\\bin\\turtle-exe.exe to\n    C:\\Users\\drbean\\AppData\\Roaming\\local\\bin\\turtle-exe.exe.\n    Copied executables to C:\\Users\\drbean\\AppData\\Roaming\\local\\bin\\:\n    * turtle-exe.exe\n\n    Warning: Installation path C:\\Users\\drbean\\AppData\\Roaming\\local\\bin not found on the PATH environment variable.\n\n    C:\\Users\\drbean\\turtle>\n\n\nMSYS2 somewhere is setting TMP envar to /tmp for its own tmp files. The Windows envars:\n\n\n    `C:\\Users\\drbean\\turtle>echo %TEMP%\n    C:\\Users\\drbean\\AppData\\Local\\Temp\n\n\n\n    C:\\Users\\drbean\\turtle>echo %TMP%\n    C:\\Users\\drbean\\AppData\\Local\\Temp`\n\n\nA lot of windows tmp files are there.\n\nI have a C:\\tmp directory with my permissions of user. One cygwin(?) app is using it.\n\nRunning `stack install turtle` again in the MSYS2 shell, I get,\n\n\n    C:\\WINDOWS\\: openBinaryTempFileWithDefaultPermissions: permission denied (Permission denied)\n\n",
  "title": "Stack tries to create temporary folder in drive root?"
}