Skip to content

Commit 8a734d8

Browse files
committed
Test building on Server 2022
1 parent 5557f8c commit 8a734d8

File tree

7 files changed

+160
-79
lines changed

7 files changed

+160
-79
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -164,20 +164,6 @@ jobs:
164164
- name: create github artifacts
165165
run: src/ci/scripts/create-doc-artifacts.sh
166166
if: success() && !env.SKIP_JOB
167-
- name: upload artifacts to github
168-
uses: actions/upload-artifact@v4
169-
with:
170-
name: "${{ env.DOC_ARTIFACT_NAME }}"
171-
path: obj/artifacts/doc
172-
if-no-files-found: ignore
173-
retention-days: 5
174-
if: success() && !env.SKIP_JOB
175-
- name: upload artifacts to S3
176-
run: src/ci/scripts/upload-artifacts.sh
177-
env:
178-
AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
179-
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
180-
if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
181167
master:
182168
name: master
183169
runs-on: ubuntu-latest

src/bootstrap/src/core/config/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ fn detect_src_and_out() {
102102
test(parse(""), None);
103103

104104
{
105-
let build_dir = if cfg!(windows) { Some("C:\\tmp") } else { Some("/tmp") };
105+
let build_dir = if cfg!(windows) { Some("D:\\tmp") } else { Some("/tmp") };
106106
test(parse("build.build-dir = \"/tmp\""), build_dir);
107107
}
108108
}

src/ci/github-actions/ci.yml

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ x--expand-yaml-anchors--remove:
9797
<<: *base-job
9898

9999
- &job-windows-8c
100-
os: windows-2019-8core-32gb
100+
os: windows-2022
101101
<<: *base-job
102102

103103
- &job-windows-16c
104-
os: windows-2019-16core-64gb
104+
os: windows-2022
105105
<<: *base-job
106106

107107
- &job-aarch64-linux
@@ -261,29 +261,6 @@ x--expand-yaml-anchors--remove:
261261
run: src/ci/scripts/create-doc-artifacts.sh
262262
<<: *step
263263

264-
- name: upload artifacts to github
265-
uses: actions/upload-artifact@v4
266-
with:
267-
# name is set in previous step
268-
name: ${{ env.DOC_ARTIFACT_NAME }}
269-
path: obj/artifacts/doc
270-
if-no-files-found: ignore
271-
retention-days: 5
272-
<<: *step
273-
274-
- name: upload artifacts to S3
275-
run: src/ci/scripts/upload-artifacts.sh
276-
env:
277-
AWS_ACCESS_KEY_ID: ${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}
278-
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}
279-
# Adding a condition on DEPLOY=1 or DEPLOY_ALT=1 is not needed as all deploy
280-
# builders *should* have the AWS credentials available. Still, explicitly
281-
# adding the condition is helpful as this way CI will not silently skip
282-
# deploying artifacts from a dist builder if the variables are misconfigured,
283-
# erroring about invalid credentials instead.
284-
if: success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')
285-
<<: *step
286-
287264
# These snippets are used by the try-success, try-failure, auto-success and auto-failure jobs.
288265
# Check out their documentation for more information on why they're needed.
289266

src/ci/github-actions/jobs.yml

Lines changed: 135 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ runners:
2727
<<: *base-job
2828

2929
- &job-windows-8c
30-
os: windows-2019-8core-32gb
30+
os: windows-2022
3131
<<: *base-job
3232

3333
- &job-windows-16c
34-
os: windows-2019-16core-64gb
34+
os: windows-2022
3535
<<: *base-job
3636

