Commit graph

7530 commits

Author SHA1 Message Date
Guillaume Gomez
9944139f70 Add new ignore-backends tests annotations 2025-07-20 14:43:59 +02:00
bors
f63685ddf3 Auto merge of #143641 - Kobzol:tool-target, r=jieyouxu
Add `ToolTarget` to bootstrap

Oh, you thought I'm done with refactoring bootstrap tools? Na-ah, think again! After the failure of https://github.com/rust-lang/rust/pull/143581, `ToolTarget` is back with a vengeance. This time, I implemented the test changes and tool cleanups without forcing these tools to be built with the stage0 compiler.

There are still some small wins though, `LlvmBitcodeLinker` now starts at stage 1, and not stage 2. Cargo should also be ported to this new mode, but I'm leaving that for a follow-up PR.

Hopefully X-th time's the charm 🤞

r? `@jieyouxu`
2025-07-19 14:09:56 +00:00
Jakub Beránek
f16016ad25
Fix compiler for dist LLVM bitcode linker 2025-07-19 10:27:46 +02:00
Matthias Krüger
870d429e25
Rollup merge of #144092 - Gelbpunkt:musl-stage0, r=Kobzol
bootstrap: Detect musl hosts

Currently, all non-Android Linux hosts are assumed to be using glibc. This obviously isn't very portable and will currently result in downloading a stage0 toolchain for glibc even on musl hosts.

There are multiple ways to detect musl somewhat reliably, but the easiest option is to check for the python target, which is exposed in `sys.implementation._multiarch` and has values like "x86_64-linux-gnu" or "powerpc64le-linux-musl".
2025-07-19 08:55:36 +02:00
Jens Reidel
9e4f777602 bootstrap: Detect musl hosts
Currently, all non-Android Linux hosts are assumed to be using glibc.
This obviously isn't very portable and will currently result in
downloading a stage0 toolchain for glibc even on musl hosts.

There are multiple ways to detect musl somewhat reliably, but the
easiest option is to check for the python SOABI config variable, which
has values like "cpython-313-x86_64-linux-gnu" or
"cpython-313-powerpc64-linux-musl".

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-18 09:39:13 +02:00
Matthias Krüger
c22e2ead96
Rollup merge of #144056 - Kobzol:gcc-build-src, r=nikic
Copy GCC sources into the build directory even outside CI

It takes ~3.5s on my Linux notebook to perform the copy, but it should only be executed when we actually go build GCC, and that will almost certainly take much longer :) So I think it should be fine. At least we won't be polluting the source directory for local builds.

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

r? `````@nikic`````
2025-07-18 04:27:55 +02:00
Matthias Krüger
3023a287fa
Rollup merge of #144010 - xdoardo:bootstrap-warning-optimize-false, r=clubby789
Boostrap: add warning on `optimize = false`

I recently came across a bug that can be traced back to the use of `optimize = false` in `bootstrap.toml` in combination with other settings. Following [this](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/Missing.20box-related.20symbols.20with.20panic.20.3D.20'abort'/with/528992909) conversation, this PR adds a warning from `bootstrap` when `optimize = false` is used.

I notice that in the same file I edited there are two different styles for warnings (`WARN`, `Warning`). I used `WARNING` because, by happenstance, when testing I got a `WARNING` that I didn't set a change id: let me know if I can unify the styles in the file I edited.
2025-07-18 04:27:54 +02:00
Jakub Beránek
6645bf54c1
Copy GCC sources into the build directory even outside CI 2025-07-17 10:12:55 +02:00
Edoardo Marangoni
0e423f441a
Boostrap: add warning on optimize = false 2025-07-16 09:24:30 +02:00
Jakub Beránek
4f1b3e3afc Clarify comments 2025-07-15 19:47:57 +02:00
bit-aloo
306928fc11
update change tracking with warning on removal of fields. 2025-07-15 22:05:00 +05:30
bit-aloo
76967afd3b
remove ccache from llvm 2025-07-15 21:59:59 +05:30
bit-aloo
e7f5bbe743
remove description from rust toml struct 2025-07-15 21:59:59 +05:30
Samuel Tardieu
6b6c8be19d
Rollup merge of #143752 - pmur:murp/no-panic-detect-wasi-cc, r=Kobzol
Don't panic if WASI_SDK_PATH not set when detecting compiler

