about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2025-02-19 21:16:11 +0100
committerGitHub <noreply@github.com>2025-02-19 21:16:11 +0100
commit40379e299c987e2dda1a065ad9769ced0a5c5721 (patch)
treef1b668ec40becf0e62e8c698c980d4c9233419db
parent59d2b102b487ba93c30df3123aa3b440e78aa35a (diff)
parentec8ec41d9ee8b03bbddf815217452e37656e2d0b (diff)
Rollup merge of #136815 - ChrisDenton:fix-mingw-ci, r=Kobzol
CI: Stop /msys64/bin from being prepended to PATH in msys2 shell

We used to do this along time ago but we stopped doing it when we started installing msys2 manually. https://github.com/rust-lang/rust/blob/4fd3cf96a1db7771ef4f332b9eb1ad17fa0fd091/src/ci/scripts/install-msys2.sh#L11-L13

Fixes #136795

try-job: dist-i686-mingw
-rw-r--r--.github/workflows/ci.yml5
-rwxr-xr-xsrc/ci/scripts/install-mingw.sh6
2 files changed, 11 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0934e42b277..c6f3fcada08 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -173,6 +173,11 @@ jobs:
       - name: ensure the stable version number is correct
         run: src/ci/scripts/verify-stable-version-number.sh
 
+      # Show the environment just before we run the build
+      # This makes it easier to diagnose problems with the above install scripts.
+      - name: show the current environment
+        run: src/ci/scripts/dump-environment.sh
+
       - name: run the build
         # Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
         run: src/ci/scripts/run-build-from-ci.sh 2>&1
diff --git a/src/ci/scripts/install-mingw.sh b/src/ci/scripts/install-mingw.sh
index 91eab2e7a08..c8c501e646a 100755
--- a/src/ci/scripts/install-mingw.sh
+++ b/src/ci/scripts/install-mingw.sh
@@ -32,6 +32,12 @@ if isWindows && isKnownToBeMingwBuild; then
             ;;
     esac
 
+    # Stop /msys64/bin from being prepended to PATH by adding the bin directory manually.
+    # Note that this intentionally uses a Windows style path instead of the msys2 path to
+    # avoid being auto-translated into `/usr/bin`, which will not have the desired effect.
+    msys2Path="c:/msys64"
+    ciCommandAddPath "${msys2Path}/usr/bin"
+
     mingw_dir="mingw${bits}"
 
     curl -o mingw.7z "${MIRRORS_BASE}/${mingw_archive}"