Skip to content

Commit 192531b

Browse files
committed
fix: default to GNU host in Cygwin/MSYS/MinGW environments (#4221)
1 parent 4268597 commit 192531b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

rustup-init.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,21 @@ main() {
179179

180180
ignore "$_file" "$@" < /dev/tty
181181
else
182+
# Default to GNU toolchain under Cygwin/MSYS/MinGW environments
183+
case "$(uname -s)" in
184+
CYGWIN*|MSYS*|MINGW*)
185+
_has_default_host_arg=false
186+
for arg in "$@"; do
187+
case "$arg" in
188+
--default-host*) _has_default_host_arg=true ;;
189+
esac
190+
done
191+
if [ "$_has_default_host_arg" = false ]; then
192+
set -- "$@" --default-host x86_64-pc-windows-gnu
193+
fi
194+
;;
195+
esac
196+
182197
ignore "$_file" "$@"
183198
fi
184199

0 commit comments

Comments
 (0)