Skip to content

DRAFT: Test building on Server 2022 #124174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,20 +164,6 @@ jobs:
- name: create github artifacts
run: src/ci/scripts/create-doc-artifacts.sh
if: success() && !env.SKIP_JOB
- name: upload artifacts to github
uses: actions/upload-artifact@v4
with:
name: "${{ env.DOC_ARTIFACT_NAME }}"
path: obj/artifacts/doc
if-no-files-found: ignore
retention-days: 5
if: success() && !env.SKIP_JOB
- name: upload artifacts to S3
run: src/ci/scripts/upload-artifacts.sh
env:
AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
master:
name: master
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/config/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ fn detect_src_and_out() {
test(parse(""), None);

{
let build_dir = if cfg!(windows) { Some("C:\\tmp") } else { Some("/tmp") };
let build_dir = if cfg!(windows) { Some("D:\\tmp") } else { Some("/tmp") };
test(parse("build.build-dir = \"/tmp\""), build_dir);
}
}
Expand Down
27 changes: 2 additions & 25 deletions src/ci/github-actions/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ x--expand-yaml-anchors--remove:
<<: *base-job

- &job-windows-8c
os: windows-2019-8core-32gb
os: windows-2022
<<: *base-job

- &job-windows-16c
os: windows-2019-16core-64gb
os: windows-2022
<<: *base-job

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

- name: upload artifacts to github
uses: actions/upload-artifact@v4
with:
# name is set in previous step
name: ${{ env.DOC_ARTIFACT_NAME }}
path: obj/artifacts/doc
if-no-files-found: ignore
retention-days: 5
<<: *step

- name: upload artifacts to S3
run: src/ci/scripts/upload-artifacts.sh
env:
AWS_ACCESS_KEY_ID: ${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}
# Adding a condition on DEPLOY=1 or DEPLOY_ALT=1 is not needed as all deploy
# builders *should* have the AWS credentials available. Still, explicitly
# adding the condition is helpful as this way CI will not silently skip
# deploying artifacts from a dist builder if the variables are misconfigured,
# erroring about invalid credentials instead.
if: success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')
<<: *step

# These snippets are used by the try-success, try-failure, auto-success and auto-failure jobs.
# Check out their documentation for more information on why they're needed.

Expand Down
151 changes: 139 additions & 12 deletions src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ runners:
<<: *base-job

- &job-windows-8c
os: windows-2019-8core-32gb
os: windows-2022
<<: *base-job

- &job-windows-16c
os: windows-2019-16core-64gb
os: windows-2022
<<: *base-job

- &job-aarch64-linux
Expand Down Expand Up @@ -66,17 +66,144 @@ envs:
# These jobs automatically inherit envs.pr, to avoid repeating
# it in each job definition.
pr:
- image: mingw-check
<<: *job-linux-4c
- image: mingw-check-tidy
continue_on_error: true
<<: *job-linux-4c
- image: x86_64-gnu-llvm-17
# WORKING: Requires updated Clang
# - image: x86_64-msvc
# env:
# RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
# SCRIPT: make ci-msvc
# <<: *job-windows-8c

# WORKING: Requires updated Clang
# - image: i686-msvc
# env:
# RUST_CONFIGURE_ARGS: --build=i686-pc-windows-msvc
# SCRIPT: make ci-msvc
# <<: *job-windows-8c

# WORKING: Requires updated Clang
#- image: x86_64-msvc-ext
# env:
# 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
# HOST_TARGET: x86_64-pc-windows-msvc
# RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-lld --save-toolstates=/tmp/toolstate/toolstates.json
# DEPLOY_TOOLSTATES_JSON: toolstates-windows.json
# <<: *job-windows-8c

# 32/64-bit MinGW builds.
#
# We are using MinGW with POSIX threads since LLVM requires
# C++'s std::thread which is disabled in libstdc++ with win32 threads.
# FIXME: Libc++ doesn't have this limitation so we can avoid
# winpthreads if we switch to it.
#
# Instead of relying on the MinGW version installed on CI we download
# and install one ourselves so we won't be surprised by changes to CI's
# build image.
#
# Finally, note that the downloads below are all in the `rust-lang-ci` S3
# bucket, but they clearly didn't originate there! The downloads originally
# came from the mingw-w64 SourceForge download site. Unfortunately
# SourceForge is notoriously flaky, so we mirror it on our own infrastructure.

# WORKING
# - image: i686-mingw
# env:
# RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu
# SCRIPT: make ci-mingw
# # We are intentionally allowing an old toolchain on this builder (and that's
# # incompatible with LLVM downloads today).
# NO_DOWNLOAD_CI_LLVM: 1
# CUSTOM_MINGW: 1
# <<: *job-windows-8c

# WORKING
# - image: x86_64-mingw
# env:
# SCRIPT: make ci-mingw
# RUST_CONFIGURE_ARGS: >-
# --build=x86_64-pc-windows-gnu
# --enable-profiler
# # We are intentionally allowing an old toolchain on this builder (and that's
# # incompatible with LLVM downloads today).
# NO_DOWNLOAD_CI_LLVM: 1
# CUSTOM_MINGW: 1
# <<: *job-windows-8c

