Skip to content

Commit 6c8ff3f

Browse files
committed
Auto merge of #12812 - Alexendoo:driver-integration, r=flip1995
Manually set library paths in .github/driver.sh Fixes https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Windows.20CI.20failing Rustup 1.27.1 no longer adds `[SYSROOT]/bin` to `PATH` by default - rust-lang/rustup#3825. This is fine for the packaged binaries since windows loads `dll`s from the folder the executable is in, but our built one is in a different folder There's an environment variable to get the old behaviour back, but as it's deprecated and not much code I think returning to setting it manually is fine changelog: none
2 parents caad063 + 821dc87 commit 6c8ff3f

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

.github/driver.sh

+11-8
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22

33
set -ex
44

5+
sysroot="$(rustc --print sysroot)"
6+
case $OS in
7+
Linux) export LD_LIBRARY_PATH="$sysroot/lib" ;;
8+
macOS) export DYLD_FALLBACK_LIBRARY_PATH="$sysroot/lib" ;;
9+
Windows) export PATH="$(cygpath "$sysroot")/bin:$PATH" ;;
10+
*) exit 1
11+
esac
12+
513
# Check sysroot handling
6-
sysroot=$(./target/debug/clippy-driver --print sysroot)
7-
test "$sysroot" = "$(rustc --print sysroot)"
8-
9-
if [[ ${OS} == "Windows" ]]; then
10-
desired_sysroot=C:/tmp
11-
else
12-
desired_sysroot=/tmp
13-
fi
14+
test "$(./target/debug/clippy-driver --print sysroot)" = "$sysroot"
15+
16+
desired_sysroot="target/sysroot"
1417
# Set --sysroot in command line
1518
sysroot=$(./target/debug/clippy-driver --sysroot $desired_sysroot --print sysroot)
1619
test "$sysroot" = $desired_sysroot

.github/workflows/clippy.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@ jobs:
6969
working-directory: clippy_dev
7070

7171
- name: Test clippy-driver
72-
run: |
73-
TOOLCHAIN=$(rustup show active-toolchain | cut -f1 -d' ')
74-
rustup run $TOOLCHAIN bash .github/driver.sh
72+
run: .github/driver.sh
73+
env:
74+
OS: ${{ runner.os }}

.github/workflows/clippy_bors.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ jobs:
116116
working-directory: clippy_dev
117117

118118
- name: Test clippy-driver
119-
run: |
120-
TOOLCHAIN=$(rustup show active-toolchain | cut -f1 -d' ')
121-
rustup run $TOOLCHAIN bash .github/driver.sh
119+
run: .github/driver.sh
122120
env:
123121
OS: ${{ runner.os }}
124122

0 commit comments

Comments
 (0)