3737
- &job-aarch64-linux
@@ -66,17 +66,140 @@ envs:
6666
# These jobs automatically inherit envs.pr, to avoid repeating
6767
# it in each job definition.
6868
pr:
69-
- image: mingw-check
70-
<<: *job-linux-4c
71-
- image: mingw-check-tidy
72-
continue_on_error: true
73-
<<: *job-linux-4c
74-
- image: x86_64-gnu-llvm-17
69+
# WORKING: Requires updated Clang
70+
# - image: x86_64-msvc
71+
# env:
72+
# RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
73+
# SCRIPT: make ci-msvc
74+
# <<: *job-windows-8c
75+
76+
- image: i686-msvc
7577
env:
76-
ENABLE_GCC_CODEGEN: "1"
77-
<<: *job-linux-16c
78-
- image: x86_64-gnu-tools
79-
<<: *job-linux-16c
78+
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-msvc
79+
SCRIPT: make ci-msvc
80+
<<: *job-windows-8c
81+
82+
# WORKING: Requires updated Clang
83+
#- image: x86_64-msvc-ext
84+
# env:
85+
# 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
86+
# HOST_TARGET: x86_64-pc-windows-msvc
87+
# RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-lld --save-toolstates=/tmp/toolstate/toolstates.json
88+
# DEPLOY_TOOLSTATES_JSON: toolstates-windows.json
89+
# <<: *job-windows-8c
90+
91+
# 32/64-bit MinGW builds.
92+
#
93+
# We are using MinGW with POSIX threads since LLVM requires
94+
# C++'s std::thread which is disabled in libstdc++ with win32 threads.
95+
# FIXME: Libc++ doesn't have this limitation so we can avoid
96+
# winpthreads if we switch to it.
97+
#
98+
# Instead of relying on the MinGW version installed on CI we download
99+
# and install one ourselves so we won't be surprised by changes to CI's
100+
# build image.
101+
#
102+
# Finally, note that the downloads below are all in the `rust-lang-ci` S3
103+
# bucket, but they clearly didn't originate there! The downloads originally
104+
# came from the mingw-w64 SourceForge download site. Unfortunately
105+
# SourceForge is notoriously flaky, so we mirror it on our own infrastructure.
106+
107+
- image: i686-mingw
108+
env:
109+
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu
110+
SCRIPT: make ci-mingw
111+
# We are intentionally allowing an old toolchain on this builder (and that's
112+
# incompatible with LLVM downloads today).
113+
NO_DOWNLOAD_CI_LLVM: 1
114+
CUSTOM_MINGW: 1
115+
<<: *job-windows-8c
116+
117+
- image: x86_64-mingw
118+
env:
119+
SCRIPT: make ci-mingw
120+
RUST_CONFIGURE_ARGS: >-
121+
--build=x86_64-pc-windows-gnu
122+
--enable-profiler
123+
# We are intentionally allowing an old toolchain on this builder (and that's
124+
# incompatible with LLVM downloads today).
125+
NO_DOWNLOAD_CI_LLVM: 1
126+
CUSTOM_MINGW: 1
127+
<<: *job-windows-8c
128+
129+
- image: dist-x86_64-msvc
130+
env:
131+
RUST_CONFIGURE_ARGS: >-
132+
--build=x86_64-pc-windows-msvc
133+
--host=x86_64-pc-windows-msvc
134+
--target=x86_64-pc-windows-msvc
135+
--enable-full-tools
136+
--enable-profiler
137+
--set rust.codegen-units=1
138+
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
139+
DIST_REQUIRE_ALL_TOOLS: 1
140+
<<: *job-windows-8c
141+
142+
# WORKING: Requires updated Clang
143+
# - image: dist-i686-msvc
144+
# env:
145+
# RUST_CONFIGURE_ARGS: >-
146+
# --build=i686-pc-windows-msvc
147+
# --host=i686-pc-windows-msvc
148+
# --target=i686-pc-windows-msvc,i586-pc-windows-msvc
149+
# --enable-full-tools
150+
# --enable-profiler
151+
# SCRIPT: python x.py dist bootstrap --include-default-paths
152+
# DIST_REQUIRE_ALL_TOOLS: 1
153+
# <<: *job-windows-8c
154+
155+
# BROKEN: Requires https://github.com/llvm/llvm-project/pull/81849
156+
# - image: dist-aarch64-msvc
157+
# env:
158+
# RUST_CONFIGURE_ARGS: >-
159+
# --build=x86_64-pc-windows-msvc
160+
# --host=aarch64-pc-windows-msvc
161+
# --enable-full-tools
162+
# --enable-profiler
163+
# SCRIPT: python x.py dist bootstrap --include-default-paths
164+
# DIST_REQUIRE_ALL_TOOLS: 1
165+
# <<: *job-windows-8c
166+
167+
# WORKING
168+
# - image: dist-i686-mingw
169+
# env:
170+
# RUST_CONFIGURE_ARGS: >-
171+
# --build=i686-pc-windows-gnu
172+
# --enable-full-tools
173+
# --enable-profiler
174+
# # We are intentionally allowing an old toolchain on this builder (and that's
175+
# # incompatible with LLVM downloads today).
176+
# NO_DOWNLOAD_CI_LLVM: 1
177+
# SCRIPT: python x.py dist bootstrap --include-default-paths
178+
# CUSTOM_MINGW: 1
179+
# DIST_REQUIRE_ALL_TOOLS: 1
180+
# <<: *job-windows-8c
181+
182+
# WORKING
183+
# - image: dist-x86_64-mingw
184+
# env:
185+
# SCRIPT: python x.py dist bootstrap --include-default-paths
186+
# RUST_CONFIGURE_ARGS: >-
187+
# --build=x86_64-pc-windows-gnu
188+
# --enable-full-tools
189+
# --enable-profiler
190+
# # We are intentionally allowing an old toolchain on this builder (and that's
191+
# # incompatible with LLVM downloads today).
192+
# NO_DOWNLOAD_CI_LLVM: 1
193+
# CUSTOM_MINGW: 1
194+
# DIST_REQUIRE_ALL_TOOLS: 1
195+
# <<: *job-windows-8c
196+
197+
# WORKING: Requires updated Clang
198+
# - image: dist-x86_64-msvc-alt
199+
# env:
200+
# RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-extended --enable-profiler
201+
# SCRIPT: python x.py dist bootstrap --include-default-paths
202+
# <<: *job-windows-8c
80203