- image: dist-x86_64-msvc
timeout-minutes: 1200
env:
ENABLE_GCC_CODEGEN: "1"
<<: *job-linux-16c
- image: x86_64-gnu-tools
<<: *job-linux-16c
RUST_CONFIGURE_ARGS: >-
--build=x86_64-pc-windows-msvc
--host=x86_64-pc-windows-msvc
--target=x86_64-pc-windows-msvc
--enable-full-tools
--enable-profiler
--set rust.codegen-units=1
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
DIST_REQUIRE_ALL_TOOLS: 1
<<: *job-windows-8c

# WORKING: Requires updated Clang
# - image: dist-i686-msvc
# env:
# RUST_CONFIGURE_ARGS: >-
# --build=i686-pc-windows-msvc
# --host=i686-pc-windows-msvc
# --target=i686-pc-windows-msvc,i586-pc-windows-msvc
# --enable-full-tools
# --enable-profiler
# SCRIPT: python x.py dist bootstrap --include-default-paths
# DIST_REQUIRE_ALL_TOOLS: 1
# <<: *job-windows-8c

# BROKEN: Requires https://github.com/llvm/llvm-project/pull/81849
# - image: dist-aarch64-msvc
# env:
# RUST_CONFIGURE_ARGS: >-
# --build=x86_64-pc-windows-msvc
# --host=aarch64-pc-windows-msvc
# --enable-full-tools
# --enable-profiler
# SCRIPT: python x.py dist bootstrap --include-default-paths
# DIST_REQUIRE_ALL_TOOLS: 1
# <<: *job-windows-8c

# WORKING
# - image: dist-i686-mingw
# env:
# RUST_CONFIGURE_ARGS: >-
# --build=i686-pc-windows-gnu
# --enable-full-tools
# --enable-profiler
# # We are intentionally allowing an old toolchain on this builder (and that's
# # incompatible with LLVM downloads today).
# NO_DOWNLOAD_CI_LLVM: 1
# SCRIPT: python x.py dist bootstrap --include-default-paths
# CUSTOM_MINGW: 1
# DIST_REQUIRE_ALL_TOOLS: 1
# <<: *job-windows-8c

# WORKING
# - image: dist-x86_64-mingw
# env:
# SCRIPT: python x.py dist bootstrap --include-default-paths
# RUST_CONFIGURE_ARGS: >-
# --build=x86_64-pc-windows-gnu
# --enable-full-tools
# --enable-profiler
# # We are intentionally allowing an old toolchain on this builder (and that's
# # incompatible with LLVM downloads today).
# NO_DOWNLOAD_CI_LLVM: 1
# CUSTOM_MINGW: 1
# DIST_REQUIRE_ALL_TOOLS: 1
# <<: *job-windows-8c

# WORKING: Requires updated Clang
# - image: dist-x86_64-msvc-alt
# env:
# RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-extended --enable-profiler
# SCRIPT: python x.py dist bootstrap --include-default-paths
# <<: *job-windows-8c

# Jobs that run when you perform a try build (@bors try)
# These jobs automatically inherit envs.production, to avoid repeating
Expand Down
9 changes: 3 additions & 6 deletions src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,9 @@ if [ "$CI" != "" ]; then
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set change-id=99999999"
fi

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

RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-verbose-configure"
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-sccache"
Expand Down
37 changes: 17 additions & 20 deletions src/ci/scripts/install-clang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,32 +37,29 @@ if isMacOS; then
# Configure `AR` specifically so rustbuild doesn't try to infer it as
# `clang-ar` by accident.
ciCommandSetEnv AR "ar"
elif isWindows && ! isKnownToBeMingwBuild; then
elif isWindows; then
# If we're compiling for MSVC then we, like most other distribution builders,
# switch to clang as the compiler. This'll allow us eventually to enable LTO
# amongst LLVM and rustc. Note that we only do this on MSVC as I don't think
# clang has an output mode compatible with MinGW that we need. If it does we
# should switch to clang for MinGW as well!
#
# 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/clang-rust
cd citools
retry 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"
if isKnownToBeMingwBuild; then
# Remove LLVM so it isn't accidently used.
rm -rf /c/Program\ Files/LLVM
else
mkdir -p citools
cd citools
ln -s /c/Program\ Files/LLVM $(pwd)/clang-rust
ciCommandSetEnv RUST_CONFIGURE_ARGS \
"${RUST_CONFIGURE_ARGS} --set llvm.clang-cl=$(pwd)/clang-rust/bin/clang-cl.exe"

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

if isWindows; then
# GitHub image 20210928.2 added LLVM, but it is broken (and we don't want
# to use it anyways).
rm -rf /c/Program\ Files/LLVM
# Disable downloading CI LLVM on this builder;
# setting up clang-cl just above conflicts with the default if-unchanged option.
ciCommandSetEnv NO_DOWNLOAD_CI_LLVM 1
fi
fi
3 changes: 2 additions & 1 deletion tests/run-make/compiler-builtins/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ fn main() {
.env("RUSTC", rustc)
.env("RUSTFLAGS", "-Copt-level=0 -Cdebug-assertions=yes")
.env("CARGO_TARGET_DIR", &target_dir)
.env("RUSTC_BOOTSTRAP", "1");
.env("RUSTC_BOOTSTRAP", "1")
.env("LIB", std::env::var("LIB").unwrap_or_default());
set_host_rpath(&mut cmd);

let status = cmd.status().unwrap();
Expand Down
Loading