Skip to content

Commit 00258dc

Browse files
committed
Auto merge of #124850 - dpaoliello:clang2022, r=<try>
Upgrade pre-built Clang used in MSVC and MacOS builds, move MSVC builds to Server 2022 Fixes #92948 Example working MacOS and Windows builds: <https://github.com/rust-lang/rust/actions/runs/8989360201> Using Server 2022 for AArch64 MSVC is blocked by <llvm/llvm-project#81849>. I'll see if I can work around the issue in a follow up PR.
2 parents b923ea4 + 768e382 commit 00258dc

File tree

3 files changed

+31
-11
lines changed

3 files changed

+31
-11
lines changed

src/ci/docker/host-x86_64/dist-x86_64-linux/build-clang.sh

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ set -ex
44

55
source shared.sh
66

7+
# Try to keep the LLVM version here in sync with src/ci/scripts/install-clang.sh
78
LLVM=llvmorg-18.1.0
89

910
mkdir llvm-project

src/ci/github-actions/jobs.yml

+19-6
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,16 @@ try:
103103
env:
104104
CODEGEN_BACKENDS: llvm,cranelift
105105
<<: *job-linux-16c
106+
- image: x86_64-msvc
107+
env:
108+
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
109+
SCRIPT: make ci-msvc
110+
<<: *job-windows-8c
111+
- image: i686-msvc
112+
env:
113+
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-msvc
114+
SCRIPT: make ci-msvc
115+
<<: *job-windows-8c
106116

107117
# Main CI jobs that have to be green to merge a commit into master
108118
# These jobs automatically inherit envs.auto, to avoid repeating
@@ -349,21 +359,21 @@ auto:
349359
env:
350360
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
351361
SCRIPT: make ci-msvc
352-
<<: *job-windows-2019-8c
362+
<<: *job-windows-8c
353363

354364
- image: i686-msvc
355365
env:
356366
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-msvc
357367
SCRIPT: make ci-msvc
358-
<<: *job-windows-2019-8c
368+
<<: *job-windows-8c
359369

360370
- image: x86_64-msvc-ext
361371
env:
362372
SCRIPT: python x.py --stage 2 test src/tools/cargotest src/tools/cargo && src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh x.py /tmp/toolstate/toolstates.json windows
363373
HOST_TARGET: x86_64-pc-windows-msvc
364374
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-lld --save-toolstates=/tmp/toolstate/toolstates.json
365375
DEPLOY_TOOLSTATES_JSON: toolstates-windows.json
366-
<<: *job-windows-2019-8c
376+
<<: *job-windows-8c
367377

368378
# 32/64-bit MinGW builds.
369379
#
@@ -414,7 +424,7 @@ auto:
414424
--set rust.codegen-units=1
415425
SCRIPT: python x.py build --set rust.debug=true opt-dist && PGO_HOST=x86_64-pc-windows-msvc ./build/x86_64-pc-windows-msvc/stage0-tools-bin/opt-dist windows-ci -- python x.py dist bootstrap --include-default-paths
416426
DIST_REQUIRE_ALL_TOOLS: 1
417-
<<: *job-windows-2019-8c
427+
<<: *job-windows-8c
418428

419429
- image: dist-i686-msvc
420430
env:
@@ -426,8 +436,11 @@ auto:
426436
--enable-profiler
427437
SCRIPT: python x.py dist bootstrap --include-default-paths
428438
DIST_REQUIRE_ALL_TOOLS: 1
429-
<<: *job-windows-2019-8c
439+
<<: *job-windows-8c
430440

441+
# FIXME: There is a Clang bug that prevents using the VS 2022 STL when
442+
# building for ARM64: https://github.com/llvm/llvm-project/pull/81849
443+
# This is fixed in LLVM 19, but can't be backported to LLVM 18.
431444
- image: dist-aarch64-msvc
432445
env:
433446
RUST_CONFIGURE_ARGS: >-
@@ -471,4 +484,4 @@ auto:
471484
env:
472485
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-extended --enable-profiler
473486
SCRIPT: python x.py dist bootstrap --include-default-paths
474-
<<: *job-windows-2019-8c
487+
<<: *job-windows-8c

src/ci/scripts/install-clang.sh

+11-5
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,24 @@ IFS=$'\n\t'
1010
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
1111

1212
# Update both macOS's and Windows's tarballs when bumping the version here.
13-
LLVM_VERSION="14.0.5"
13+
# Try to keep this in sync with src/ci/docker/host-x86_64/dist-x86_64-linux/build-clang.sh
14+
LLVM_VERSION="18.1.4"
1415

1516
if isMacOS; then
17+
# FIXME: This is the latest pre-built version of LLVM that's available for
18+
# x86_64 MacOS. We may want to consider bulding our own LLVM binaries
19+
# instead, or set `USE_XCODE_CLANG` like AArch64 does.
20+
LLVM_VERSION="15.0.7"
21+
1622
# If the job selects a specific Xcode version, use that instead of
1723
# downloading our own version.
1824
if [[ ${USE_XCODE_CLANG-0} -eq 1 ]]; then
1925
bindir="$(xcode-select --print-path)/Toolchains/XcodeDefault.xctoolchain/usr/bin"
2026
else
21-
file="${MIRRORS_BASE}/clang%2Bllvm-${LLVM_VERSION}-x86_64-apple-darwin.tar.xz"
22-
retry curl -f "${file}" -o "clang+llvm-${LLVM_VERSION}-x86_64-apple-darwin.tar.xz"
23-
tar xJf "clang+llvm-${LLVM_VERSION}-x86_64-apple-darwin.tar.xz"
24-
bindir="$(pwd)/clang+llvm-${LLVM_VERSION}-x86_64-apple-darwin/bin"
27+
file="${MIRRORS_BASE}/clang%2Bllvm-${LLVM_VERSION}-x86_64-apple-darwin21.0.tar.xz"
28+
retry curl -f "${file}" -o "clang+llvm-${LLVM_VERSION}-x86_64-apple-darwin21.0.tar.xz"
29+
tar xJf "clang+llvm-${LLVM_VERSION}-x86_64-apple-darwin21.0.tar.xz"
30+
bindir="$(pwd)/clang+llvm-${LLVM_VERSION}-x86_64-apple-darwin21.0/bin"
2531
fi
2632

2733
ciCommandSetEnv CC "${bindir}/clang"

0 commit comments

Comments
 (0)