While build
ing my Haskell programs with Stack, I'm trying to get the executable to be written to project/dist/
but no matter what command line arguments I use or config files I change, it always ends up in project/.stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/project/
.
After spending a decent amount of time looking at the command line arguments for the stack
command, as well as options in project.cabal
, Setup.hs
, and stack.yaml
, I can't seem to find how to configure the output location of stack build
.
How do you configure the executable output location for stack build
?
stack-work directories local to each project. The Stack root directory holds packages belonging to snapshots and any Stack-installed versions of GHC. Stack will not tamper with any system version of GHC or interfere with packages installed by other build tools (such as Cabal (the tool)).
Stack is a tool to build Haskell projects and manage their dependencies. It uses the Cabal library but with a curated version of the Hackage repository called Stackage.
Stack is a cross-platform program for developing Haskell projects. It is intended for Haskellers both new and experienced. See haskellstack.org or the doc directory for more information.
You can find these sandboxed GHC installations in the ghc-* directories in the stack path --programs directory. If you would like Stack to use your system GHC installation, use the --system-ghc flag or run stack config set system-ghc --global true to make Stack check your PATH for a suitable GHC by default.
You can use the --copy-bins
flag (or the install
command) to copy the executables to some output directory. That destination directory can be controlled with --local-bin-path
, but defaults to ~/.local/bin
on POSIX systems.
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