Skip to content

Commit fa5ad16

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 a0c4912 commit fa5ad16

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
@@ -120,11 +120,16 @@ before_script:
120120
rm rust-toolchain
121121
./setup-toolchain.sh
122122
- |
123-
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
124-
export PATH=$PATH:$(rustc --print sysroot)/bin
125-
else
126-
export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib
127-
fi
123+
SYSROOT=$(rustc --print sysroot)
124+
case "$TRAVIS_OS_NAME" in
125+
windows ) export PATH="${SYSROOT}/bin:${PATH}" ;;
126+
linux ) export LD_LIBRARY_PATH="${SYSROOT}/lib" ;;
127+
osx )
128+
# See <https://github.com/nteract/nteract/issues/1523#issuecomment-301623519>
129+
sudo mkdir -p /usr/local/lib
130+
sudo find "$SYSROOT/lib" -maxdepth 1 -name '*.dylib' -exec ln -s {} /usr/local/lib \;
131+
;;
132+
esac
128133
129134
script:
130135
- |

0 commit comments

Comments
 (0)