diff options
| author | bors <bors@rust-lang.org> | 2024-05-16 20:54:33 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-05-16 20:54:33 +0000 |
| commit | 6c8ff3f894909a8c46e201b8779ebb365fd2e84d (patch) | |
| tree | 71e4770868fb1cd186ebac7cbf62696fa2d6b5c5 | |
| parent | caad063933e5012b152d883a6c03f1d0ad5ec6a8 (diff) | |
| parent | 821dc871af2dfdab3f229bda2aa1ead25d6a0688 (diff) | |
| download | rust-6c8ff3f894909a8c46e201b8779ebb365fd2e84d.tar.gz rust-6c8ff3f894909a8c46e201b8779ebb365fd2e84d.zip | |
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 - https://github.com/rust-lang/rustup/issues/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
| -rwxr-xr-x | .github/driver.sh | 19 | ||||
| -rw-r--r-- | .github/workflows/clippy.yml | 6 | ||||
| -rw-r--r-- | .github/workflows/clippy_bors.yml | 4 |
3 files changed, 15 insertions, 14 deletions
diff --git a/.github/driver.sh b/.github/driver.sh index 2eafdd0fbc8..09202b1878b 100755 --- a/.github/driver.sh +++ b/.github/driver.sh @@ -2,15 +2,18 @@ set -ex +sysroot="$(rustc --print sysroot)" +case $OS in + Linux) export LD_LIBRARY_PATH="$sysroot/lib" ;; + macOS) export DYLD_FALLBACK_LIBRARY_PATH="$sysroot/lib" ;; + Windows) export PATH="$(cygpath "$sysroot")/bin:$PATH" ;; + *) exit 1 +esac + # Check sysroot handling -sysroot=$(./target/debug/clippy-driver --print sysroot) -test "$sysroot" = "$(rustc --print sysroot)" - -if [[ ${OS} == "Windows" ]]; then - desired_sysroot=C:/tmp -else - desired_sysroot=/tmp -fi +test "$(./target/debug/clippy-driver --print sysroot)" = "$sysroot" + +desired_sysroot="target/sysroot" # Set --sysroot in command line sysroot=$(./target/debug/clippy-driver --sysroot $desired_sysroot --print sysroot) test "$sysroot" = $desired_sysroot diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 8179e3e65b5..06bf3b6fdbf 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -69,6 +69,6 @@ jobs: working-directory: clippy_dev - name: Test clippy-driver - run: | - TOOLCHAIN=$(rustup show active-toolchain | cut -f1 -d' ') - rustup run $TOOLCHAIN bash .github/driver.sh + run: .github/driver.sh + env: + OS: ${{ runner.os }} diff --git a/.github/workflows/clippy_bors.yml b/.github/workflows/clippy_bors.yml index 94515987eba..1f4bec92918 100644 --- a/.github/workflows/clippy_bors.yml +++ b/.github/workflows/clippy_bors.yml @@ -116,9 +116,7 @@ jobs: working-directory: clippy_dev - name: Test clippy-driver - run: | - TOOLCHAIN=$(rustup show active-toolchain | cut -f1 -d' ') - rustup run $TOOLCHAIN bash .github/driver.sh + run: .github/driver.sh env: OS: ${{ runner.os }} |
