about summary refs log tree commit diff
path: root/src/ci/scripts
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-05-04 05:40:24 +0000
committerbors <bors@rust-lang.org>2021-05-04 05:40:24 +0000
commitc20c9219dae5ea56ce9bf1c211fafdc7da8700b9 (patch)
tree6e5bbb7003ff901ff178d7ecf21aecdb72f7487e /src/ci/scripts
parent0309953232d9957aef4c7c5a24fcb30735b2066b (diff)
parent22d187a3f68017297102793e3350f18c00c23429 (diff)
downloadrust-c20c9219dae5ea56ce9bf1c211fafdc7da8700b9.tar.gz
rust-c20c9219dae5ea56ce9bf1c211fafdc7da8700b9.zip
Auto merge of #84874 - joshtriplett:ci-extract-llvm-win64-installer, r=Mark-Simulacrum
CI: Extract LLVM win64 installer directly, using 7z

Currently, we have LLVM tarballs for win64, generated by someone running
the installer via wine and tarring up the result.

7z knows how to extract NSIS installers directly, and the result is
identical to our tarball, except that it doesn't include `Uninstall.exe`
(which we don't care about) and it includes the NSIS plugin directory
(which we also don't care about).

This simplifies the process of upgrading CI, and allows us to just
mirror the upstream release .exe directly. This also improves our
supply chain.
Diffstat (limited to 'src/ci/scripts')
-rwxr-xr-xsrc/ci/scripts/install-clang.sh21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/ci/scripts/install-clang.sh b/src/ci/scripts/install-clang.sh
index 8070e90f155..a69e49b3f08 100755
--- a/src/ci/scripts/install-clang.sh
+++ b/src/ci/scripts/install-clang.sh
@@ -42,23 +42,14 @@ elif isWindows && [[ ${CUSTOM_MINGW-0} -ne 1 ]]; then
     # clang has an output mode compatible with MinGW that we need. If it does we
     # should switch to clang for MinGW as well!
     #
-    # Note that the LLVM installer is an NSIS installer
-    #
-    # Original downloaded here came from:
-    #
-    #   https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win64.exe
-    #
-    # That installer was run through `wine ./installer.exe /S /NCRC` on Linux
-    # and then the resulting installation directory (found in
-    # `$HOME/.wine/drive_c/Program Files/LLVM`) was packaged up into a tarball.
-    # We've had issues otherwise that the installer will randomly hang, provide
-    # not a lot of useful information, pollute global state, etc. In general the
-    # tarball is just more confined and easier to deal with when working with
-    # various CI environments.
+    # The LLVM installer is an NSIS installer, which we can extract with 7z. We
+    # don't want to run the installer directly; extracting it is more reliable
+    # in CI environments.
 
-    mkdir -p citools
+    mkdir -p citools/clang-rust
     cd citools
-    curl -f "${MIRRORS_BASE}/LLVM-${LLVM_VERSION}-win64.tar.gz" | tar xzf -
+    curl -f "${MIRRORS_BASE}/LLVM-${LLVM_VERSION}-win64.exe" -o "LLVM-${LLVM_VERSION}-win64.exe"
+    7z x -oclang-rust/ "LLVM-${LLVM_VERSION}-win64.exe"
     ciCommandSetEnv RUST_CONFIGURE_ARGS \
         "${RUST_CONFIGURE_ARGS} --set llvm.clang-cl=$(pwd)/clang-rust/bin/clang-cl.exe"
 fi