Commit Graph

7631 Commits

Author SHA1 Message Date
bors 321a89bec5 Auto merge of #145043 - Zalathar:rollup-3dbvdrm, r=Zalathar
Rollup of 19 pull requests

Successful merges:

 - rust-lang/rust#137831 (Tweak auto trait errors)
 - rust-lang/rust#138689 (add nvptx_target_feature)
 - rust-lang/rust#140267 (implement continue_ok and break_ok for ControlFlow)
 - rust-lang/rust#143028 (emit `StorageLive` and schedule `StorageDead` for `let`-`else`'s bindings after matching)
 - rust-lang/rust#143764 (lower pattern bindings in the order they're written and base drop order on primary bindings' order)
 - rust-lang/rust#143808 (Port `#[should_panic]` to the new attribute parsing infrastructure )
 - rust-lang/rust#143906 (Miri: non-deterministic floating point operations in `foreign_items`)
 - rust-lang/rust#143929 (Mark all deprecation lints in name resolution as deny-by-default and report-in-deps)
 - rust-lang/rust#144133 (Stabilize const TypeId::of)
 - rust-lang/rust#144369 (Upgrade semicolon_in_expressions_from_macros from warn to deny)
 - rust-lang/rust#144439 (Introduce ModernIdent type to unify macro 2.0 hygiene handling)
 - rust-lang/rust#144473 (Address libunwind.a inconsistency issues in the bootstrap program)
 - rust-lang/rust#144601 (Allow `cargo fix` to partially apply `mismatched_lifetime_syntaxes`)
 - rust-lang/rust#144650 (Additional tce tests)
 - rust-lang/rust#144659 (bootstrap: refactor mingw dist and fix gnullvm)
 - rust-lang/rust#144682 (Stabilize `strict_overflow_ops`)
 - rust-lang/rust#145026 (Update books)
 - rust-lang/rust#145033 (Reimplement `print_region` in `type_name.rs`.)
 - rust-lang/rust#145040 (rustc-dev-guide subtree update)

Failed merges:

 - rust-lang/rust#143857 (Port #[macro_export] to the new attribute parsing infrastructure)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-07 14:01:43 +00:00
bors cd434309ef Auto merge of #144997 - BoxyUwU:bootstrap_bump, r=Mark-Simulacrum
bump bootstrap compiler to 1.90 beta

There were significantly less `cfg(bootstrap)` and `cfg(not(bootstrap))` this release. Presumably due to the fact that we change the bootstrap stage orderings to reduce the need for them and it was successful 🙏
2025-08-07 10:56:05 +00:00
Stuart Cook 27ab08811f Rollup merge of #144659 - mati865:gnullvm-vendor-libunwind, r=Kobzol
bootstrap: refactor mingw dist and fix gnullvm

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

The first two commits are NFC and only clean up the code, paving the way for the third commit. That said, I think they are worthwhile even without that fix - reusing the same function for two different outcomes was confusing.

The third commit is the fix for https://github.com/rust-lang/rust/issues/144533, but due to the cross-compilation dance it requires a workaround to find the DLL since that logic really was meant only for Windows builders. That workaround is short-lived and will be removed as soon as gnullvm bootstraps itself.
2025-08-07 20:49:46 +10:00
Stuart Cook 21cf201797 Rollup merge of #144473 - zeroomega:rustc_inconsistency, r=Mark-Simulacrum
Address libunwind.a inconsistency issues in the bootstrap program

We noticed when building rustc multiple time in a roll, some files will not be consistent across the build despite the fact that they are built from same source under the same environment. This patch addresses the inconsistency issue we found on libunwind.a, by sorting the order of the files passed to the linker.
2025-08-07 20:49:44 +10:00
Boxy 7bc34622f0 tidy 2025-08-06 16:55:50 +01:00
Jakub Beránek 057df26bae Remove unneeded stage parameter when setting up stdlib Cargo 2025-08-06 15:20:15 +02:00
Boxy 351e4bd106 handle bootstrap cfgs 2025-08-06 14:14:44 +01:00
bors 213d946a38 Auto merge of #144303 - Kobzol:bootstrap-tool-cleanup, r=jieyouxu
Consolidate staging for `rustc_private` tools

This PR continues bootstrap refactoring, this time by consolidating staging for `Mode::ToolRustc` tools. This refactoring was in the critical path of refactoring `test`/`dist`/`clippy`/`doc` steps, and getting rid of the rmeta/rlib sysroot copy, because tools are pervasive and they are being used for a lot of things in bootstrap.

