about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2025-06-03This commit adds a `toml` module that represents various subsections of ↵bit-aloo-0/+1541
`bootstrap.toml`. The module primarily defines the TOML representations of these subsections and their corresponding configuration parsing implementations, which are ultimately integrated into the main configuration. - `mod.rs` – Serves as the entry point for the TOML configuration and defines the `TomlConfig` struct along with its parsing implementation. - `rust.rs` – Defines the `Rust` subsection struct and its configuration parsing implementation. - `target.rs` – Defines the `Target` subsection struct and its configuration parsing implementation. - `llvm.rs` – Defines the `Llvm` subsection struct and its configuration parsing implementation. - `install.rs` – Defines the `Install` subsection struct and its configuration parsing implementation. - `gcc.rs` – Defines the `Gcc` subsection struct and its configuration parsing implementation. - `dist.rs` – Defines the `Dist` subsection struct and its configuration parsing implementation. - `build.rs` – Defines the `Build` subsection struct and its configuration parsing implementation.
2025-06-03move `test-float-parse` tool into `src/tools` dironur-ozkan-7/+7
Obviously `test-float-parse` is a tool like any other in `src/tools`. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-03make library profile to use stage 1 on `x check`onur-ozkan-1/+2
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-03make `x check` to use stage0 by defaultonur-ozkan-1/+4
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-03Auto merge of #141210 - RalfJung:miri-std-doctests, r=saethlinbors-12/+11
tools-aux ci runner: also cross-test doctests in Miri Miri now supports running doctests across different targets. Let's use that to run the std doctests on aarch64-apple-darwin, i686-pc-windows-msvc. try-job: x86_64-gnu-aux
2025-06-02bootstrap: Remove `rustc_snapshot_libdir` from PATH in one more placeVadim Petrochenkov-4/+2
2025-06-02Use ccache for stage0 tool and rustc buildsJakub Beránek-0/+22
2025-06-02Auto merge of #119899 - onur-ozkan:redesign-stage0-std, ↵bors-355/+346
r=albertlarsan68,jieyouxu,mark-simulacrum,kobzol,jyn514,Noratrieb,WaffleLapkin,RalfJung,bjorn3 redesign stage 0 std ### Summary **Blog post: https://blog.rust-lang.org/inside-rust/2025/05/29/redesigning-the-initial-bootstrap-sequence/** This PR changes how bootstrap builds the stage 1 compiler by switching to precompiled stage 0 standard library instead of building the in-tree one. The goal was to update bootstrap to use the beta standard library at stage 0 rather than compiling it from source (see the motivation at https://github.com/rust-lang/compiler-team/issues/619). Previously, to build a stage 1 compiler bootstrap followed this path: ``` download stage0 compiler -> build in-tree std -> compile stage1 compiler with in-tree std ``` With this PR, the new path is: ``` download stage0 compiler -> compile stage1 compiler with precompiled stage0 std ``` This also means that `cfg(bootstrap)`/`cfg(not(bootstrap))` is no longer needed for library development. ### Building "library" Since stage0 `std` is no longer in-tree `x build/test/check library --stage 0` is now no-op. The minimum supported stage to build `std` is now 1. For the same reason, default stage values in the library profile is no longer 0. Because building the in-tree library now requires a stage1 compiler, I highly recommend library developers to enable `download-rustc` to speed up compilation time. <hr> **Blog post: https://blog.rust-lang.org/inside-rust/2025/05/29/redesigning-the-initial-bootstrap-sequence/** If you encounter a bug or unexpected results please open a topic in the [#t-infra/bootstrap](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap) Zulip channel or create a [bootstrap issue](https://github.com/rust-lang/rust/issues/new?template=bootstrap.md). (Review thread: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Review.20thread.3A.20stage.200.20redesign.20PR/with/508271433) ~~Blocked on https://github.com/rust-lang/rust/pull/122709~~ try-job: dist-x86_64-linux try-job: `x86_64-msvc*` try-job: `x86_64-apple-*` try-job: `aarch64-apple` try-job: x86_64-gnu try-job: `x86_64-gnu-llvm*`
2025-06-01Rollup merge of #141852 - onur-ozkan:resolve-if-let-fixme, r=jieyouxuGuillaume Gomez-3/+3
resolve if-let-chain FIXME on bootstrap self-explanatory
2025-06-01Rollup merge of #141846 - Berrysoft:cygwin-bootstrap-tls, r=mati865Guillaume Gomez-1/+6
Fix TLS model on bootstrap for cygwin There aren't other targets that both use emutls and enable `has_thread_local`, so cygwin triggers this bug first. r? mati865 See: https://github.com/rust-lang/rust/pull/141719#issuecomment-2925445263 ``@jeremyd2019`` Could you check if this PR fixes the issue? I just found my pre-built stage-0 rustc was too old to build the current rustc :(
2025-06-01Rollup merge of #141789 - ↵Guillaume Gomez-1/+2
ferrocene:hoverbear/exclude-cargo-home-from-in-tree-consideration, r=clubby789 Exclude `CARGO_HOME` from `generate-copyright` in-tree determination On Ferrocene, we noticed that in our releases the out-of-tree notices were not being included. When `x.py run generate-copyright` was ran on local development machines, it worked fine. After some investigations ``@tshepang`` and I determined that the problem was that the cargo registry (located in `CARGO_HOME`) started with the source directory on CI jobs, and was being excluded by this line: https://github.com/rust-lang/rust/blob/15825b7161f8bd6a3482211fbf6727a52aa1166b/src/tools/generate-copyright/src/cargo_metadata.rs#L85-L88 In Ferrocene's `run.sh` we set `CARGO_HOME` to be `build/cargo-home`: https://github.com/ferrocene/ferrocene/blob/96a45dd9a18c6e54d3cd81750a78fe459fa48af0/ferrocene/ci/run.sh#L34-L46 which caused this issue. This PR passes the `CARGO_HOME` variable to the `generate-copyright` tool and expands the consideration of in-tree-ness to be aware of `CARGO_HOME`. It is an upstreaming of https://github.com/ferrocene/ferrocene/pull/1491. ## Testing Run `CARGO_HOME=build/cargo-home ./x.py run generate-copyright` on `master`, then check `build/host/doc/COPYRIGHT` and look for out of tree dependencies (at the bottom). Then, try running the same command in this branch.
2025-06-01resolve if-let-chain FIXME on bootstraponur-ozkan-3/+3
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-01Fix TLS model on bootstrap for cygwin王宇逸-1/+6
2025-05-31Rollup merge of #141819 - mati865:windows-gnullvm-host-fixes, r=jieyouxuMatthias Krüger-3/+6
Fixes for building windows-gnullvm hosts Split out from: https://github.com/rust-lang/rust/pull/140772
2025-05-31Rollup merge of #141646 - jieyouxu:distcheck, r=Mark-SimulacrumMatthias Krüger-1/+8
Document what `distcheck` is intended to exercise Or at least attempt to. Closes rust-lang/rust#141387. cc `@marcoieni` (re. [#t-infra/bootstrap > Speed up distcheck](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Speed.20up.20distcheck/with/520208870)) r? `@Mark-Simulacrum` (as you may have some clues about if this is accurate)
2025-05-31bootstrap: remap compiler vs non-compiler sources differentlyJieyou Xu-10/+70
- Map compiler sources (corresponding to `rustc-dev` dist component) with `/rustc-dev/{hash}`. - Map non-compiler sources (corresponding to `rust-src` dist component or other non-compiler sources) with `/rustc/{hash}`. This allows the compiler to have the possibility of opportunistically reverse the mapping. This is because - `rust-src` unpacks sources to a path like `$sysroot/lib/rustlib/src/rust`, whereas - `rustc-dev` unpacks sources to a path like `$sysroot/lib/rustlib/rustc-src/rust` (Notice the `src` vs `rustc-src` difference.)
2025-05-31Shared libLLVM linking is officially supported with MinGW and ClangMateusz Mikuła-1/+2
2025-05-31Fix C++ standard library name for *-windows-gnullvm targetsMateusz Mikuła-1/+3
2025-05-31Fix incorrect commentMateusz Mikuła-1/+1
2025-05-30bootstrap: build std with less frame pointersJubilee Young-1/+2
Sometimes leaf frame-pointers can impact LLVM inlining choices, and that can be a real problem for things like `mul_add`.
2025-05-30Exclude `CARGO_HOME` from `generate-copyright` in-tree determinationAna Hobden-1/+2
2025-05-30Auto merge of #141657 - petrochenkov:nobinroot, r=jieyouxubors-1/+0
bootstrap: Remove `bin_root` from `PATH` It's not currently load bearing in typical setups on typical targets. Basically, if it passes the standard CI, then we can remove it, I think. If someone later reports this breaking the build, then we can address it in a more fine grained way. E.g. add it to `PATH` last and not first, only on specific targets, and only if specific files are not already found in `PATH` directories. Fixes [#t-infra/bootstrap > Build broken in MSYS2 @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Build.20broken.20in.20MSYS2/near/520709527)
2025-05-30fix clippy warningsonur-ozkan-235/+230
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-30fix bootstrap testsonur-ozkan-14/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-30fix fs bug on CI and update ming-check-1 Dockerfileonur-ozkan-0/+8
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-30fix CI-rustc bugsonur-ozkan-11/+27
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-30be able to build stage1 library with CI-rustconur-ozkan-33/+14
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-30add "library" to `RUSTC_IF_UNCHANGED_ALLOWED_PATHS`onur-ozkan-15/+2
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-30improve comments and docsonur-ozkan-14/+15
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-30add change entryonur-ozkan-0/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-30bless bootstrap testsonur-ozkan-3/+3
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-30update stage defaultsonur-ozkan-7/+7
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-30improve `check::Std` handlingonur-ozkan-0/+9
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-30update std uplifting algorithmonur-ozkan-2/+9
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-30use initial rustc's std on stage 0onur-ozkan-31/+26
On stage 0, rather than compiling std utilize the one from the stage0 sysroot as stage 0 should represent the snapshot version not the compiled one. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-30Rollup merge of #141736 - onur-ozkan:resolve-stage0-syroot-from-rustc, r=KobzolMatthias Krüger-1/+3
resolve stage0 sysroot from rustc Similar to https://github.com/rust-lang/rust/pull/141729, instead of manually navigating directories based on stage0 rustc, use `--print sysroot` to get the sysroot directly. This also works when using the bootstrap `rustc` shim. r? Kobzol
2025-05-30Rollup merge of #141407 - mu001999-contrib:dead-code/refactor, r=petrochenkovMatthias Krüger-0/+3
Refactor the two-phase check for impls and impl items Refactor the two-phase dead code check to make the logic clearer and simpler: 1. adding assoc fn and impl into `unsolved_items` directly during the initial construction of the worklist 2. converge the logic of checking whether assoc fn and impl are used to `item_should_be_checked`, and the item is considered used only when its corresponding trait and Self adt are used This PR only refactors as much as possible to avoid affecting the original functions. However, due to the adjustment of the order of checks, the test results are slightly different, but overall, there is no regression problem Fixes rust-lang/rust#127911 Fixes rust-lang/rust#128839 Extracted from https://github.com/rust-lang/rust/pull/128637. r? petrochenkov try-job: dist-aarch64-linux
2025-05-29Auto merge of #141739 - GuillaumeGomez:rollup-ivboqwd, r=GuillaumeGomezbors-10/+26
Rollup of 11 pull requests Successful merges: - rust-lang/rust#137574 (Make `std/src/num` mirror `core/src/num`) - rust-lang/rust#141384 (Enable review queue tracking) - rust-lang/rust#141448 (A variety of improvements to the codegen backends) - rust-lang/rust#141636 (avoid some usages of `&mut P<T>` in AST visitors) - rust-lang/rust#141676 (float: Disable `total_cmp` sNaN tests for `f16`) - rust-lang/rust#141705 (Add eslint as part of `tidy` run) - rust-lang/rust#141715 (Add `loongarch64` with `d` feature to `f32::midpoint` fast path) - rust-lang/rust#141723 (Provide secrets to try builds with new bors) - rust-lang/rust#141728 (Fix false documentation of FnCtxt::diverges) - rust-lang/rust#141729 (resolve target-libdir directly from rustc) - rust-lang/rust#141732 (creader: Remove extraenous String::clone) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-29resolve target-libdir directly from rustconur-ozkan-10/+26
Leaving stage0 target-libdir resolution to rustc. This should also fix the issue with hard-coding `$sysroot/lib` which fails on systems that use `$sysroot/lib64` or `$sysroot/lib32`. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-29resolve stage0 sysroot from rustconur-ozkan-1/+3
Instead of manually navigating directories based on stage0 rustc, use `--print sysroot` to get the sysroot directly. This also works when using the bootstrap `rustc` shim. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-29Auto merge of #141595 - bjorn3:rustc_no_sysroot_proc_macro, r=onur-ozkanbors-1/+2
Do not get proc_macro from the sysroot in rustc With the stage0 refactor the proc_macro version found in the sysroot will no longer always match the proc_macro version that proc-macros get compiled with by the rustc executable that uses this proc_macro. This will cause problems as soon as the ABI of the bridge gets changed to implement new features or change the way existing features work. To fix this, this commit changes rustc crates to depend directly on the local version of proc_macro which will also be used in the sysroot that rustc will build.
2025-05-28Add cfg for FormatShortCmdMu001999-0/+3
2025-05-27Disable libunwind cross-architecture unwindingKhem Raj-2/+1
Building with _LIBUNWIND_IS_NATIVE_ONLY disables code for cross-architecture unwinding it is disabled by default in LLVM [1], replicate the cmake behavior in bootstrap process It also enables some additional code that handles PAC-specific unwind info it helps compiling with the -mbranch-protection=pac or -mbranch-protection=standard flags This fixes build with clang/musl on aarch64 [1] https://github.com/llvm/llvm-project/commit/85624c5de3e831ffa01fdc2d159e3d69c30de08d Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-05-27bootstrap: Remove `bin_root` from `PATH`Vadim Petrochenkov-1/+0
2025-05-27Do not get proc_macro from the sysroot in rustcbjorn3-1/+2
With the stage0 refactor the proc_macro version found in the sysroot will no longer always match the proc_macro version that proc-macros get compiled with by the rustc executable that uses this proc_macro. This will cause problems as soon as the ABI of the bridge gets changed to implement new features or change the way existing features work. To fix this, this commit changes rustc crates to depend directly on the local version of proc_macro which will also be used in the sysroot that rustc will build.
2025-05-27distcheck: document what distcheck is intended to exerciseJieyou Xu-1/+8
2025-05-27Rollup merge of #141568 - onur-ozkan:141393-fix, r=KobzolMichael Goulet-0/+8
dist: make sure llvm-project submodule is present Zero-config `x install` fails when bootstrap tries to copy files from the LLVM submodule because it's not properly initialized/handled. This diff handles that. Fixes https://github.com/rust-lang/rust/issues/141393
2025-05-27Rollup merge of #141556 - jeremyd2019:patch-1, r=jieyouxuMichael Goulet-1/+3
bootstrap: translate Windows paths in a way that works for both Cygwin and MSYS2 Cygwin defaults to rooting Windows paths in /cygdrive/X, while MSYS2 configures them to be /X. Regardless of configuration, drives are always accessible as /proc/cygdrive/X, so use that. If there are other shells on Windows that are supported and use /X style paths, perhaps something more complicated needs to be done. r? `@jieyouxu` `@Berrysoft` `@mati865`
2025-05-26bootstrap: translate Windows paths in a way that works for both Cygwin and MSYS2Jeremy Drake-1/+3
Cygwin defaults to rooting Windows paths in /cygdrive/X, while MSYS2 configures them to be /X. Regardless of configuration, drives are always accessible as /proc/cygdrive/X, so use that.
2025-05-27Rollup merge of #140898 - onur-ozkan:miri-run, r=Kobzol许杰友 Jieyou Xu (Joe)-3/+13
minor improvements on running miri It should be clear from the commit messages when reviewing them one by one.