diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 872b671b031e7..6cced6f5758ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/src/bootstrap/src/core/config/tests.rs b/src/bootstrap/src/core/config/tests.rs index 59e16b6542728..18c85e7a72818 100644 --- a/src/bootstrap/src/core/config/tests.rs +++ b/src/bootstrap/src/core/config/tests.rs @@ -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); } } diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index 19d6b517552f4..a82b1fb4dcfd4 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -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 @@ -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. diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index ec58bd0924e86..6de25e86c7ec9 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -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 @@ -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 diff --git a/src/ci/run.sh b/src/ci/run.sh index 3ad04c73d3da4..9fbc1a22932a0 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -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" diff --git a/src/ci/scripts/install-clang.sh b/src/ci/scripts/install-clang.sh index aa7ff813f5161..765cc2d13c998 100755 --- a/src/ci/scripts/install-clang.sh +++ b/src/ci/scripts/install-clang.sh @@ -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 diff --git a/tests/run-make/compiler-builtins/rmake.rs b/tests/run-make/compiler-builtins/rmake.rs index 92d6895143c28..eac305e17b03f 100644 --- a/tests/run-make/compiler-builtins/rmake.rs +++ b/tests/run-make/compiler-builtins/rmake.rs @@ -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();