about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2025-08-11Rollup merge of #145247 - GuillaumeGomez:update-sysinfo, r=KobzolGuillaume Gomez-3/+3
Update `sysinfo` version to `0.37.0` Some small performance improvements and internal cleanups.
2025-08-11Rollup merge of #145221 - Kobzol:cargo-dist-fix-2, r=jieyouxuGuillaume Gomez-0/+2
Fix Cargo cross-compilation (take two) In https://github.com/rust-lang/rust/pull/145083, I fixed the case of manually invoking `x dist cargo`, but I realized that `x install` creates the `tool::Cargo` step through the `from_build_frompiler` constructor, which doesn't go through `get_tool_target_compiler`. So we just prepare both the host and target stdlibs directly before building Cargo. Ideally we would get rid of `from_build_compiler`, but that will require refactoring the dist and test steps, which is upcoming. Hopefully fixes https://github.com/rust-lang/rust/issues/145059 for good.
2025-08-11Update `sysinfo` version to `0.37.0`Guillaume Gomez-3/+3
2025-08-11Auto merge of #145011 - Kobzol:bootstrap-doc, r=jieyouxubors-239/+510
Enforce in bootstrap that doc must have stage at least 1 Following with the bootstrap cleanups, this time around `doc` steps. Should be pretty straightforward, because the supporting infrastructure was already there. The only thing I found a bit fishy is using `Mode::ToolBootstrap` as a "catch-all" mode for non-rustc-private steps in `tool_doc!`, but I don't think that we need to distinguish the tools in some special way when documenting them, apart from supporting `rustc_private`. Before, `x doc` more or less defaulted to what we call stage 2 now. Now it is properly stage 1, so e.g. `x doc compiler` documents the compiler using the stage0/beta rust(do)c. r? `@jieyouxu` try-job: dist-aarch64-msvc
2025-08-11Rollup merge of #145149 - ↵Stuart Cook-306/+439
Shourya742:2025-07-08-convert-config-method-invoke-inside-parse-functions, r=Kobzol Make config method invoke inside parse use dwn_ctx This PR is part of a series of config refactorings. It removes calls from config methods to solid functions defined in `config.rs`. After this, we will remove the default dependencies in the config. r? ```@Kobzol```
2025-08-10Rollup merge of #145121 - ↵Jacob Pratt-0/+14
lambdageek:dist-must-keep-llvm-third-party-siphash, r=Kobzol bootstrap: `x.py dist rustc-src` should keep LLVM's siphash Fixes rust-lang/rust#145117
2025-08-10Fix Cargo cross-compilation (take two)Jakub Beránek-0/+2
2025-08-10Ship the correct Cranelift backend in its dist stepJakub Beránek-30/+35
2025-08-10Explicitly pass path to built stdlib JSON docs and use the correct compiler ↵Jakub Beránek-23/+26
for it
2025-08-10Rollup merge of #145156 - Kobzol:cargo-build-dir, r=lqd,jieyouxuStuart Cook-0/+9
Override custom Cargo `build-dir` in bootstrap The context for this issue is in https://github.com/rust-lang/rust/issues/145107. The issue is that if people configure `build-dir`, it would break bootstrap. For now, we just hard-code it to our self-contained target directories inside the build directory. Tested by putting the following: ```toml [build] build-dir = "/tmp/foo" [unstable] build-dir = true ``` into `<rustc-checkout>/.cargo/config.toml`. `x build` works with this PR, doesn't work without this PR. Fixes: https://github.com/rust-lang/rust/issues/145107
2025-08-10Rollup merge of #145129 - dpaoliello:arm64eclink, r=wesleywiserStuart Cook-0/+7
[win][arm64ec] Add `/machine:arm64ec` when linking LLVM as Arm64EC When the MSVC linker sees an Arm64EC object file, it needs to know if it's linking the final executable as Arm64EC or Arm64X. This change adds the `/machine:arm64ec` flag to the linker when building LLVM as Arm64EC to avoid that ambiguity (and resulting linker error).
2025-08-10Rollup merge of #145089 - Kobzol:bootstrap-cmd-error, r=jieyouxuStuart Cook-82/+83
Improve error output when a command fails in bootstrap I fixed this because it was being an issue for debugging CI failures. We try to print as much information as possible, just with a slightly less verbose command description in non-verbose mode. The code is now more unified and hopefully simpler to understand. I also fixed the `format_short_cmd` logic, it was a bit weird after some recent refactors. Fixes: https://github.com/rust-lang/rust/issues/145002 r? `````````@jieyouxu````````` CC `````````@Shourya742`````````
2025-08-10Bless testsJakub Beránek-3/+20
2025-08-10Review remarksJakub Beránek-2/+6
2025-08-10Add change tracker entryJakub Beránek-0/+5
2025-08-10Update testsJakub Beránek-37/+208
2025-08-10Update `Std` doc stepJakub Beránek-27/+40
2025-08-10Fix documentation of toolsJakub Beránek-54/+54
2025-08-10Update `Standalone` and `Releases` doc stepsJakub Beránek-16/+29
2025-08-10Update `RustcBook` doc stepJakub Beránek-14/+26
2025-08-10Update `Reference` doc stepJakub Beránek-15/+56
2025-08-10Fix staging for `doc compiler`Jakub Beránek-30/+31
2025-08-10Forbid documenting anything on stage 0Jakub Beránek-34/+25
2025-08-10Auto merge of #144787 - Kobzol:codegen-backend-restructure, r=jieyouxubors-217/+291
Refactor codegen backends in bootstrap This PR refactors the codegen backend steps, in preparation to make more progress on the integration of the GCC codegen backend in bootstrap. It does several things: 1) Splits the `CodegenBackend` step into two, one for clif and another one for gcc. Even though their code is mostly similar, that's IMO mostly fake similarity, and they do (or will) ultimately require different handling. This was already visible in the requirement of building GCC for cg_gcc, of course. 2) It is now possible to build both backends (and dist cranelift) even if they are not specified in `rust.codegen-backends`. It was quite weird that it wasn't possible to even invoke the corresponding codegen backend if the backend wasn't specified in that array, as that array should ideally only change defaults (see later below). 3) Changes the path specification of these steps to an alias. In other words, instead of `compiler/rustc_codegen_cranelift`, the step is now built only using `rustc_codegen_cranelift` or `cg_clif`. This is done to avoid an annoying clash with `x build compiler`, which would otherwise build both codegen backends after the 2) change. 4) Made the copying of codegen backend artifacts more explicit, in particular in the `Assemble` step. 5) Codifies the semantics of `rust.codegen-backends`, which now only affects the defaults of whether a codegen backend will be included in rustc's sysroot and whether it will be disted in `x dist` by default. We can change the behavior later, e.g. to dist cranelift by default in `x dist` once it becomes stabilized. Currently I left the existing behavior that we use on CI, I just tried to document it better. I don't think that this requires a change tracker entry, because the defaults should work the same as before. It is just now possible to do `x build/dist rustc_codegen_cranelift` even if CLIF is not in the `codegen-backends` array. It is no longer possible to do `./x build compiler/rustc_codegen_cranelift` though, not sure if that requires a change tracker entry. There is one thing that I didn't touch yet, and that is the fact that `rust.codegen-backends` not only affects the default behavior of `x dist` w.r.t. Cranelift, but also of `x test`. In other words, `x test rustc_codegen_cranelift` still does not hing if cranelift isn't in `rust.codegen-backends`. I plan to take a look at this once I get to refactoring the test steps. r? `@jieyouxu`
2025-08-09add review commentsbit-aloo-44/+11
2025-08-09Override custom Cargo `build-dir` in bootstrapJakub Beránek-0/+9
2025-08-09extend download context and change functions to directly use thatbit-aloo-227/+130
2025-08-09Rollup merge of #145083 - Kobzol:fix-cargo-cross-build, r=jieyouxuStuart Cook-2/+22
Fix cross-compilation of Cargo Regressed in https://github.com/rust-lang/rust/pull/144303. I guess this wasn't seen in other `ToolTarget` tools, because they are more dependent on the compiler and are ~always built together with other stuff that also built the std, while Cargo is relatively self-contained. Fixes: https://github.com/rust-lang/rust/issues/145059 r? ``@jieyouxu``
2025-08-09Rollup merge of #145073 - ZuseZ4:autodiff-llvm-21, r=jieyouxuStuart Cook-0/+1
update enzyme submodule to handle llvm 21 This currently has a fix / workaround in our local rust-lang/Enzyme fork, which is needed to unblock a few people contributing to std::autodiff. It also permanently disables a component (BCLoader) which we shouldn't need on the rust side, hence saving a bit of compile time and disk space. Once upstream Enzyme (EnzymeAD/Enzyme) fixed llvm-21 support I'll probably make another pr to drop our local patch.
2025-08-09invoke functions from methodsbit-aloo-204/+28
2025-08-09add read_file_by_commit function and invoke from parse_innerbit-aloo-2/+27
2025-08-09add ci_llvm_root function and invoke from parse_innerbit-aloo-1/+11
2025-08-09add git_info function and invoke from parse_innerbit-aloo-10/+14
2025-08-09add is_system_llvm function and invoke from parse_innerbit-aloo-1/+33
2025-08-08[win][arm64ec] Add '/machine:arm64ec' when linking LLVM as Arm64ECDaniel Paoliello-0/+7
2025-08-08bootstrap: `x.py dist rustc-src` should keep LLVM's siphashAleksey Kliger-0/+14
2025-08-08add parse_download_ci_llvm function and invoke from parse_innerbit-aloo-7/+248
2025-08-08add download_ci_rustc_commit function and invoke from parse_innerbit-aloo-1/+128
2025-08-08Improve error output when a command fails in bootstrapJakub Beránek-82/+83
2025-08-08Bless snapshot testsJakub Beránek-0/+2
2025-08-08Review remarksJakub Beránek-25/+22
2025-08-08Clarify the behavior of `rust.codegen-backends`Jakub Beránek-11/+20
2025-08-08Refactor `dist::CraneliftCodegenBackend`Jakub Beránek-51/+84
Make it clear that it only works for the Cranelift backend, add step metadata, add a test and change the default enablement logic for this step.
2025-08-08Split CodegenBackend step into two and handle stamp sysroot copy explicitlyJakub Beránek-148/+181
2025-08-08Build host library when cross-compiling `ToolTarget` toolsJakub Beránek-2/+7
2025-08-08Add snapshot test for cross-compilation cargo buildJakub Beránek-0/+15
2025-08-08Auto merge of #145077 - Zalathar:rollup-0k4194x, r=Zalatharbors-951/+936
Rollup of 19 pull requests Successful merges: - rust-lang/rust#144400 (`tests/ui/issues/`: The Issues Strike Back [3/N]) - rust-lang/rust#144764 ([codegen] assume the tag, not the relative discriminant) - rust-lang/rust#144807 (Streamline config in bootstrap) - rust-lang/rust#144899 (Print CGU reuse statistics in `-Zprint-mono-items`) - rust-lang/rust#144909 (Add new `test::print_merged_doctests_times` used by rustdoc to display more detailed time information) - rust-lang/rust#144912 (Resolver: introduce a conditionally mutable Resolver for (non-)speculative resolution.) - rust-lang/rust#144914 (Add support for `ty::Instance` path shortening in diagnostics) - rust-lang/rust#144931 ([win][arm64ec] Fix msvc-wholearchive for Arm64EC) - rust-lang/rust#144999 (coverage: Remove all unstable support for MC/DC instrumentation) - rust-lang/rust#145009 (A couple small changes for rust-analyzer next-solver work) - rust-lang/rust#145030 (GVN: Do not flatten derefs with ProjectionElem::Index. ) - rust-lang/rust#145042 (stdarch subtree update) - rust-lang/rust#145047 (move `type_check` out of `compute_regions`) - rust-lang/rust#145051 (Prevent name collisions with internal implementation details) - rust-lang/rust#145053 (Add a lot of NLL `known-bug` tests) - rust-lang/rust#145055 (Move metadata symbol export from exported_non_generic_symbols to exported_symbols) - rust-lang/rust#145057 (Clean up some resolved test regressions of const trait removals in std) - rust-lang/rust#145068 (Readd myself to review queue) - rust-lang/rust#145070 (Add minimal `armv7a-vex-v5` tier three target) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-08Rollup merge of #145070 - vexide:minimal-armv7a-vex-v5, r=wesleywiserStuart Cook-0/+1
Add minimal `armv7a-vex-v5` tier three target This PR adds minimal, `no_std` support for the VEX V5 Brain, a robotics microcontroller used in educational contexts. In comparison to rust-lang/rust#131530, which aimed to add this same target, these changes are limited in scope to the compiler. ## Tier 3 Target Policy Compliance > A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.) Lewis McClelland (`@lewisfm),` `@Tropix126,` Gavin Niederman (`@Gavin-Niederman),` and Max Niederman (`@max-niederman)` will be the designated maintainers for `armv7a-vex-v5` support. > Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target. `armv7a-vex-v5` follows the cpu-vendor-model convention used by most tier three targets. For example: `armv76k-nintendo-3ds` or `armv7k-apple-watchos`. > Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it. > If possible, use only letters, numbers, dashes and underscores for the name. Periods (.) are known to cause issues in Cargo. This target name is not confusing. > Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users. It's using open source tools only. > The target must not introduce license incompatibilities. > > Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0). Understood. > The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements. There are no new dependencies/features required in the current state of this target. Porting the standard library will likely require depending on the crate `vex-sdk` which is MIT-licensed and contains bindings to the VEX SDK runtime (which is included in VEXos). > Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. Host tools built for the target itself may depend on the ordinary runtime libraries supplied by the platform and commonly used by other applications built for the target, but those libraries must not be required for code generation for the target; cross-compilation to the target must not require such libraries at all. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3. > > "onerous" here is an intentionally subjective term. At a minimum, "onerous" legal/licensing terms include but are not limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users. Although the VEX V5 Brain and its SDK are proprietary, this target does not link to any proprietary binaries or libraries, and is based solely on publicly available information about the VEX SDK. > Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions. > > This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements. I understand. > Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions. This initial PR only contains a compiler target definition to teach the `cc` crate about this target. Porting the standard library is the next step for this target. > The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary. This target is documented in `src/doc/rustc/src/platform-support/armv7a-vex-v5.md`. > Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via `@)` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages. > > Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications. I understand and assent. > Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target. > > In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target. I understand and assent. > Tier 3 targets must be able to produce assembly using at least one of rustc's supported backends from any host target. (Having support in a fork of the backend is not sufficient, it must be upstream.) `armv7a-vex-v5` has nearly identical codegen to `armv7a-none-eabihf`, so this is not an issue. > If a tier 3 target stops meeting these requirements, or the target maintainers no longer have interest or time, or the target shows no signs of activity and has not built for some time, or removing the target would improve the quality of the Rust codebase, we may post a PR to remove it; any such PR will be CCed to the target maintainers (and potentially other people who have previously worked on the target), to check potential interest in improving the situation. I understand.
2025-08-08Rollup merge of #144807 - Shourya742:2025-07-30-streamline-config, r=KobzolStuart Cook-951/+935
Streamline config in bootstrap This PR restructures the config module to improve readability and debuggability. It also aims to eliminate as many invariants as possible. Best reviewed commit by commit. r? `````@Kobzol`````
2025-08-07Rollup merge of #145007 - Kobzol:error-index, r=jieyouxuTrevor Gross-87/+124
Fix build/doc/test of error index generator It is essentially a RustcPrivate tool, so it should be treated as such using the new `RustcPrivateCompilers` infra. Found while working on unrelated `doc` cleanups. r? ````@jieyouxu````