Skip to content

Commit b2bec01

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

File tree

7 files changed

+164
-79
lines changed

7 files changed

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

81208
# Jobs that run when you perform a try build (@bors try)
82209
# 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)