From 7d662bb0202144f3e52c8616262bbd9a3bca43a9 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Tue, 23 Apr 2024 19:40:56 +0800 Subject: [PATCH] Document how to use GHCup's msys2 with stack, fixes #1040 --- docs/guide.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/guide.md b/docs/guide.md index dca940f..894c8c1 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -322,8 +322,24 @@ Stack metadata doesn't have a concept of those and we don't try to be smart when ### Windows -On windows, you may find the following config options useful too: -`skip-msys`, `extra-path`, `extra-include-dirs`, `extra-lib-dirs`. +#### Using GHCup's MSYS2 installation + +Stack usually maintains its own msys2 installation. However, you can instruct it to use GHCup's MSYS2 or any other. E.g. if you +had GHCup install msys2 into `C:\ghcup\msys64\`, then you would add the following config to stack's `config.yaml` +(you can find its location via `stack path --stack-root`): + +```yaml +skip-msys: true +extra-lib-dirs: +- C:\ghcup\msys64\mingw64\lib +- C:\ghcup\msys64\mingw64\bin +extra-path: +- C:\ghcup\msys64\mingw64\bin +- C:\ghcup\msys64\usr\bin +- C:\ghcup\msys64\usr\local\bin +extra-include-dirs: +- C:\ghcup\msys64\mingw64\include +``` Also check out: [https://docs.haskellstack.org/en/stable/yaml_configuration](https://docs.haskellstack.org/en/stable/yaml_configuration)