Skip to content

Commit 3b8da4a

Browse files
committed
Auto merge of #12382 - Alexendoo:macos-ci, r=flip1995
Bump macOS CI version to 13 I looked into the random failures we've been getting on macOS CI, not entirely sure what is going on but it seems to be an issue out of our department. A [plain driver](https://github.com/Alexendoo/rust-clippy/blob/314425001df19a82c295952b26664704d06e9348/src/driver.rs) being ran on the test files [without `ui_test` or any special flags](https://github.com/Alexendoo/rust-clippy/blob/314425001df19a82c295952b26664704d06e9348/src/driver.rs) hit the same issue It didn't occur on `macos-13` the few times I tried it though so let's upgrade to that. [The current `macos-latest` refers to `macos-12`](https://github.com/actions/runner-images?tab=readme-ov-file#available-images), later this year it will refer to `macos-14` which runs on `aarch64` so specifying the version for our x64 macOS tests will also save a future headache r? `@flip1995` changelog: none
2 parents 00ff8c9 + ce4b81d commit 3b8da4a

File tree

3 files changed

+11
-36
lines changed

3 files changed

+11
-36
lines changed

.github/driver.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ diff -u normalized.stderr tests/ui/double_neg.stderr
5050

5151
# make sure "clippy-driver --rustc --arg" and "rustc --arg" behave the same
5252
SYSROOT=$(rustc --print sysroot)
53-
diff -u <(LD_LIBRARY_PATH=${SYSROOT}/lib ./target/debug/clippy-driver --rustc --version --verbose) <(rustc --version --verbose)
53+
diff -u <(./target/debug/clippy-driver --rustc --version --verbose) <(rustc --version --verbose)
5454

5555
echo "fn main() {}" >target/driver_test.rs
5656
# we can't run 2 rustcs on the same file at the same time
57-
CLIPPY=$(LD_LIBRARY_PATH=${SYSROOT}/lib ./target/debug/clippy-driver ./target/driver_test.rs --rustc)
57+
CLIPPY=$(./target/debug/clippy-driver ./target/driver_test.rs --rustc)
5858
RUSTC=$(rustc ./target/driver_test.rs)
5959
diff -u <($CLIPPY) <($RUSTC)
6060

.github/workflows/clippy.yml

+3-8
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ jobs:
4444
run: rustup show active-toolchain
4545

4646
# Run
47-
- name: Set LD_LIBRARY_PATH (Linux)
48-
run: |
49-
SYSROOT=$(rustc --print sysroot)
50-
echo "LD_LIBRARY_PATH=${SYSROOT}/lib${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}" >> $GITHUB_ENV
51-
5247
- name: Build
5348
run: cargo build --tests --features deny-warnings,internal
5449

@@ -72,6 +67,6 @@ jobs:
7267
working-directory: clippy_dev
7368

7469
- name: Test clippy-driver
75-
run: bash .github/driver.sh
76-
env:
77-
OS: ${{ runner.os }}
70+
run: |
71+
TOOLCHAIN=$(rustup show active-toolchain | cut -f1 -d' ')
72+
rustup run $TOOLCHAIN bash .github/driver.sh

.github/workflows/clippy_bors.yml

+6-26
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
host: i686-unknown-linux-gnu
6060
- os: windows-latest
6161
host: x86_64-pc-windows-msvc
62-
- os: macos-latest
62+
- os: macos-13
6363
host: x86_64-apple-darwin
6464

6565
runs-on: ${{ matrix.os }}
@@ -87,23 +87,6 @@ jobs:
8787
rustup show active-toolchain
8888
8989
# Run
90-
- name: Set LD_LIBRARY_PATH (Linux)
91-
if: runner.os == 'Linux'
92-
run: |
93-
SYSROOT=$(rustc --print sysroot)
94-
echo "LD_LIBRARY_PATH=${SYSROOT}/lib${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}" >> $GITHUB_ENV
95-
- name: Link rustc dylib (MacOS)
96-
if: runner.os == 'macOS'
97-
run: |
98-
SYSROOT=$(rustc --print sysroot)
99-
sudo mkdir -p /usr/local/lib
100-
sudo find "${SYSROOT}/lib" -maxdepth 1 -name '*dylib' -exec ln -s {} /usr/local/lib \;
101-
- name: Set PATH (Windows)
102-
if: runner.os == 'Windows'
103-
run: |
104-
SYSROOT=$(rustc --print sysroot)
105-
echo "$SYSROOT/bin" >> $GITHUB_PATH
106-
10790
- name: Build
10891
run: cargo build --tests --features deny-warnings,internal
10992

@@ -136,7 +119,9 @@ jobs:
136119
working-directory: clippy_dev
137120

138121
- name: Test clippy-driver
139-
run: bash .github/driver.sh
122+
run: |
123+
TOOLCHAIN=$(rustup show active-toolchain | cut -f1 -d' ')
124+
rustup run $TOOLCHAIN bash .github/driver.sh
140125
env:
141126
OS: ${{ runner.os }}
142127

@@ -236,11 +221,6 @@ jobs:
236221
- name: Install toolchain
237222
run: rustup show active-toolchain
238223

239-
- name: Set LD_LIBRARY_PATH
240-
run: |
241-
SYSROOT=$(rustc --print sysroot)
242-
echo "LD_LIBRARY_PATH=${SYSROOT}/lib${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}" >> $GITHUB_ENV
243-
244224
# Download
245225
- name: Download target dir
246226
uses: actions/download-artifact@v3
@@ -254,8 +234,8 @@ jobs:
254234
# Run
255235
- name: Test ${{ matrix.integration }}
256236
run: |
257-
RUSTUP_TOOLCHAIN="$(rustup show active-toolchain | grep -o -E "nightly-[0-9]{4}-[0-9]{2}-[0-9]{2}")" \
258-
$CARGO_TARGET_DIR/debug/integration --show-output
237+
TOOLCHAIN=$(rustup show active-toolchain | cut -f1 -d' ')
238+
rustup run $TOOLCHAIN $CARGO_TARGET_DIR/debug/integration --show-output
259239
env:
260240
INTEGRATION: ${{ matrix.integration }}
261241

0 commit comments

Comments
 (0)