I'm using multiple stack.yaml
files to build against GHC 7.8 and 7.10. How do I set up my PATH
to include the binaries for a specific stack.yaml
file, e.g. stack-7.8.yaml
?
The stack path --local-install-root
command solves this problem. E.g., to setup your path for the binaries from stack --stack-yaml stack-7.8.yaml
, do
export PATH=$(stack --stack-yaml stack-7.8.yaml path --local-install-root):$PATH
Note: the stack exec
command can also be used here, but I don't want to clutter my scripts with calls to stack --stack-yaml stack-7.8.yaml exec <cmd>
instead of plain <cmd>
.
To answer the question in the title, the executables are stored in a project-local .stack-work
folder. For me, the full path from the project folder is .stack-work/dist/e626a42b/build/{PROJECT_NAME}-exe
. Other executables, such as the test and bench executables, are also stored here, in {PROJECT_NAME}-test
and {PROJECT_NAME}-bench
respectively.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With