Skip to content

Commit

Permalink
Re #6457 Add MINGW64 environment of MSYS2 to the online docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mpilgrem committed Jan 26, 2024
1 parent e789e34 commit 14e1874
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
26 changes: 17 additions & 9 deletions doc/developing_on_windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
# Developing on Windows #

On Windows, Stack comes with an installation of [MSYS2](https://www.msys2.org/).
MSYS2 will be used by Stack to provide a Unix-like shell and environment for
Stack. This may be necessary for installing some Haskell packages, such as those
which use `configure` scripts, or if your project needs some additional tools
during the build phase.
The MINGW64 (MINGW32 on 32-bit Windows) environment of MSYS2 will be used by
Stack to provide a Unix-like shell and environment for Stack. This may be
necessary for installing some Haskell packages, such as those which use
`configure` scripts, or if your project needs some additional tools during the
build phase.

No matter which terminal software you choose (Windows Terminal, Console Windows
Host, Command Prompt, PowerShell, Git bash or any other) you can use this
Expand All @@ -26,11 +27,18 @@ example, help about the operation `--sync` (or `-S`) can be obtained with
`stack exec -- pacman -Sh`.

Command `stack path --bin-path` to see the PATH in the Stack environment. On
Windows, it includes the `\mingw64\bin`, `\usr\bin` and `\usr\local\bin`
directories of the Stack-supplied MSYS2. If your executable depends on files
(for example, dynamic-link libraries) in those directories and you want ro run
it outside of the Stack environment, you will need to ensure copies of those
files are on the PATH.
Windows, it includes the `\mingw64\bin` (`\mingw32\bin` on 32-bit Windows),
`\usr\bin` and `\usr\local\bin` directories of the Stack-supplied MSYS2. If your
executable depends on files (for example, dynamic-link libraries) in those
directories and you want to run it outside of the Stack environment, you will
need to ensure copies of those files are on the PATH.

Command `stack path --extra-include-dirs` and `stack path --extra-library-dirs`
to see the extra directories searched for C header files or system libraries
files in the Stack environment. On Windows, it includes the `\mingw64\include`
(`mingw32\include` on 32-bit Windows) (include) and the `\mingw64\lib` and
`\mingw64\bin` directories (`mingw32\lib` and `mingw32\bin` on 32-bit Windows)
(library) of the Stack-supplied MSYS2.

## Updating the Stack-supplied MSYS2 ##

Expand Down
2 changes: 1 addition & 1 deletion doc/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ Windows is not able to find the necessary C++ libraries from the standard
prompt because they're not in the PATH environment variable. `stack exec` works
because it's modifying PATH to include extra things.

Those libraries are shipped with GHC (and, theoretically in some cases, MSYS).
Those libraries are shipped with GHC (and, theoretically in some cases, MSYS2).
The easiest way to find them is `stack exec which`. For example, command:

~~~text
Expand Down

0 comments on commit 14e1874

Please sign in to comment.