about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2025-09-09bootstrap: vendor `clippy_test_deps` tooJosh Stone-0/+1
This internal crate explicitly separates itself from the `rustc` workspace, but it is needed for `./x test clippy` to work, including its dependencies when building from a vendored `rustc-src` tarball. (cherry picked from commit c73d7ae1c60b7cc1779839f4e260d6e81929f1a9)
2025-09-09Add warning to the `Builder::llvm_config` functionJakub Beránek-0/+4
(cherry picked from commit 6315b4973a8e5090ce041ca9a4eaf81ed7b70e29)
2025-09-09Ship LLVM tools for the correct target when cross-compilingJakub Beránek-5/+43
(cherry picked from commit c064521cc7fd4d2548bcf30aca2424556c9cf82c)
2025-09-09Rename `llvm_config` to `host_llvm_config` to avoid confusionJakub Beránek-36/+39
(cherry picked from commit 7785efd1b000cd3824d465c485ee1929aa0059bd)
2025-08-01Auto merge of #144773 - RalfJung:rollup-uif2yyj, r=RalfJungbors-79/+143
Rollup of 6 pull requests Successful merges: - rust-lang/rust#144397 (`tests/ui/issues/`: The Issues Strike Back [2/N]) - rust-lang/rust#144410 (Make tier 3 musl targets link dynamically by default) - rust-lang/rust#144708 (Add tracing to step.rs and friends) - rust-lang/rust#144730 (Create a typed wrapper for codegen backends in bootstrap) - rust-lang/rust#144771 (Remove some noisy triagebot pings for myself) - rust-lang/rust#144772 (add unsupported_calling_conventions to lint list) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-01Rollup merge of #144683 - tgross35:builtins-via-std-workspace, ↵Jacob Pratt-11/+11
r=bjorn3,Noratrieb Simplify library dependencies on `compiler-builtins` The three panic-related library crates need to have access to `core`, and `compiler-builtins` needs to be in the crate graph. Rather than specifying both dependencies, switch these crates to use `rustc-std-workspace-core` which already does this. This means there is now a single place that the `compiler-builtins` dependency needs to get configured, for everything other than `alloc` and `std`. The second commit removes `compiler-builtins` from `std` (more details in the message).
2025-07-31Use `core` via `rustc-std-workspace-core` in `library/panic*`Trevor Gross-11/+11
The three panic-related library crates need to have access to `core`, and `compiler-builtins` needs to be in the crate graph. Rather than specifying both dependencies, switch these crates to use `rustc-std-workspace-core` which already does this. This means there is now a single place that the `compiler-builtins` dependency needs to get configured, for everything other than `alloc` and `std`.
2025-07-31Create a typed wrapper for codegen backendsJakub Beránek-79/+143
To avoid representing them just with strings.
2025-07-30Add change tracker entryJieyou Xu-0/+5
2025-07-30Deny `compiletest` self-tests being run against stage 0 rustc unless ↵Jieyou Xu-1/+18
explicitly allowed Otherwise, `compiletest` would have to know e.g. how to parse two different target spec, if target spec format was changed between beta `rustc` and in-tree `rustc`.
2025-07-30Introduce proper `build.compiletest-allow-stage0` config optionJieyou Xu-6/+19
In favor of the adhoc `COMPILETEST_FORCE_STAGE0` env var.
2025-07-29Rollup merge of #144623 - RalfJung:miri, r=RalfJungStuart Cook-0/+5
miri subtree update Subtree update of `miri` to https://github.com/rust-lang/miri/commit/fc4d9a2720d38f815d3e20627b805b4a379e5c8b. Created using https://github.com/rust-lang/josh-sync. r? `@ghost`
2025-07-29Rollup merge of #144599 - ↵Stuart Cook-0/+2
lolbinarycat:bootstrap-build.tidy-extra-checks-enable-for-tools, r=Kobzol bootstrap: enable tidy auto extra checks on tools profile alternative to https://github.com/rust-lang/rust/pull/144461 this won't affect CI or any `./configure` based workflows, and will also not affect every rust contributor like that PR will. a slower rollout of this feature should reduce disruption if issues are discovered with it. r? ``@Kobzol``
2025-07-29Rollup merge of #144482 - ↵Stuart Cook-479/+657
Shourya742:2025-07-24-have-explicit-download-methods, r=Kobzol Add explicit download methods to download module in bootstrap This PR attempts to decouple the default initialization of the config object from parse_inner. It moves specific download methods, previously used during the initial config setup, into standalone functions outside the config implementation. r? ``@Kobzol``
2025-07-29update lockfile and bless tidyRalf Jung-0/+5
2025-07-28bootstrap: enable tidy auto extra checks on tools profilebinarycat-0/+2
2025-07-28make sure to populate DownloadState dependencies before its initialization ↵bit-aloo-5/+5
in config parsing
2025-07-28remove config wrappers of download_toolchain and maybe_download_fmt and ↵bit-aloo-17/+13
during config parsing directly invoke cdownload methods
2025-07-28use dry_run and verbose directly from exec_ctxbit-aloo-30/+27
2025-07-28add support for ./x check src/tools/linkcheckerPietro Albini-0/+7
2025-07-27move download_rustfmt out of impl as its used during config initializationbit-aloo-0/+66
2025-07-27move download_beta_toolchain out of impl as its used during config ↵bit-aloo-0/+25
initialization
2025-07-27move utility methods out of config implbit-aloo-461/+518
2025-07-27add download contextbit-aloo-0/+37
2025-07-26Rollup merge of #144470 - tgross35:clif-remove-no-f16-f128, r=bjorn3Jacob Pratt-5/+0
clif: Don't set the `compiler-builtins-no-f16-f128` feature Since rust-lang/rust be35d37d8b6c ("Use the compiler to determine whether or not to enable f16 and f128"), `compiler-builtins` relies on `rustc` to report whether or not `f16` and `f128` are supported, which is reported by the backend. This means that there should no longer be any need to unconditionally disable the types for clif in Bootstrap. Backend config: https://github.com/rust-lang/rust/blob/a955f1cd09a027363729ceed919952d09f76f28e/compiler/rustc_codegen_cranelift/src/lib.rs#L224-L233
2025-07-26Rollup merge of #144464 - Kobzol:x-test-default, r=jieyouxuJacob Pratt-1/+5
Only run bootstrap tests in `x test` on CI Discussed at https://rust-lang.zulipchat.com/#narrow/channel/122652-new-members/topic/Linux.20Distribution/with/530839642. The bootstrap tests can be sensitive of the environment where they are executed. And now that they are executed very early in the test pipeline, it can be annoying for people who just try to do `x test` when it fails on bootstrap tests. We could move the bootstrap tests back to the end of the `x test` pipeline, but then it would just fail later. I'd prefer to only run them on CI by default. Fixes: https://github.com/rust-lang/rust/issues/143973
2025-07-26Rollup merge of #144445 - jieyouxu:revert-shared_helpers_tests, r=KobzolJacob Pratt-11/+22
Fix `./x check bootstrap` (again) Redoes rust-lang/rust#134883 and reverts 40c2ca96411caaeab1563ff9041879f742d1d71b from rust-lang/rust#142416. Unfortunately I missed this during review. - Commit 1: Reverts 40c2ca96411caaeab1563ff9041879f742d1d71b and re-applies rust-lang/rust#134883. - Commit 2: Check `./x check bootstrap` in `pr-check-1` to catch "obvious" problems like this. r? Kobzol
2025-07-26Rollup merge of #144463 - ognevny:change-tracker-typo, r=KobzolMatthias Krüger-1/+1
change_tracker: fix a typo there is no `llvm.lld` option r? `@Kobzol`
2025-07-26Rollup merge of #144316 - Gelbpunkt:musl-libdir-bootstrap, r=KobzolTrevor Gross-14/+18
bootstrap: Move musl-root fallback out of sanity check Previously, the musl root would only be set to the fallback `/usr` by the sanity check, which isn't ran for the bootstrap tests. r? ``````@Kobzol``````
2025-07-25clif: Don't set the `compiler-builtins-no-f16-f128` featureTrevor Gross-5/+0
Since rust-lang/rust be35d37d8b6c ("Use the compiler to determine whether or not to enable f16 and f128"), `compiler-builtins` relies on `rustc` to report whether or not `f16` and `f128` are supported, which is reported by the backend. This means that there should no longer be any need to unconditionally disable the types for clif in Bootstrap. Backend config: https://github.com/rust-lang/rust/blob/a955f1cd09a027363729ceed919952d09f76f28e/compiler/rustc_codegen_cranelift/src/lib.rs#L224-L233
2025-07-25Only run bootstrap tests in `x test` on CIJakub Beránek-1/+5
2025-07-25change_tracker: fix a typoMaksim Bondarenkov-1/+1
there is no `llvm.lld` option
2025-07-25Allow approx-constant in `x clippy library`Philipp Krones-0/+1
2025-07-25Revert "Move `shared_helpers` test to a dedicated module"Jieyou Xu-11/+22
I missed this during review. We cannot declare a `tests` module within `shared_helpers.rs` itself, as shim binaries that tries to include the `shared_helpers` module through `#[path = ".."]` attributes would fail to find it, breaking `./x check bootstrap`. This reverts commit `40c2ca96411caaeab1563ff9041879f742d1d71b`.
2025-07-24Rollup merge of #144317 - lolbinarycat:tidy-obey-build.npm, r=KobzolLeón Orell Valerian Liehr-0/+6
pass build.npm from bootstrap to tidy and use it for npm install followup to rust-lang/rust#142924 r? ```@Kobzol```
2025-07-23Clippy fixupJens Reidel-1/+1
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-23Rollup merge of #144315 - lolbinarycat:bootstrap-dist-package.json, r=KobzolMatthias Krüger-0/+2
bootstrap: add package.json and package-lock.json to dist tarball this ensures that js-related tests can still be run from within such a dist tarball. followup to rust-lang/rust#142924 r? ```````@Kobzol```````
2025-07-23Rollup merge of #144311 - Gelbpunkt:ci-rustc-ppc64le-musl, r=KobzolMatthias Krüger-0/+1
Add powerpc64le-unknown-linux-musl to CI rustc targets I missed this in the promotion to tier 2 with host tools.
2025-07-23Auto merge of #143412 - Kobzol:std-detect-in-stdlib, r=Amanieubors-11/+11
Move `std_detect` into stdlib This PR moves the `std_detect` crate from `stdarch` to be a part of rust-lang/rust instead. The first commit actually moves the whole directory from the stdarch Josh subtree, so that git blame history is kept intact. Then I had to make a few changes to appease `tidy`. The most complex thing here is porting the tests. We can't have `std_detect` both in r-l/r and stdarch, because they could get desynchronized, so we have to perform the move more or less "atomically", which means that we also have to port all the existing `std_detect` tests from the `stdarch` repository. The stdarch repo runs the following `std_detect` tests: ### Build The `build-std-detect.sh` script (https://github.com/rust-lang/stdarch/blob/e2b6512aed87df45294ae680181eeef7a802cd95/ci/build-std-detect.sh) builds `std_detect` using the nightly compiler for several targets. This will be subsumed by normal `x build library` on our Tier 1/2 targets. However, the stdarch repository also tests the following targets: - aarch64-unknown-freebsd - armv6-unknown-freebsd - powerpc-unknown-freebsd - powerpc64-unknown-freebsd - aarch64-unknown-openbsd Which we don't build/test on our CI currently. I think we have mostly two options here: 1) Ignore these targets 2) Create a special CI job that will build stage 1 rustc and then cross-compile std (or just the `std_detect` crate?) for these targets. ### Documentation The `dox.sh` script (https://github.com/rust-lang/stdarch/blob/3fec5adcd52a815f227805d4959a25b6402c7fd5/ci/dox.sh) builds and documents `std_detect` for several targets. All of them are Tier 2/we have `dist-` jobs for them, so I think that we can just skip this and let our normal CI subsume it? ### Tests The `run.sh` script (https://github.com/rust-lang/stdarch/blob/1b201cec2cca7465602a65ed6ae60517224b15f3/ci/run.sh) runs `cargo test` on `std_detect` with a bunch of variations of feature flags. This will be subsumed by `x test library` in our CI. The only problem is that `stdarch` runs these tests for a ludicrous number of targets: ``` - tuple: i686-unknown-linux-gnu - tuple: x86_64-unknown-linux-gnu - tuple: arm-unknown-linux-gnueabihf - tuple: armv7-unknown-linux-gnueabihf - tuple: aarch64-unknown-linux-gnu - tuple: aarch64_be-unknown-linux-gnu - tuple: riscv32gc-unknown-linux-gnu - tuple: riscv64gc-unknown-linux-gnu - tuple: powerpc-unknown-linux-gnu - tuple: powerpc64-unknown-linux-gnu - tuple: powerpc64le-unknown-linux-gnu - tuple: s390x-unknown-linux-gnu - tuple: i586-unknown-linux-gnu - tuple: nvptx64-nvidia-cuda - tuple: thumbv6m-none-eabi - tuple: thumbv7m-none-eabi - tuple: thumbv7em-none-eabi - tuple: thumbv7em-none-eabihf - tuple: loongarch64-unknown-linux-gnu - tuple: wasm32-wasip1 - tuple: x86_64-apple-darwin - tuple: x86_64-apple-ios-macabi - tuple: aarch64-apple-darwin - tuple: aarch64-apple-ios-macabi - tuple: x86_64-pc-windows-msvc - tuple: i686-pc-windows-msvc - tuple: aarch64-pc-windows-msvc - tuple: x86_64-pc-windows-gnu - tuple: aarch64-unknown-linux-gnu - tuple: aarch64_be-unknown-linux-gnu - tuple: armv7-unknown-linux-gnueabihf - tuple: loongarch64-unknown-linux-gnu - tuple: powerpc-unknown-linux-gnu - tuple: powerpc64-unknown-linux-gnu - tuple: powerpc64le-unknown-linux-gnu - tuple: riscv32gc-unknown-linux-gnu - tuple: riscv64gc-unknown-linux-gnu - tuple: s390x-unknown-linux-gnu - tuple: x86_64-unknown-linux-gnu - tuple: aarch64-apple-darwin - tuple: aarch64-apple-ios-macabi ``` We definitely do not run *tests* for all of these targets on our CI. # Outcome We have decided to just subsume std_detect tests by our normal test suite for now, and not create a separate CI job. Therefore, this PR performs the following changes in target testing for `std_detect`: The following T3 targets would go from "build" to "nothing": ``` aarch64-unknown-freebsd (T3) armv6-unknown-freebsd (T3) powerpc-unknown-freebsd (T3) powerpc64-unknown-freebsd (T3) aarch64-unknown-openbsd (T3) ``` The following T3 targets would go from "test" to "nothing": ``` aarch64_be-unknown-linux-gnu (T3) riscv32gc-unknown-liux-gnu (T3) ``` The following T2 targets would go from "test" to "build": ``` arm-unknown-linux-gnueabihf (T2) armv7-unknown-linux-gnueabihf (T2) riscv64gc-unknown-linux-gnu (T2) powerpc-unknown-linux-gnu (T2) powerpc64-unknown-linux-gnu (T2) powerpc64le-unknown-linux-gnu (T2) s390x-unknown-linux-gnu (T2) i586-unknown-linux-gnu (T2) loongarch64-unknown-linux-gnu (T2) wasm32-wasip1 (T2) x86_64-apple-ios-macabi (T2) aarch64-apple-ios-macabi (T2) aarch64-pc-windows-msvc (T2) armv7-unknown-linux-gnueabihf (T2) loongarch64-unknown-linux-gnu (T2) powerpc-unknown-linux-gnu (T2) ``` I have confirmed in https://github.com/rust-lang/stdarch/pull/1873 that the current version of this PR would pass stdarch's CI testsuite. r? `@ghost` try-job: armhf-gnu try-job: arm-android
2025-07-22Auto merge of #144249 - GuillaumeGomez:asm-tests, r=jieyouxubors-8/+18
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-22Bless bootstrap testsJakub Beránek-11/+11
2025-07-22pass build.npm from bootstrap to tidy and use it for npm installbinarycat-0/+6
2025-07-22bootstrap: Move musl-root fallback out of sanity checkJens Reidel-14/+18
Previously, the musl root would only be set to the fallback /usr by the sanity check, which isn't ran for the bootstrap tests. Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-22bootstrap: add package.json and package-lock.json to dist tarballbinarycat-0/+2
this ensures that js-related tests can still be run from within such a dist tarball.
2025-07-22Add powerpc64le-unknown-linux-musl to CI rustc targetsJens Reidel-0/+1
I missed this in the promotion to tier 2 with host tools. Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-22Rename `tests/codegen` into `tests/codegen-llvm`Guillaume Gomez-5/+10
2025-07-22Rename `tests/assembly` into `tests/assembly-llvm`Guillaume Gomez-3/+8
2025-07-22Rollup merge of #144126 - Shourya742:2025-06-18-fix-target-config-issue, ↵Matthias Krüger-4/+45
r=Kobzol Fix empty target_config in apply_rust_config bootstrap This PR fixes the issue of an empty target_config in apply_rust_config, which was caused by the ordering of TOML config parsing. This was inadvertently introduced during the last config refactor. The test and the corresponding configuration order have been corrected in this PR. r? ```@Kobzol```
2025-07-22Rollup merge of #142924 - lolbinarycat:tidy-js-extra-checks, r=KobzolMatthias Krüger-1/+1
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-22Rollup merge of #144027 - RalfJung:clippy, r=Mark-Simulacrum许杰友 Jieyou Xu (Joe)-24/+20
clippy: make tests work in stage 1 This finally fixes https://github.com/rust-lang/rust/issues/78717 :) Similar to what Miri already does, the clippy test step needs to carefully consider which compiler is used to build clippy and which compiler is linked into clippy (and thus must be used to build the test dependencies). On top of that we have some extra complications that Miri avoided by using `cargo-miri` for building its test dependencies: we need cargo to use the right rustc and the right sysroot, but https://github.com/rust-lang/cargo/issues/4423 makes this quite hard to do. See the long comment in `src/tools/clippy/tests/compile-test.rs` for details. Some clippy tests tried to import rustc crates; that fundamentally requires a full bootstrap loop so it cannot work in stage 1. I had to kind of guess what those tests were doing so I don't know if my changes there make any sense. Cc ```@flip1995``` ```@Kobzol```