Skip to content

Commit abafec5

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 b869eeb commit abafec5

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.travis.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,16 @@ before_script:
110110
rm rust-toolchain
111111
./setup-toolchain.sh
112112
- |
113-
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
114-
export PATH=$PATH:$(rustc --print sysroot)/bin
115-
else
116-
export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib
117-
fi
113+
SYSROOT=$(rustc --print sysroot)
114+
case "$TRAVIS_OS_NAME" in
115+
windows ) export PATH="${SYSROOT}/bin:${PATH}" ;;
116+
linux ) export LD_LIBRARY_PATH="${SYSROOT}/lib" ;;
117+
osx )
118+
# See <https://github.com/nteract/nteract/issues/1523#issuecomment-301623519>
119+
sudo mkdir -p /usr/local/lib
120+
sudo find "$SYSROOT/lib" -maxdepth 1 -name '*.dylib' -exec ln -s {} /usr/local/lib \;
121+
;;
122+
esac
118123
119124
script:
120125
- |

0 commit comments

Comments
 (0)