Commit graph

2647 commits

Author SHA1 Message Date
Samuel Tardieu
1d5baad62b
Rollup merge of #144053 - Kobzol:ci-remove-install-rust, r=marcoieni
Remove install Rust script from CI

Windows ARM images should contain Rust now (https://github.com/actions/partner-runner-images/issues/77#issuecomment-3082613685).

CC dpaoliello

try-job: `*aarch64-msvc*`
2025-07-31 13:12:46 +02:00
Samuel Tardieu
202d1f5bf4
Rollup merge of #144675 - jieyouxu:compiletest-staging, r=Kobzol
Reject running `compiletest` self-tests against stage 0 rustc unless explicitly allowed

Currently, in `pr-check-1`, we run `python3 ../x.py test --stage 0 src/tools/compiletest`, which is `compiletest` self-tests against stage 0 rustc. This makes it very annoying for PRs wanting to change target spec JSON format, which `compiletest` depends on for target information, as otherwise `compiletest` would have to know how to handle 2 different target spec JSON formats and know when to pick which.

Instead of doing that, we change `compiletest` self-tests to reject running against stage 0 `rustc` *unless* explicitly allowed with `build.compiletest-allow-stage0=true`. `build.compiletest-allow-stage0` is a proper bootstrap config option in favor of the ad-hoc `COMPILETEST_FORCE_STAGE0` env var. This means that:

- `./x test src/tools/compiletest --stage=0` is not allowed, unless `build.compiletest-allow-stage0=true` is set. In this scenario, `compiletest` self-tests should be expected to fail unless the stage 0 `rustc` as provided is like codegen_cranelift where it's *actually* built from in-tree `rustc` sources.
- In CI, we change `./x test src/tools/compiletest --stage=0` to `./x test src/tools/compiletest --stage=1`, and move it to `pr-check-2`. Yes, this involves building the stage 1 compiler, but `pr-check-2` already has to build stage 1 compiler to test stage 1 library crates.
- Crucially, this means that **`compiletest` is only intended to support one target spec JSON format**, namely the one corresponding to the in-tree `rustc`.
- This should preserve the `compiletest-use-stage0-libtest` UX optimization where changing `compiler/` tree should still not require rebuilding `compiletest` as long as `build.compiletest-use-stage0-libtest=true`, as that should remain orthogonal. This is completely unlike my previous attempt at https://github.com/rust-lang/rust/pull/144563 that tries to do a way more invasive change which would cause the rebuild problem.

Best reviewed commit-by-commit.

---

r? `@Kobzol`
2025-07-30 19:49:03 +02:00
Jieyou Xu
2cdd19384f
Run compiletest self-tests against stage 1 rustc
And move `./x test compiletest --stage=1` to `pr-check-2`, where testing
library artifacts already requires building the stage 1 compiler.
2025-07-30 19:55:17 +08:00
bors
72716b134a Auto merge of #144305 - ChrisDenton:win-free-disk-space, r=marcoieni
Free disk space on Windows 2025 runners

I've managed to reduce the time deletion takes by:

 - Using powershell, which is generally faster for filesystem operations than msys2
 - Performing deletions concurrently then waiting for them all to complete

It still takes 2-10 mins but that's not too bad.
2025-07-30 06:00:09 +00:00
Chris Denton
43018d3722
Free disk space on Windows 2025 runners 2025-07-30 04:10:28 +00:00
Jacob Pratt
79ad87e7ee
Rollup merge of #144586 - alexcrichton:update-weasi-sdk, r=Mark-Simulacrum
Update wasi-sdk to 27.0 in CI

This updates the wasi-sdk used in CI to build release binaries and run CI with. No major motivation beyond keeping things up-to-date and following the development of wasi-sdk.
2025-07-29 18:55:19 -04:00
Alex Crichton
77fc593a6a Update wasi-sdk to 27.0 in CI
This updates the wasi-sdk used in CI to build release binaries and run
CI with. No major motivation beyond keeping things up-to-date and
following the development of wasi-sdk.
2025-07-29 08:23:22 -07:00
Stuart Cook
3a3db990f6
Rollup merge of #144367 - shepmaster:reduce-x86-macos-runner-usage, r=Mark-Simulacrum
Move dist-apple-various from x86_64 to aarch64

`macos-13` is going away soonish.
2025-07-29 16:16:42 +10:00
Matthias Krüger
9b3d4cbb06
Rollup merge of #144454 - folkertdev:uefi-tests, r=jieyouxu
move uefi test to run-make

Turn the `uefi` test into a more standard `run-make` test, and execute it using the `test-various` CI job like before.

This is just a straightforward translation of the python code, but using `run-make` to supply the target (hence the 3 separate calls in the docker file).

r? ```@jieyouxu```
cc ```@nicholasbishop```

try-job: test-various
2025-07-27 10:19:02 +02:00
Folkert de Vries
bd7b023a6b
move uefi test to run-make 2025-07-26 12:19:02 +02:00
Jieyou Xu
430f4f503c
Check ./x check bootstrap in pr-check-1
This check is relatively cheap, and is a quick way to root out breaking
check flow of `bootstrap` itself.
2025-07-25 19:56:33 +08:00
bors
efd420c770 Auto merge of #144244 - jieyouxu:pr-full-ci, r=Kobzol
Enforce that PR CI jobs are a subset of Auto CI jobs modulo carve-outs

### Background

Currently, it is possible for a PR with red PR-only CI to pass Auto CI, then all subsequent PR CI runs will be red until that is fixed, even in completely unrelated PRs. For instance, this happened with PR-CI-only Spellcheck (rust-lang/rust#144183).

See more discussions at [#t-infra > Spellcheck workflow now fails on all PRs (tree bad?)](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Spellcheck.20workflow.20now.20fails.20on.20all.20PRs.20.28tree.20bad.3F.29/with/529769404).

### CI invariant: PR CI jobs are a subset of Auto CI jobs modulo carve-outs

To prevent red PR CI in completely unrelated subsequent PRs and PR CI runs, we need to maintain an invariant that **PR CI jobs are a subset of Auto CI jobs modulo carve-outs**.

This is **not** a "strict" subset relationship: some jobs necessarily have to differ under PR CI and Auto CI environments, at least in the current setup. Still, we can try to enforce a weaker "subset modulo carve-outs" relationship between CI jobs and their corresponding Auto jobs. For instance:

- `x86_64-gnu-tools` will have `auto`-only env vars like `DEPLOY_TOOLSTATES_JSON: toolstates-linux.json`.
- `tidy` will want to `continue_on_error: true` in PR CI to allow for more "useful" compilation errors to also be reported, whereas it should be `continue_on_error: false` in Auto CI to prevent wasting Auto CI resources.

The **carve-outs** are:

1. `env` variables.
2. `continue_on_error`.

We enforce this invariant through `citool`, so only affects job definitions that are handled by `citool`. Notably, this is not sufficient *alone* to address the CI-only Spellcheck issue (rust-lang/rust#144183). To carry out this enforcement, we modify `citool` to auto-register PR jobs as Auto jobs with `continue_on_error` overridden to `false` **unless** there's an overriding Auto job for the PR job of the same name that only differs by the permitted **carve-outs**.

### Addressing the Spellcheck PR-only CI issue

Note that Spellcheck currently does not go through `citool` or `bootstrap`, and is its own GitHub Actions workflow. To actually address the PR-CI-only Spellcheck issue (rust-lang/rust#144183), and carry out the subset-modulo-carve-outs enforcement universally, this PR additionally **removes the current Spellcheck implementation** (a separate GitHub Actions Workflow). That is incompatible with Homu unless we do some hacks in the main CI workflow.

This effectively partially reverts rust-lang/rust#134006 (the separate workflow part, not the tidy extra checks component), but is not prejudice against relanding the `typos`-based spellcheck in another implementation that goes through the usual bootstrap CI workflow so that it does work with Homu. The `typos`-based spellcheck seems to have a good false-positive rate.

Closes rust-lang/rust#144183.

---

r? infra-ci
2025-07-23 23:19:41 +00:00
Jake Goulding
0b88bea0d5 Move dist-apple-various from x86_64 to aarch64
`macos-13` is going away soonish.
2025-07-23 11:35:50 -04:00
bors
a7a1618e6c Auto merge of #144249 - GuillaumeGomez:asm-tests, r=jieyouxu
Rename `tests/{assembly,codegen}` into `tests/{assembly,codegen}-llvm` and ignore these testsuites if configured backend doesn't match

Follow-up of https://github.com/rust-lang/rust/pull/144125.

This PR changes `compiletest` so that `asm` tests are only run if they match the current codegen backend. To better reflect it, I renamed the `tests/ui/asm` folder into `tests/ui/asm-llvm`. Like that, we can add new asm tests for other backends if we want without needing to add extra code to `compiletest`.

Next step will be to use the new code annotations added in rust-lang/rust#144125 to ignore ui tests failing in cg_gcc until it's fixed on our side.

cc `@antoyo` `@oli-obk`
r? `@Kobzol`
2025-07-22 18:39:58 +00:00
Guillaume Gomez
a27f3e3fd1 Rename tests/codegen into tests/codegen-llvm 2025-07-22 14:28:48 +02:00
Guillaume Gomez
ed93c1783b Rename tests/assembly into tests/assembly-llvm 2025-07-22 14:27:48 +02:00
Matthias Krüger
73305e2240
Rollup merge of #142924 - lolbinarycat:tidy-js-extra-checks, r=Kobzol
tidy: move rustdoc js stuff into a tidy extra check

Most of these were factored out of CI scripts, but `eslint` in particular was previously implemented with its own special cased logic.

A new option has been added to bootstrap, `build.tidy-extra-checks`, which serves as a default value for the `--extra-checks` flag.  This is mostly for the benefit of rustdoc js maintainers, but should also help bootstrap py maintainers.

Additionally, `--extra-checks=cpp` has been documented.

I'm not super happy with how long the extra check names are in comparison to the others (in particular `typecheck`), but I couldn't think of anything better (I didn't want to name it `tsc` on the off chance we want to switch to a different typechecking engine in the future).

It would be nice to convert the extra checks arg into a proper enum, both for warning on unknown values and to provide better shell completion.

r? ```@GuillaumeGomez```

Fixes: https://github.com/rust-lang/rust/issues/144093
2025-07-22 10:26:13 +02:00
Jieyou Xu
523594d7ae
Update jobs.yml docs to reflect subset-modulo-carve-outs relationship 2025-07-21 18:06:07 +08:00
Jieyou Xu
21768bb380
Enforce PR CI jobs are a subset of Auto CI jobs (modulo carve-outs)
To prevent possibility of a PR with red PR-only CI passing Auto CI, then
all subsequent PR CI runs will be red until that is fixed.

Note that this is **not** a "strict" subset relationship: some jobs
necessarily have to differ under PR CI and Auto CI environments. For
instance:

- `x86_64-gnu-tools` will have auto-only env vars like
  `DEPLOY_TOOLSTATES_JSON: toolstates-linux.json`.
- `tidy` will want to `continue_on_error: true` in PR CI to allow for
  more "useful" compilation errors to also be reported, whereas it needs
  to `continue_on_error: false` in Auto CI to prevent wasting Auto CI
  resources.

The carve-outs are:

1. `env` variables.
2. `continue_on_error`.
2025-07-21 18:06:06 +08:00
Matthias Krüger
faefaa0aef
Rollup merge of #144196 - ChrisDenton:init-mingw, r=mati865
Initialize mingw for the runner's user

This is apparently the more proper fix to https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Spurious.20bors.20CI.20failures/near/528915775

But let's see if it works.
2025-07-20 08:56:11 +02:00
Chris Denton
db1449aed5
Initialize mingw for the runner's user 2025-07-19 22:05:47 +00:00
binarycat
c8e2a65ed1 tidy: use a lockfile for js tools instead of npx
this makes us less vulnerable to MITM and supply chain attacks.

it also means that the CI scripts are no longer responsible for
tracking the versions of these tools.

it should also avoid the situation where local tsc and CI
disagree on the presense of errors due to them being different versions.
2025-07-19 14:44:15 -05:00
binarycat
4bd3b74aa9 update CI to use new tidy extra checks for rustdoc js 2025-07-19 14:44:15 -05:00
Chris Denton
58a05caa45
Rename optional-mingw-check to optional-pr-check 2025-07-18 18:33:23 +00:00
MarcoIeni
a886852e23
ci: use windows 22 for all free runners 2025-07-17 14:54:14 +02:00
Jakub Beránek
b7d27822e3
Remove install Rust script from CI
Windows ARM images should contain Rust now.
2025-07-17 09:15:17 +02:00
León Orell Valerian Liehr
6dfec1a88f
Rollup merge of #143964 - nikic:docker-script-arg, r=marcoieni
Fix handling of SCRIPT_ARG in docker images

Instead of making this a build parameter, pass the SCRIPT as an environment variable.

To this purpose, normalize on always referring to a script in `/scripts`.

For i686-gnu-nopt-2 I had to create a separate script, because Docker seems to be really terrible at command line argument parsing, so it's not possible to pass an environment variable that contains whitespace.

Fixes https://github.com/rust-lang/rust/issues/143962.

try-job: `dist-x86_64-linux`
try-job: `i686-gnu-nopt-*`
try-job: `i686-gnu-*`
try-job: `x86_64-gnu-llvm-19-*`
try-job: `x86_64-gnu-llvm-20-*`
2025-07-17 03:58:35 +02:00
León Orell Valerian Liehr
a07ae6287a
Rollup merge of #143851 - lolbinarycat:bootstrap-node_modules, r=Kobzol
ci cleanup: rustdoc-gui-test now installs browser-ui-test

this removes the need for --unsafe-perm in the Dockerfile.

cc ```@GuillaumeGomez``` ```@Kobzol```
2025-07-17 03:58:32 +02:00
binarycat
bbb114ef61 ci cleanup: rustdoc-gui-test now installs browser-ui-test
this removes the need for --unsafe-perm in the Dockerfile.
2025-07-15 14:39:53 -05:00
Nikita Popov
4b421d44e2 Fix handling of SCRIPT_ARG in docker images
Instead of making this a build parameter, pass the SCRIPT as an
environment variable.

To this purpose, normalize on always referring to a script in
`/scripts`.

For i686-gnu-nopt-2 I had to create a separate script, because
Docker seems to be really terrible at command line argument
parsing, so it's not possible to pass an environment variable that
contains whitespace.
2025-07-15 16:23:15 +02:00
Matthias Krüger
ee1595cc68
Rollup merge of #143786 - nikic:ci-job-name-fallback, r=marcoieni
Fix fallback for CI_JOB_NAME

If CI_JOB_NAME is not specified, it's supposed to fall back to the image name, which is `$image`, not `$IMAGE`.

Failing to set the correct CI_JOB_NAME causes failures when running `dist-ohos-*` images locally.
2025-07-13 15:16:01 +02:00
Nikita Popov
34426dce3d Fix fallback for CI_JOB_NAME
If CI_JOB_NAME is not specified, it's supposed to fall back to
the image name, which is `$image`, not `$IMAGE`.

Failing to set the correct CI_JOB_NAME causes failures when running
`dist-ohos-*` images locally.
2025-07-11 15:05:14 +02:00
Trevor Gross
6debe03634
Rollup merge of #140136 - dpaoliello:arm64winci, r=Kobzol
Add an aarch64-msvc build running on ARM64 Windows

Resurrecting rust-lang/rust#126341

Per <https://github.com/rust-lang/rfcs/pull/3817> we intend to promote `aarch64-pc-windows-msvc` to Tier 1. As part of that work, we are adding a pre-merge CI job to validate that changes do not break this target.

Additionally, for consistency, the `dist-aarch64-msvc` job will also be run on Arm64 Windows runners.

r? ``@Kobzol``

try-job: `*aarch64-msvc*`
2025-07-10 20:20:37 -04:00
许杰友 Jieyou Xu (Joe)
9c6ef43341
Rollup merge of #143415 - Gelbpunkt:cleanup-dist-ppc64le-toolchain, r=marcoieni
Get rid of build-powerpc64le-toolchain.sh

The dist-powerpc64le-linux-musl runner never actually used the toolchain that the script produced, it instead used the one from crosstool-ng.

The dist-powerpc64le-linux-gnu runner did use it, from what I can tell mainly to get a glibc 2.17 version with ppc64le support backported. Since crosstool-ng has the necessary patches, we can just use crosstool-ng to get an appropriate toolchain. While at it, use kernel 3.10 headers since that's the version documented in platform support for this target.

try-job: dist-powerpc64le-linux-gnu
try-job: dist-powerpc64le-linux-musl
2025-07-07 19:45:39 +08:00
Jakub Beránek
baa55aef3a
Fix CI 2025-07-06 17:25:19 +02:00
Jens Reidel
12bc4096dc
Get rid of build-powerpc64le-toolchain.sh
The dist-powerpc64le-linux-musl runner never actually used the toolchain
that the script produced, it instead used the one from crosstool-ng.

The dist-powerpc64le-linux-gnu runner did use it, from what I can tell
mainly to get a glibc 2.17 version with ppc64le support backported.
Since crosstool-ng has the necessary patches, we can just use
crosstool-ng to get an appropriate toolchain. While at it, use kernel
3.10 headers since that's the version documented in platform support for
this target.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-04 10:46:12 +02:00
Guillaume Gomez
9092fbbee1
Rollup merge of #143384 - GuillaumeGomez:update-browser-ui-test, r=kobzol
Update browser-ui-test version to `0.21.1`

One day I'll find time and motivation to use `package.json` instead. 😆

r? `@Kobzol`
2025-07-03 19:45:33 +02:00
Guillaume Gomez
c2465259bf Update browser-ui-test version to 0.21.1 2025-07-03 18:08:23 +02:00
bors
d6120810e5 Auto merge of #143294 - ChrisDenton:rename-mingw, r=Kobzol
Rename `mingw-*` CI jobs to `pr-*`

The name `mingw` confuses people because these CI jobs now do much more than just cross-compile to mingw.

This is basically a find/replace. I chose the name `pr-` because it's job is to do general PR checks,
2025-07-03 07:23:17 +00:00
Matthias Krüger
c572231fb9
Rollup merge of #143274 - marcoieni:optional-jobs, r=Kobzol
ci: support optional jobs

try-job: optional-mingw-check-1
2025-07-02 19:28:09 +02:00
Matthias Krüger
453a2a9102
Rollup merge of #142886 - Enselic:aarch64-panic, r=cuviper
ci: aarch64-gnu: Stop skipping `panic_abort_doc_tests`

The skipped test passes since `nightly-2024-11-29`. See https://github.com/rust-lang/rust/issues/123733#issuecomment-2928770365 and https://github.com/rust-lang/rust/issues/123733#issuecomment-2929091266 for more info.

Let's stop skipping it to increase the chance of detecting a regression.

r? ``````@cuviper`````` who added the skip in https://github.com/rust-lang/rust/pull/123828

Also see https://github.com/rust-lang/rust/pull/142304 for an alternative regression test that I am hoping to also land in the near future to complement the test we now stop skipping, but I need to investigate that setup more.
2025-07-02 19:28:06 +02:00
Chris Denton
6671d9b92a
Rename mingw-check-tidy to tidy 2025-07-02 08:48:20 +00:00
Chris Denton
62949cd2d6
Rename mingw-* CI jobs to pr-* 2025-07-01 20:25:56 +00:00
MarcoIeni
311a99cac4
ci: support optional jobs 2025-07-01 11:25:10 +02:00
Jakub Beránek
c2daa28020
Do not enable LLD by default in the dist profile 2025-07-01 08:19:34 +02:00
Matthias Krüger
5e725a6367
Rollup merge of #142963 - Kobzol:try-build-skip, r=jieyouxu
Skip unnecessary components in x64 try builds

We unnecessarily rebuild `wasm-component-ld`, `llvm-bitcode-linker` and Cranelift during the intermediate PGO builds several times times, which is unnecessarily and increases the duration of try builds. This PR also disables some unnecessary dist components.

r? `````@jieyouxu`````
2025-06-28 22:05:29 +02:00
Michael Goulet
4dca555efa
Rollup merge of #143010 - GuillaumeGomez:update-browser-ui-test, r=Kobzol
Update `browser-ui-test` version to `0.20.7`

This new version fixes some bugs and improve error messages.

r? `````@Kobzol`````
2025-06-26 20:15:25 -04:00
bors
8f21a5c92e Auto merge of #142581 - Kobzol:bootstrap-std-method, r=jieyouxu
Enforce in bootstrap that build must have stage at least 1

This PR is a step towards https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Proposal.20to.20cleanup.20stages.20and.20steps.20after.20the.20redesign/with/523586917. It's very hard or me to make self-contained changes to bootstrap at this moment, so this PR kind of does several things:

1) (first two commits) Try to reduce the usage of `Std::new` in bootstrap, and replace it with a `Builder::std` method (similar to `Builder::compiler`). This is mostly to remove executions of the `Std` step for stage 0, which doesn't make a lot of sense; I'd like to ideally have the invariant that when a step is invoked, it actually builds or does something. Eventually, I'd like for everything to go through `Builder::std`. (Note: I'm not totally married to this idea, if you don't like it, we can remove it from this PR. I mostly did it right now to remove stage 0 std steps from snapshot tests, which shouldn't be there, but we can also filter them out in a different way)
2) Make sure that when you pass `x build compiler`, only the `Assemble` root level step will be invoked, and not the `Rustc` step. Before, both were invoked, which actually ran `Rustc` twice, once with all `crates` filled, and once with no crates (but both actually represent the same situation). Since the `Rustc::make_run` step actually requests a compile that is one stage below it, this actually made `build compiler --stage 0` work, which we don't want to have anymore.
3) Enforce a bootstrap-global invariant that all `build` commands are always on stage `>=1`. If you try to `build` anything on stage 0, it will print a warning and exit bootstrap. This follows the intuition from the new staging rules after the stage redesign; artifacts that are "stage 0" come outside of bootstrap, and we can't really build something for which we don't have source (although we can still test it, but that's for another PR).

Now the logic for build should be quite simple. For pretty much everything except for `Std`, you first use the stage0 compiler to build stage 1. Then you can build a stage 2 <something> using the previously built stage 1 (and then you can continue to stage 3 etc.). And that's it. The default build stage for everything is 1 (modulo download-ci-rustc, but that's a separate can of worms).

The snapshot test infra isn't super nice at the moment, as one of next steps I want to create some simple Builder pattern that will allow us to configure the bootstrap invocations in a more "forward-compatible" way (e.g. now it's not possible to modify the config passed to `configure_with_args`).

There are some things not yet fully resolved for build stage 0:
1) Cargo is still a `ModeRustc` tool, even though it doesn't really have to be, it is buildable with the stage0 compiler
2) bootstrap tools (`opt-dist`, `build-manifest` etc.) are still called stage0 tools, and in the bootstrap output it says something like "stage 0 rustc builds stage 0 opt-dist". Which is a bit weird, but functionally there's no difference, it's just a slightly inconsistent output. We still haven't decided if we should make these tools ignore staging altogether (which is IMO the right choice) or if we want to allow building stage 1/2/3/... bootstrap tools.

r? `@jieyouxu`

try-job: x86_64-rust-for-linux
2025-06-26 09:20:07 +00:00
Jakub Beránek
803415478c
Do not build GCC in fast try builds 2025-06-25 16:05:28 +02:00
Guillaume Gomez
4f80053779 Update browser-ui-test version to 0.20.7 2025-06-25 15:29:40 +02:00