about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2025-01-07 13:31:29 +0000
committerGitHub <noreply@github.com>2025-01-07 13:31:29 +0000
commit4ef917796aaba3921661c5f503acb482f21c4a33 (patch)
tree38ee84f79ba12b576d5f280b915a173c160dea73
parentd0d5b8a34a133c7ae47f9a38e63d6c26bd999095 (diff)
parent12d31375601b592c5451dd52de4633393229a9a2 (diff)
downloadrust-4ef917796aaba3921661c5f503acb482f21c4a33.tar.gz
rust-4ef917796aaba3921661c5f503acb482f21c4a33.zip
CI: be compatible with both Rustup pre-1.28.0 and 1.28.0 (#13944)
`rustup show active-toolchain` will no longer install the default
toolchain starting from Rustup 1.28.0, and `rustup toolchain install`
without extra arguments is not supported in Rustup pre-1.28.0.

The Rustup change and proposed solution is described in
<https://internals.rust-lang.org/t/seeking-beta-testers-for-rustup-v1-28-0/22060>.

changelog: none
-rw-r--r--.github/workflows/clippy_mq.yml17
-rw-r--r--.github/workflows/clippy_pr.yml4
2 files changed, 15 insertions, 6 deletions
diff --git a/.github/workflows/clippy_mq.yml b/.github/workflows/clippy_mq.yml
index 078a278e21a..dee7d028655 100644
--- a/.github/workflows/clippy_mq.yml
+++ b/.github/workflows/clippy_mq.yml
@@ -78,7 +78,8 @@ jobs:
     - name: Install toolchain
       run: |
         rustup set default-host ${{ matrix.host }}
-        rustup show active-toolchain
+        # Use a way compatible with Rustup pre-1.28.0 and Rustup 1.28.0
+        rustup show active-toolchain || rustup toolchain install
 
     # Run
     - name: Build
@@ -129,7 +130,9 @@ jobs:
         persist-credentials: false
 
     - name: Install toolchain
-      run: rustup show active-toolchain
+      run: |
+        # Use a way compatible with Rustup pre-1.28.0 and Rustup 1.28.0
+        rustup show active-toolchain || rustup toolchain install
 
     - name: Test metadata collection
       run: cargo collect-metadata
@@ -146,7 +149,9 @@ jobs:
         persist-credentials: false
 
     - name: Install toolchain
-      run: rustup show active-toolchain
+      run: |
+        # Use a way compatible with Rustup pre-1.28.0 and Rustup 1.28.0
+        rustup show active-toolchain || rustup toolchain install
 
     # Run
     - name: Build Integration Test
@@ -200,7 +205,9 @@ jobs:
         persist-credentials: false
 
     - name: Install toolchain
-      run: rustup show active-toolchain
+      run: |
+        # Use a way compatible with Rustup pre-1.28.0 and Rustup 1.28.0
+        rustup show active-toolchain || rustup toolchain install
 
     # Download
     - name: Download target dir
@@ -215,7 +222,7 @@ jobs:
     # Run
     - name: Test ${{ matrix.integration }}
       run: |
-          TOOLCHAIN=$(rustup show active-toolchain | cut -f1 -d' ')
+          TOOLCHAIN=$(rustup show active-toolchain | head -n 1 | cut -f1 -d' ')
           rustup run $TOOLCHAIN $CARGO_TARGET_DIR/debug/integration --show-output
       env:
         INTEGRATION: ${{ matrix.integration }}
diff --git a/.github/workflows/clippy_pr.yml b/.github/workflows/clippy_pr.yml
index 9e7adc2a5c3..80523d91f4f 100644
--- a/.github/workflows/clippy_pr.yml
+++ b/.github/workflows/clippy_pr.yml
@@ -30,7 +30,9 @@ jobs:
         persist-credentials: false
 
     - name: Install toolchain
-      run: rustup show active-toolchain
+      run: |
+        # Use a way compatible with Rustup pre-1.28.0 and Rustup 1.28.0
+        rustup show active-toolchain || rustup toolchain install
 
     # Run
     - name: Build