The main idea is to explicitly model the fact that a stage N `Mode::ToolRustc` tool always works with two different compilers:
- Stage N-1 rustc (`build_compiler`) builds stage N rustc (`target_compiler`)
- Rlib artifacts from stage N rustc are copied to the sysroot of stage N-1 rustc
- Stage N-1 rustc builds the (stage N) tool itself, the tool links to the rlib artifacts of the stage N rustc

Before, the code often used `compiler`, which meant sometimes the build compiler, sometimes the target compiler, and sometimes neither (looking at you, `download-rustc`). This is especially annoying when you get to a situation where you have an install step that invokes a dist step that invokes a tool build step, where *some* compiler is being propagated through, without it being clear what does that compiler represent. This refactoring hopefully makes that clearer and more explicit. It also gets rid of a few `builder.ensure(Rustc(...))` calls within bootstrap, which is always nice.

`Rustdoc` needs to be handled a bit specially, because it acts as a compiler itself, I documented that in the changes.

It wasn't practical to do these refactorings in multiple PRs, so I did it all in one PR. The meat of the change is 9ee6d1c1ed112c3dcfb5684b33772b136df0dca3.

I tested manually that `x build rustdoc` and `x build miri` still works even with `download-rustc`, although I cannot promise any extra support for `download-rustc`, IMO we will just have to reimplement it from scratch in a different way.

As usually, I did some drive-by refactorings to bootstrap, trying to document and clarify things, add more step metadata and tests.

Since these changes broke Cargo, which was incorrectly using `Mode::ToolRustc`, I also changed cargo to `ToolTarget` in this PR.

Best reviewed commit-by-commit (note that I renamed `link_compiler` to `target_compiler`, in accordance to the rest of bootstrap, in the last commit).

r? `@jieyouxu`

try-job: x86_64-gnu-aux
try-job: x86_64-msvc-ext1
2025-08-05 11:34:14 +00:00
Mateusz Mikuła d2e3ea9ba7 windows-gnullvm: include libunwind.dll in dist 2025-08-04 20:02:32 +02:00
Jakub Beránek ac28b5b93a Fix splitting dylib paths 2025-08-04 12:21:27 +02:00
Jakub Beránek 2f4b40fe4e Do not render both cached and uncached edge between two steps 2025-08-04 08:29:18 +02:00
Jakub Beránek 450040f2d3 Implement debugging output of the bootstrap Step graph into a DOT file 2025-08-04 08:29:18 +02:00
Zalathar 3abbdffdbf For "stage 1" ui-fulldeps, use the stage 1 compiler to query target info
Testing ui-fulldeps in "stage 1" actually uses the stage 0 compiler, so that
test programs can link against stage 1 rustc crates.

Unfortunately, using the stage 0 compiler causes problems when compiletest
tries to obtain target information from the compiler, but the output format has
changed since the last bootstrap beta bump.

We can work around this by also providing compiletest with a stage 1 compiler,
and having it use that compiler to query for target information.
2025-08-03 18:07:54 +10:00
Samuel Tardieu 7a64c130f3 Rollup merge of #144782 - jieyouxu:compiletest-selftests, r=Kobzol
Properly pass path to staged `rustc` to `compiletest` self-tests

Otherwise, this can do weird things like use a global rustc, or try to use stage 0 rustc. This must be properly configured, because `compiletest` is intended to only support one compiler target spec JSON format (of the in-tree compiler).

Historically, this was probably done so before `bootstrap` was really its own thing, and `compiletest` had to be runnable as a much more "self-standing" tool.

Follow-up to rust-lang/rust#144675, as I didn't realize this until Zalathar pointed it out in [#t-infra/bootstrap > Building vs testing `compiletest` @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Building.20vs.20testing.20.60compiletest.60/near/532040838).

