You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,7 @@ This is the complete list of env variables that change GHCup behavior:
105
105
On windows, there's additionally:
106
106
107
107
* `GHCUP_MSYS2`: Has to point to the root of an existing MSYS2 installation (when installed by GHCup, that's e.g. `C:\ghcup\msys64`). GHCup bootstrap takes care of this usually.
108
+
* `GHCUP_MSYS2_ENV`: The [MSYS2 environment](https://www.msys2.org/docs/environments/) to use when executing e.g. `ghcup run --mingw-path`. Possible values are `MSYS`, `UCRT64`, `CLANG64`, `CLANGARM64`, `CLANG32`, `MINGW64`, `MINGW32`. Defaults to `MINGW64`, `MINGW32` or `CLANGARM64`, depending on the architecture. `MSYS` is always added as the last component. If you change this value after running the bootstrap script, you may need to make sure that the cabal config reflects this change, more specifically `extra-prog-path`, `extra-include-dirs` and `extra-lib-dirs`. (**NOTE: specifying anything other than the default is considered experimental**)
108
109
109
110
### XDG support
110
111
@@ -508,7 +509,7 @@ See `ghcup compile ghc --help` for further information.
508
509
509
510
Since ghcup version 0.1.20.0, we provide cross bindists for GHC JS and WASM. These can be installed conveniently.
510
511
However, these are intended as a developer preview only. By using these GHC variants, you are implicitly signing up to participate in GHC development!
511
-
If you run into bugs or missing behavior, join the dev chat at https://matrix.to/#/#GHC:matrix.org.
512
+
If you run into bugs or missing behavior, join the dev chat at https://matrix.to/#/#GHC:matrix.org.
Copy file name to clipboardExpand all lines: scripts/bootstrap/bootstrap-haskell
+41-9Lines changed: 41 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -20,13 +20,23 @@
20
20
# * BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG - whether to adjust mingw paths in cabal.config on windows
21
21
# * BOOTSTRAP_HASKELL_DOWNLOADER - which downloader to use (default: curl)
22
22
# * GHCUP_BASE_URL - the base url for ghcup binary download (use this to overwrite https://downloads.haskell.org/~ghcup with a mirror)
23
+
# * GHCUP_MSYS2_ENV - the msys2 environment to use on windows, see https://www.msys2.org/docs/environments/ (defauts to MINGW64, MINGW32 or CLANGARM64, depending on the architecture)
23
24
24
25
# License: LGPL-3.0
25
26
26
27
27
28
# safety subshell to avoid executing anything in case this script is not downloaded properly
28
29
(
29
30
31
+
die() {
32
+
if [ -n"${NO_COLOR}" ] ;then
33
+
(>&2printf"%s\\n""$1")
34
+
else
35
+
(>&2printf"\\033[0;31m%s\\033[0m\\n""$1")
36
+
fi
37
+
exit 2
38
+
}
39
+
30
40
plat="$(uname -s)"
31
41
arch=$(uname -m)
32
42
ghver="0.1.20.0"
@@ -55,18 +65,40 @@ case "${plat}" in
55
65
;;
56
66
esac
57
67
68
+
case"${GHCUP_MSYS2_ENV}"in
69
+
"")
70
+
case"${arch}"in
71
+
x86_64|amd64)
72
+
GHCUP_MSYS2_ENV_DIR="mingw64" ;;
73
+
i*86)
74
+
GHCUP_MSYS2_ENV_DIR="mingw32" ;;
75
+
aarch64|arm64)
76
+
GHCUP_MSYS2_ENV_DIR="clangarm64" ;;
77
+
*) die "Unknown architecture: ${arch}" ;;
78
+
esac
79
+
;;
80
+
MSYS)
81
+
GHCUP_MSYS2_ENV_DIR="usr" ;;
82
+
UCRT64)
83
+
GHCUP_MSYS2_ENV_DIR="ucrt64" ;;
84
+
CLANG64)
85
+
GHCUP_MSYS2_ENV_DIR="clang64" ;;
86
+
CLANGARM64)
87
+
GHCUP_MSYS2_ENV_DIR="clangarm64" ;;
88
+
CLANG32)
89
+
GHCUP_MSYS2_ENV_DIR="clang32" ;;
90
+
MINGW64)
91
+
GHCUP_MSYS2_ENV_DIR="mingw64" ;;
92
+
MINGW32)
93
+
GHCUP_MSYS2_ENV_DIR="mingw32" ;;
94
+
*)
95
+
die "Invalid value for GHCUP_MSYS2_ENV. Valid values are: MSYS, UCRT64, CLANG64, CLANGARM64, CLANG32, MINGW64, MINGW32" ;;
Copy file name to clipboardExpand all lines: scripts/bootstrap/bootstrap-haskell.ps1
+44-6Lines changed: 44 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,9 @@ param (
46
46
# Whether to disable creation of several desktop shortcuts
47
47
[switch]$DontWriteDesktopShortcuts,
48
48
# Whether to disable adjusting bashrc (in msys2 env) with PATH
49
-
[switch]$DontAdjustBashRc
49
+
[switch]$DontAdjustBashRc,
50
+
# The msys2 environment to use, see https://www.msys2.org/docs/environments/ (defauts to MINGW64, MINGW32 or CLANGARM64, depending on the architecture)
51
+
[string]$Msys2Env
50
52
)
51
53
52
54
$DefaultMsys2Version="20221216"
@@ -194,6 +196,37 @@ if (!$SupportedArchitectures.contains($env:PROCESSOR_ARCHITECTURE)) {
194
196
Exit1
195
197
}
196
198
199
+
# parse Msys2Env and set the corresponding variables
0 commit comments