Skip to content

Commit 795f93b

Browse files
committed
ci: Install clang on Windows through tarballs
Previously we used the executables built the LLVM project but these executables are difficult to run in a CI environment, they can accidentally pollute global state, etc. In testing some of the possible 4-core machine environments for Azure this step would frequently cause issues. To assuage these future issues and hopefully make builds slightly more self-contained, this commit changes to install from a tarball instead. The tarball isn't provided by LLVM itself, but we use the offical LLVM installer to extract itself and then we pack up the LLVM installation directory into the tarball.
1 parent e34d4ae commit 795f93b

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.azure-pipelines/steps/install-clang.yml

+12-6
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,18 @@ steps:
2626
#
2727
# Original downloaded here came from
2828
# http://releases.llvm.org/7.0.0/LLVM-7.0.0-win64.exe
29-
- script: |
30-
powershell -Command "$ProgressPreference = 'SilentlyContinue'; iwr -outf %TEMP%\LLVM-7.0.0-win64.exe https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/LLVM-7.0.0-win64.exe"
31-
set CLANG_DIR=%CD%\citools\clang-rust
32-
%TEMP%\LLVM-7.0.0-win64.exe /S /NCRC /D=%CLANG_DIR%
33-
set RUST_CONFIGURE_ARGS=%RUST_CONFIGURE_ARGS% --set llvm.clang-cl=%CLANG_DIR%\bin\clang-cl.exe
34-
echo ##vso[task.setvariable variable=RUST_CONFIGURE_ARGS]%RUST_CONFIGURE_ARGS%
29+
# That installer was run through `wine` on Linux and then the resulting
30+
# installation directory (found in `$HOME/.wine/drive_c/Program Files/LLVM`) was
31+
# packaged up into a tarball. We've had issues otherwise that the installer will
32+
# randomly hang, provide not a lot of useful information, pollute global state,
33+
# etc. In general the tarball is just more confined and easier to deal with when
34+
# working with various CI environments.
35+
- bash: |
36+
set -e
37+
mkdir -p citools
38+
cd citools
39+
curl -f https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/LLVM-7.0.0-win64.tar.gz | tar xzf -
40+
echo "##vso[task.setvariable variable=RUST_CONFIGURE_ARGS]$RUST_CONFIGURE_ARGS --set llvm.clang-cl=`pwd`/clang-rust/bin/clang-cl.exe"
3541
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['MINGW_URL'],''))
3642
displayName: Install clang (Windows)
3743

0 commit comments

Comments
 (0)