about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLzu Tao <taolzu@gmail.com>2019-10-17 17:02:24 +0700
committerLzu Tao <taolzu@gmail.com>2019-10-22 10:14:39 +0700
commitabafec5640082f8a9792d2b591631a52004c0643 (patch)
treecaed6d876816b77c5467d3f38e90f851952c080b
parentb869eeb2a451c8ae84d111e9885df4677c4f9446 (diff)
downloadrust-abafec5640082f8a9792d2b591631a52004c0643.tar.gz
rust-abafec5640082f8a9792d2b591631a52004c0643.zip
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.
-rw-r--r--.travis.yml15
1 files changed, 10 insertions, 5 deletions
diff --git a/.travis.yml b/.travis.yml
index f707e622ad8..cddeafdbf7d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -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:
   - |