macos: symlink rustc dev libs to /usr/local/lib

Due to System Integrity Protection (SIP), exporting
LD_LIBRARY_PATH will not work on macOS systems.
Therefore, rather than disable SIP, we could symlink
those rust dev libs to /usr/local/bin.
I already tried install_name_tool(1) but couldn't make
clippy-driver work on CI for whatever reasons.
This commit is contained in:
Lzu Tao 2019-10-17 17:02:24 +07:00
parent b869eeb2a4
commit abafec5640

View file

@ -110,11 +110,16 @@ before_script:
rm rust-toolchain
./setup-toolchain.sh
- |
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
export PATH=$PATH:$(rustc --print sysroot)/bin
else
export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib
fi
SYSROOT=$(rustc --print sysroot)
case "$TRAVIS_OS_NAME" in
windows ) export PATH="${SYSROOT}/bin:${PATH}" ;;
linux ) export LD_LIBRARY_PATH="${SYSROOT}/lib" ;;
osx )
# See <https://github.com/nteract/nteract/issues/1523#issuecomment-301623519>
sudo mkdir -p /usr/local/lib
sudo find "$SYSROOT/lib" -maxdepth 1 -name '*.dylib' -exec ln -s {} /usr/local/lib \;
;;
esac
script:
- |