{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreih5yk7u2mf5sjoq2zetjcofi2olq42fo3vjk2mmndvf3foxrnpisy",
"uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mjnbsmjmhhr2"
},
"path": "/t/problems-using-stack-in-a-msys2-shell/13939#post_1",
"publishedAt": "2026-04-16T19:45:16.000Z",
"site": "https://discourse.haskell.org",
"tags": [
"@drbean",
"Stack tries to create temporary folder in drive root? - #16 by drbean"
],
"textContent": "@drbean, picking up your question here:\n\n * Stack tries to create temporary folder in drive root? - #16 by drbean\n\n\n\nStack comes with an MSYS2 environment on Windows, so I’ll use that to experiment rather than creating a duplicate environment on my machine. On my machine, that MSYS2 is located at `D:\\sr\\programs\\x86_64-windows\\msys2-20240727` - that is because I have set `STACK_ROOT` to be `D:\\sr` and, in the Stack root, in `config.yaml`, I have set:\n\n\n local-programs-path: D:\\sr\\programs\n\n\nSo, I open a MSYS2 shell by double-clicking on:\n\n\n D:\\sr\\programs\\x86_64-windows\\msys2-20240727\\msys2_shell.cmd\n\n\nIn that shell, Stack is not on the PATH, so I’ll use the long form to run it:\n\n\n $ /c/Users/mike/AppData/Roaming/local/bin/stack --version\n\n\nNow, I can command:\n\n\n $ /c/Users/mike/AppData/Roaming/local/bin/stack build turtle\n\n\nand the command works as expected. As I am outside of any Stack project’s directory, the package is built against the `stack.yaml` ‘of last resort’ that is located in the `global-project` directory of the Stack root. On my machine that specifies:\n\n\n packages: []\n snapshot: lts-24.37\n\n\nHere, I don’t use `stack install turtle` because the `turtle` package does not have an executable stanza, so specifying `stack build --copy-bins` (which is what `stack install` is a synonym for) has no special effect - there are no executable binary distributions to copy after the package has been built.",
"title": "Problems using Stack in a MSYS2 shell"
}