Skip to content

Stack environment

Command stack config env or stack path --bin-path to see how the PATH is defined in the Stack environment.

In that environment, Stack adds certain directories to the start of the PATH. The directories added are set out below, in order of search priority.

Note

Stack does not automatically include its local binary directory on the PATH in the Stack environment. Command stack path --local-bin to see that directory.

The project's bin directory

The Stack work directory for a project contains an install directory with a path to a directory (the local install root directory) containing a bin directory, containing built executable files. Command stack path --local-install-root to see the local install root directory.

Info

Stack's build command installs built executable files of project packages in this directory. Such files can be executed using Stack's exec command.

The snapshot's bin directory

The bin directory in the root directory for snapshot installation. Command stack path --snapshot-install-root to see that root directory.

The compiler tools directory

When the directory is required or requested, Stack creates, in the Stack root, a compiler tools directory for the specified compiler version. Command stack path --compiler-tools-bin to see that directory.

Info

Stack's build command can be configured to install built executable files of project packages into the compiler tools directory for the specified compiler version.

Info

If you wish to override a tool that is co-located with the specified compiler's executable file, put a copy of the alternative tool (or a link to it) in the compiler tools directory for the specified compiler version. If that directory does not exist, it can be created with Stack's config compiler-tools command.

The compiler binary's directory

The directory in which the GHC executable file (binary) that will be used by Stack is located. Command stack path --compiler-bin to see that directory.

GHC's MinGW bin directory (Windows only)

The GHC-supplied MinGW bin directory.

Stack-supplied MSYS2 environment bin directory (Windows only)

The bin directory for the specified MSYS2 environment of the Stack-supplied MSYS2.

Stack-supplied MSYS2 usr\local\bin directory (Windows only)

The usr\local\bin directory for the Stack-supplied MSYS2.

Stack-supplied MSYS2 usr\bin directory (Windows only)

The usr\bin directory for the Stack-supplied MSYS2.

Specified extra paths

Any extra paths that have been configured using Stack's extra-paths configuration option.