Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually set library paths in .github/driver.sh #12812

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .github/driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
4 changes: 1 addition & 3 deletions .github/workflows/clippy_bors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down