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
?
Asked
Active
Viewed 2,846 times
13

ntc2
- 11,203
- 7
- 53
- 70
2 Answers
10
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>
.

ntc2
- 11,203
- 7
- 53
- 70
5
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.

Patrick Jennings
- 63
- 1
- 4