The fedora packaging builds the wasm sysroot outside of the rust build system. Fedora applies a couple of patches related to wasm which I think make this possible. Not panicking seems consistent with the detection logic of other targets when they cannot find cc.
2025-07-15 12:52:38 +02:00
Samuel Tardieu
f03a56f706
Rollup merge of #143630 - jieyouxu:drop-suggest, r=Mark-Simulacrum
Drop `./x suggest`

This PR removes the current `./x suggest` implementation (rust-lang/rust#109933, rust-lang/rust#106249) and associated docs for several reasons:

1. Primarily, `./x suggest` is another "flow" in bootstrap that incurs extra complexity and more invariants that bootstrap has to maintain. This causes more friction when trying to investigate and fix staging problems. As far as I know, this flow has not been actively maintained in quite a while, and I'm not aware of interest in maintaining it. Bootstrap really could use less implementation complexity with a very limited maintenance bandwidth.
2. The current `./x suggest` implementation "bypasses" the usual stage defaults for the various check/build/test/etc. flows, and it's not really possible to have a stage default because `./x suggest --run` produces a *sequence* of suggestions like [`./x check`, `./x test library/std`, ..] and then tries to run all of them in sequence, based on which files are modified.
3. We've not seen a lot of interest both in using it or extending static/dynamic test suggestions. Last extensions were rust-lang/rust#117961 and rust-lang/rust#120763. I'm not convinced the extra implementation complexity is worth it. This was discussed in:
    - [#t-infra/bootstrap > Dropping the current &#96;./x suggest&#96; flow implementation](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Dropping.20the.20current.20.60.2E.2Fx.20suggest.60.20flow.20implementation/with/527456699)
    - [#t-compiler > Dropping current &#96;./x suggest&#96; implementation](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Dropping.20current.20.60.2E.2Fx.20suggest.60.20implementation/with/527528696)

Closes rust-lang/rust#109933 (the current implementation is being removed).
Closes rust-lang/rust#143569 (by removing `./x suggest` altogether).
2025-07-15 12:52:37 +02:00
Paul Murphy
9bdd3b0ee6 Don't always panic if WASI_SDK_PATH is not set when detecting compilers
They are not always needed when building std, as is the case when
packaging on Fedora. Panic if building from CI, but warn otherwise.
2025-07-14 15:05:59 -05:00
Jieyou Xu
91d064b442
Remove current implementation of ./x suggest
This is quite a bit of implementation complexity, yet it is quite
broken, and we don't have the maintenance bandwidth to address.

Remove the current implementation if only to reduce bootstrap's
implementation complexity; the `suggest` flow comes with its own set of
hacks.
2025-07-15 00:46:33 +08:00
Jieyou Xu
904273c58e
Register change tracker warning for removal of ./x suggest 2025-07-15 00:46:31 +08:00
Samuel Tardieu
c59bc44ca9
Rollup merge of #143848 - makai410:smir-rename, r=oli-obk
Rename `stable_mir` and `rustc_smir`

This PR only renames the two crate names.

There is no doubt that we want to rename `stable_mir` to `rustc_public`, while it hasn't been discussed yet that what the new name for `rustc_smir` should be.

This PR proposes a new name for `rustc_smir`, that is `rustc_public_shim`, since `rustc_smir` now is mostly a proxy to do calls to rustc queries and the public API of rustc that is invoked by the `rustc_public` crate.

However, I don't think that name is good enough. I hope there would be a way better name.

r? `@oli-obk`
2025-07-14 18:05:44 +02:00
Makai
6598c61725 rename stable_mir to rustc_public, and rustc_smir to rustc_public_bridge 2025-07-14 09:25:54 +00:00
Jakub Beránek
37b5d79108
Rollup merge of #143887 - Kobzol:reroder-bootstrap-tests, r=jieyouxu
Run bootstrap tests sooner in the `x test` pipeline

With the recently added bootstrap snapshot tests, and in general with our plans to test more things in bootstrap, I feel like the original comment isn't accurate anymore. Recently, on several occasions I had to wait for 40+ minutes of CI just to find out that the bootstrap snapshot tests have failed. I think we should run bootstrap tests towards the beginning instead now.

r? ```@jieyouxu```
2025-07-14 11:04:56 +02:00
Jakub Beránek
197ba7e4f1
Rollup merge of #143733 - Stypox:bootstrap-tool-config-any, r=Kobzol
Change bootstrap's `tool.TOOL_NAME.features` to work on any subcommand

This is a followup to rust-lang/rust#142379 to make the bootstrap option `tool.TOOL_NAME.features` work on any subcommand instead of just build (so also run/test/...). I also made the `TOOL_NAME` comparisons look at the tool path instead of the tool name to determine to which tool a `TOOL_NAME` refers to, so you can specify tools by path like in other places of the bootstrap (e.g. `tool."tools/miri".features`).
2025-07-14 11:04:54 +02:00
Jakub Beránek
33d477fe31
Rollup merge of #143681 - RalfJung:bootstrap-miri-rebuilds, r=Kobzol
bootstrap/miri: avoid rebuilds for test builds

When building Miri in its own repo, we always build with `--all-targets`:
a009612691/src/tools/miri/miri-script/src/util.rs (L167-L174)
This saves a bunch of time since some of Miri's dependencies get more features enabled by some of Miri's dev-dependencies, and they all get built twice otherwise if you do `cargo build && cargo test` (which is typically what you end up doing inside `./miri test` and also inside `./x test miri`).

This applies the same approach to bootstrap, drastically reducing the edit-compile cycle for Miri work here. :)
2025-07-14 11:04:52 +02:00
Stypox
b3ed03529f
Only compare tool name to apply features to 2025-07-14 09:37:24 +02:00
Stypox
937ef9381c
Bootstrap's tool.TOOL_NAME.features now works on any subcommand 2025-07-14 09:37:23 +02:00
Matthias Krüger
3ff549f6d3
Rollup merge of #143826 - Shourya742:2025-07-12-fix-command-trace, r=Kobzol
Fix command trace

With the recent developments in centralization of command execution, we somehow broke the traces for command execution. This PR fixes that and add trace to stream command execution as well.

r? ````@Kobzol````
2025-07-13 15:16:02 +02:00
Matthias Krüger
5284c84725
Rollup merge of #143825 - RalfJung:clippy-test-filter, r=llogiq
clippy: fix test filtering when TESTNAME is empty

Fixes https://github.com/rust-lang/rust/issues/143824. Turns out bootstrap was just fine, the TESTNAME logic in clippy was wrong... I still made this a rustc PR as that's where I did all the debugging.

The bootstrap change is not really related, but it's comment-only so not worth a separate PR... adding the `test_args` is also part of what `prepare_cargo_test` would usually do so let's group the code properly.
2025-07-13 15:16:02 +02:00
Matthias Krüger
b4b00c7d10
Rollup merge of #143785 - bjorn3:faster_ra_build_script_build, r=Kobzol
Add --compile-time-deps argument for x check

Together with skipping building C++ code in rustc_llvm for check, this reduces the amount of time it takes to do the x check for rust-analyzer analysis from 12m16s to 3m06s when the bootstrap compiler is already downloaded.
2025-07-13 15:16:00 +02:00
Jakub Beránek
a3c90b69af
Run bootstrap tests sooner in the x test pipeline 2025-07-13 14:38:33 +02:00
León Orell Valerian Liehr
2cbd0bc27c
Rollup merge of #143822 - RalfJung:miri-ui-clean, r=jieyouxu
./x test miri: fix cleaning the miri_ui directory

Fixes https://github.com/rust-lang/rust/issues/143680
2025-07-13 07:21:24 +02:00
León Orell Valerian Liehr
886ad3a947
Rollup merge of #143817 - Kobzol:wasi-sdk-path, r=jieyouxu
Access `wasi_sdk_path` instead of reading environment variable in bootstrap

Small cleanup to remove an environment variable read that we have performed earlier in bootstrap already.
2025-07-13 07:21:24 +02:00
León Orell Valerian Liehr
d607b944e4
Rollup merge of #143798 - Shourya742:2025-07-11-remove-format-short-command-trait, r=Kobzol
Remove format short command trait

Since we no longer have traces of the vanilla command, and we're already implementing format_short_command for CommandFingerprint, we can use it directly from the fingerprint. This PR removes the standalone format_short_command trait and moves its implementation under CommandFingerprint.
2025-07-13 07:21:22 +02:00
bit-aloo
a9a238ba5b
explicitly drop span_guard in wait_for_output 2025-07-12 19:23:58 +05:30
bjorn3
10bec8f7de Add change_tracker.rs entry 2025-07-12 12:37:03 +00:00
bjorn3
ccc302baa0 Move --compile-time-deps 2025-07-12 12:34:37 +00:00
Ralf Jung
b703451b34
refine comment
Co-authored-by: Jakub Beránek <berykubik@gmail.com>
2025-07-12 12:11:54 +02:00
bit-aloo
57ee3f206c
add span to streaming command execution flow 2025-07-12 14:55:30 +05:30
bit-aloo
acbbc18599
fix span for deferred command execution 2025-07-12 14:52:34 +05:30
Ralf Jung
73edfe7b73 clippy: fix test filtering when TESTNAME is empty 2025-07-12 11:11:29 +02:00
Ralf Jung
b0e4c3594f ./x test miri: fix cleaning the miri_ui directory 2025-07-12 09:40:35 +02:00
Jakub Beránek
0528cc9638
Access wasi_sdk_path instead of reading environment variable in bootstrap 2025-07-11 22:43:02 +02:00
bit-aloo
d004abb4d3
remove format short command and push format short command method inside fingerprint impl 2025-07-11 21:37:38 +05:30
bit-aloo
cdbe44d806
Use short command method directly from fingerprint 2025-07-11 20:33:36 +05:30
bjorn3
ae1075b9ee Update description for flag 2025-07-11 13:54:44 +00:00
Guillaume Gomez
1a28fb8b7b Update sysinfo version to 0.36.0 2025-07-11 15:51:42 +02:00
bjorn3
87958ad683 Avoid building C++ for rustc_llvm with --compile-time-deps
This saves about 30s.
2025-07-11 13:32:03 +00:00
bjorn3
3fe3edbcde Add --compile-time-deps argument for x check
This reduces the amount of time it takes to do the x check for
rust-analyzer analysis from 12m16s to 3m34s when the bootstrap compiler
is already downloaded.
2025-07-11 12:34:17 +00:00
Trevor Gross
d1a57676ef
Rollup merge of #143707 - Kobzol:bootstrap-std-check, r=jieyouxu
Fix `--skip-std-check-if-no-download-rustc`

Since https://github.com/rust-lang/rust/pull/143048, we now explicitly set the build compiler for `check::Std`, which caused it to be built before we checked `--skip-std-check-if-no-download-rustc`. So I moved the check earlier to `make_run`, which resolves it.

I also added a regression test for this. Sadly we can't really test for the positive case easily (when download-ci-rustc is enabled), but we can test the negative cases, where it is disabled.

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

r? ```@RalfJung```
2025-07-10 20:20:39 -04:00
bors
2a023bf80a Auto merge of #143746 - matthiaskrgr:rollup-yaojj7t, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#143446 (use `--dynamic-list` for exporting executable symbols)
 - rust-lang/rust#143590 (Fix weird rustdoc output when single and glob reexport conflict on a name)
 - rust-lang/rust#143599 (emit `.att_syntax` when global/naked asm use that option)
 - rust-lang/rust#143615 (Fix handling of no_std targets in `doc::Std` step)
 - rust-lang/rust#143632 (fix: correct parameter names in LLVMRustBuildMinNum and LLVMRustBuildMaxNum FFI declarations)
 - rust-lang/rust#143640 (Constify `Fn*` traits)
 - rust-lang/rust#143651 (Win: Use exceptions with empty data for SEH panic exception copies instead of a new panic)
 - rust-lang/rust#143660 (Disable docs for `compiler-builtins` and `sysroot`)
 - rust-lang/rust#143665 ([rustdoc-json] Add tests for `#[doc(hidden)]` handling of items.)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-07-10 19:56:08 +00:00
Matthias Krüger
6c4502d97d
Rollup merge of #143660 - cuviper:lib-doc-false, r=tgross35
Disable docs for `compiler-builtins` and `sysroot`

Bootstrap already had a manual doc filter for the `sysroot` crate, but
other library crates keep themselves out of the public docs by setting
`[lib] doc = false` in their manifest. This seems like a better solution
to hide `compiler-builtins` docs, and removes the `sysroot` hack too.

Fixes rust-lang/rust#143215 (after backport)
```@rustbot``` label beta-nominated
2025-07-10 20:28:50 +02:00