From 821dc871af2dfdab3f229bda2aa1ead25d6a0688 Mon Sep 17 00:00:00 2001 From: Alex Macleod Date: Thu, 16 May 2024 21:11:58 +0100 Subject: [PATCH] Manually set library paths in .github/driver.sh --- .github/driver.sh | 19 +++++++++++-------- .github/workflows/clippy.yml | 6 +++--- .github/workflows/clippy_bors.yml | 4 +--- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/driver.sh b/.github/driver.sh index 2eafdd0fbc87..09202b1878b2 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 8179e3e65b54..06bf3b6fdbfa 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 94515987eba4..1f4bec929182 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 }}