Skip to content

Commit 30ef039

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 b24ac7e commit 30ef039

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
@@ -113,11 +113,16 @@ 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
- |

0 commit comments

Comments
 (0)