Problems using Stack in a MSYS2 shell
@drbean, picking up your question here:
- Stack tries to create temporary folder in drive root? - #16 by drbean
Stack 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:
local-programs-path: D:\sr\programs
So, I open a MSYS2 shell by double-clicking on:
D:\sr\programs\x86_64-windows\msys2-20240727\msys2_shell.cmd
In that shell, Stack is not on the PATH, so I’ll use the long form to run it:
$ /c/Users/mike/AppData/Roaming/local/bin/stack --version
Now, I can command:
$ /c/Users/mike/AppData/Roaming/local/bin/stack build turtle
and 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:
packages: []
snapshot: lts-24.37
Here, 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.
Discussion in the ATmosphere