Skip to content

Commit eac470e

Browse files
committed
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.
1 parent 8a57b2c commit eac470e

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.travis.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,23 @@ before_script:
113113
rm rust-toolchain
114114
./setup-toolchain.sh
115115
- |
116-
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
117-
export PATH=$PATH:$(rustc --print sysroot)/bin
118-
else
119-
export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib
120-
fi
116+
SYSROOT=$(rustc --print sysroot)
117+
case "$TRAVIS_OS_NAME" in
118+
windows ) export PATH="${SYSROOT}/bin:${PATH}" ;;
119+
linux ) export LD_LIBRARY_PATH="${SYSROOT}/lib" ;;
120+
osx )
121+
# See <https://github.com/nteract/nteract/issues/1523#issuecomment-301623519>
122+
sudo mkdir -p /usr/local/lib
123+
sudo find "$SYSROOT/lib" -maxdepth 1 -name '*.dylib' -exec ln -s {} /usr/local/lib \;
124+
;;
125+
esac
121126
122127
script:
123128
- |
124-
if [[ -z ${INTEGRATION} ]]; then
125-
travis_wait 30 ./ci/base-tests.sh && sleep 5
126-
else
129+
if [[ -n ${INTEGRATION} ]]; then
127130
./ci/integration-tests.sh && sleep 5
131+
else
132+
travis_wait 30 ./ci/base-tests.sh && sleep 5
128133
fi
129134
130135
after_success:

0 commit comments

Comments
 (0)