r? ````@Kobzol````
2025-08-02 11:24:27 +02:00
Jakub Beránek c46f42d239 Clarify comments on Cargo (self-)test steps 2025-08-01 15:46:25 +02:00
Jakub Beránek 47da014771 Make x test cargo stage N test rustc stage N 2025-08-01 15:46:25 +02:00
Jakub Beránek 1d1efed4d4 Fix x test cargo 2025-08-01 15:46:25 +02:00
Jakub Beránek 528e7dc9ae Make build compiler explicit in dist::Cargo 2025-08-01 15:46:25 +02:00
Jakub Beránek 3e6aa81691 Add snapshot tests for test cargo and update Cargo snapshot tests 2025-08-01 15:46:25 +02:00
Jakub Beránek 021f2ff54d Update CargoTest 2025-08-01 15:46:25 +02:00
Jakub Beránek 21d7a54013 Make Cargo a ToolTarget tool 2025-08-01 15:46:25 +02:00
Jakub Beránek 316b5d3902 Add basic Cargo snapshot test 2025-08-01 15:46:25 +02:00
Jakub Beránek 0ff8ff38ee Appease Clippy 2025-08-01 15:46:25 +02:00
Jakub Beránek c3da07beb4 Rename link_compiler to target_compiler 2025-08-01 15:46:24 +02:00
Jakub Beránek 06855be09d Port codegen backends to RustcPrivateCompilers 2025-08-01 15:46:23 +02:00
Jakub Beránek 7a2c4d3122 Add step metadata and a simple test for codegen backends 2025-08-01 15:44:53 +02:00
Jakub Beránek 91d40d270d Fix ToolRustc build with download-rustc 2025-08-01 15:44:53 +02:00
Jakub Beránek 2c7581fd25 Refactor Rustdoc 2025-08-01 15:44:53 +02:00
Jakub Beránek b944144087 Add step metadata and a few tests for Doc steps 2025-08-01 15:44:53 +02:00
Jakub Beránek 6d562b2c74 Implement RustcPrivateCompilers to unify building of rustc_private tools 2025-08-01 15:44:53 +02:00
Jakub Beránek 2f3bfff051 Rename Builder::rustdoc to Builder::rustdoc_for_compiler
To clarify what it does.
2025-08-01 15:44:53 +02:00
Jakub Beránek 8fed3fbd4f Add step metadata to RustAnalyzerProcMacroSrv 2025-08-01 15:44:53 +02:00
Jakub Beránek 57a6c930e8 Cleanup ensure_if_default to not require Option output 2025-08-01 15:44:53 +02:00
Jakub Beránek 65c3597323 Add metadata to Cargo and RustAnalyzer tools 2025-08-01 15:44:53 +02:00
Jakub Beránek b6f12d7b49 Rename extended rustc tool macros 2025-08-01 15:44:53 +02:00
Jieyou Xu bd7b8b3612 Properly pass path to staged rustc to compiletest self-tests
Otherwise, this can do weird things like use a global rustc, or try to
use stage 0 rustc. This must be properly configured, because
`compiletest` is intended to only support one compiler target spec JSON
format (of the in-tree compiler).
2025-08-01 21:29:05 +08:00
bors 924a5a4b7f Auto merge of #144773 - RalfJung:rollup-uif2yyj, r=RalfJung
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-01 10:20:07 +00:00
Jacob Pratt 3f5f045fa7 Rollup merge of #144683 - tgross35:builtins-via-std-workspace, 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-08-01 00:38:19 -04:00
Trevor Gross daf353461b Use core via rustc-std-workspace-core in library/panic*
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-31 22:47:24 +00:00
Jakub Beránek 32f4876bf1 Create a typed wrapper for codegen backends
To avoid representing them just with strings.
2025-07-31 19:40:11 +02:00
Haowei Wu b3f369d925 Address some rustc inconsistency issues
We noticed when building rustc multiple time in a roll, some files
will not be consistent across the build despite the fact that they
are built from same source under the same environment. This patch
addresses the inconsistency issue we found on libunwind.a by sorting
the order of the files passed to the linker.
2025-07-30 14:25:33 -07:00
Jieyou Xu e954253d43 Add change tracker entry 2025-07-30 19:55:17 +08:00
Jieyou Xu 2033a06d7f Deny compiletest self-tests being run against stage 0 rustc unless 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-30 19:55:08 +08:00
Jieyou Xu 0cf6eb5f75 Introduce proper build.compiletest-allow-stage0 config option
In favor of the adhoc `COMPILETEST_FORCE_STAGE0` env var.
2025-07-30 19:54:16 +08:00
Mateusz Mikuła 9cfe5f61ab bootstrap: split runtime DLL part out of make_win_dist 2025-07-30 00:44:10 +02:00
Mateusz Mikuła 987a49ba38 bootstrap: extract cc query into a new function 2025-07-30 00:44:03 +02:00
Stuart Cook f034a4fa14 Rollup merge of #144623 - RalfJung:miri, r=RalfJung
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-29 20:19:53 +10:00
Stuart Cook 0abc0c4201 Rollup merge of #144599 - 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-29 20:19:52 +10:00
Stuart Cook 047304b155 Rollup merge of #144482 - 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-29 20:19:50 +10:00
Ralf Jung dc33eb6c42 update lockfile and bless tidy 2025-07-29 08:10:55 +02:00