81204
# Jobs that run when you perform a try build (@bors try)
82205
# These jobs automatically inherit envs.production, to avoid repeating

src/ci/run.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,9 @@ if [ "$CI" != "" ]; then
5252
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set change-id=99999999"
5353
fi
5454

55-
if ! isCI || isCiBranch auto || isCiBranch beta || isCiBranch try || isCiBranch try-perf || \
56-
isCiBranch automation/bors/try; then
57-
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.print-step-timings --enable-verbose-tests"
58-
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.metrics"
59-
HAS_METRICS=1
60-
fi
55+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.print-step-timings --enable-verbose-tests"
56+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.metrics"
57+
HAS_METRICS=1
6158

6259
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-verbose-configure"
6360
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-sccache"

src/ci/scripts/install-clang.sh

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,32 +37,29 @@ if isMacOS; then
3737
# Configure `AR` specifically so rustbuild doesn't try to infer it as
3838
# `clang-ar` by accident.
3939
ciCommandSetEnv AR "ar"
40-
elif isWindows && ! isKnownToBeMingwBuild; then
40+
elif isWindows; then
4141
# If we're compiling for MSVC then we, like most other distribution builders,
4242
# switch to clang as the compiler. This'll allow us eventually to enable LTO
4343
# amongst LLVM and rustc. Note that we only do this on MSVC as I don't think
4444
# clang has an output mode compatible with MinGW that we need. If it does we
4545
# should switch to clang for MinGW as well!
46-
#
47-
# The LLVM installer is an NSIS installer, which we can extract with 7z. We
48-
# don't want to run the installer directly; extracting it is more reliable
49-
# in CI environments.
5046

51-
mkdir -p citools/clang-rust
52-
cd citools
53-
retry curl -f "${MIRRORS_BASE}/LLVM-${LLVM_VERSION}-win64.exe" \
54-
-o "LLVM-${LLVM_VERSION}-win64.exe"
55-
7z x -oclang-rust/ "LLVM-${LLVM_VERSION}-win64.exe"
56-
ciCommandSetEnv RUST_CONFIGURE_ARGS \
57-
"${RUST_CONFIGURE_ARGS} --set llvm.clang-cl=$(pwd)/clang-rust/bin/clang-cl.exe"
47+
if isKnownToBeMingwBuild; then
48+
# Remove LLVM so it isn't accidently used.
49+
rm -rf /c/Program\ Files/LLVM
50+
else
51+
mkdir -p citools
52+
cd citools
53+
ln -s /c/Program\ Files/LLVM $(pwd)/clang-rust
54+
ciCommandSetEnv RUST_CONFIGURE_ARGS \
55+
"${RUST_CONFIGURE_ARGS} --set llvm.clang-cl=$(pwd)/clang-rust/bin/clang-cl.exe"
5856

59-
# Disable downloading CI LLVM on this builder;
60-
# setting up clang-cl just above conflicts with the default if-unchanged option.
61-
ciCommandSetEnv NO_DOWNLOAD_CI_LLVM 1
62-
fi
57+
# lldb does not work correctly on Windows because it requires python310.dll
58+
# so remove it (otherwise it will be used by the build since its on the PATH).
59+
rm -rf /c/Program\ Files/LLVM/bin/lldb.exe
6360

64-
if isWindows; then
65-
# GitHub image 20210928.2 added LLVM, but it is broken (and we don't want
66-
# to use it anyways).
67-
rm -rf /c/Program\ Files/LLVM
61+
# Disable downloading CI LLVM on this builder;
62+
# setting up clang-cl just above conflicts with the default if-unchanged option.
63+
ciCommandSetEnv NO_DOWNLOAD_CI_LLVM 1
64+
fi
6865
fi

tests/run-make/compiler-builtins/rmake.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ fn main() {
6363
.env("RUSTC", rustc)
6464
.env("RUSTFLAGS", "-Copt-level=0 -Cdebug-assertions=yes")
6565
.env("CARGO_TARGET_DIR", &target_dir)
66-
.env("RUSTC_BOOTSTRAP", "1");
66+
.env("RUSTC_BOOTSTRAP", "1")
67+
.env("LIB", std::env::var("LIB").unwrap_or_default());
6768
set_host_rpath(&mut cmd);
6869

6970
let status = cmd.status().unwrap();

0 commit comments

Comments
 (0)