about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2025-06-09update dry_run value in exec_ctx and start forwarding exec_ctx verbose ↵bit-aloo-13/+5
methods via config
2025-06-09move all commands to new execution contextbit-aloo-174/+20
2025-06-09move all config command invocation to new execution context invocationbit-aloo-23/+32
2025-06-09moved git command to new exec contextbit-aloo-8/+3
2025-06-09move all download.rs method to new execution context command invocationbit-aloo-34/+13
2025-06-09covert uname to new extext methodbit-aloo-14/+8
2025-06-09moved curl to use new execution_contextbit-aloo-8/+10
2025-06-09moved sanity command to exec contextbit-aloo-2/+5
2025-06-09Auto merge of #142242 - matthiaskrgr:rollup-1sgx0ji, r=matthiaskrgrbors-21/+34
Rollup of 7 pull requests Successful merges: - rust-lang/rust#129121 (Stabilize `tcp_quickack`) - rust-lang/rust#142192 (De-duplicate f16 & f128 doctest attributes) - rust-lang/rust#142193 (add tests for pattern binding drop order edge cases) - rust-lang/rust#142222 (Dont make `ObligationCtxt`s with diagnostics unnecessarily) - rust-lang/rust#142228 (rustc-dev-guide subtree update) - rust-lang/rust#142231 (Run `calculate_matrix` job on `master` to cache citool builds) - rust-lang/rust#142232 (add `Cargo.lock` to CI-rustc allowed list for non-CI env) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-09Rollup merge of #142232 - onur-ozkan:141986, r=KobzolMatthias Krüger-21/+34
add `Cargo.lock` to CI-rustc allowed list for non-CI env Changes to dependencies usually require modifying `Cargo.toml`, which would already invalidate the CI-rustc cache if done in non-allowed paths. On non-CI environment, it should be safe to add `Cargo.lock` to the list of allowed paths as there is no real risk aside from a very rare false positive in cases like minor bumps to non-allowed path dependencies without modifying the `Cargo.toml` files. Fixes rust-lang/rust#141986
2025-06-09add `Cargo.lock` to CI-rustc allowed list for non-CI envonur-ozkan-21/+34
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-09Rollup merge of #142160 - Urgau:check-cfg-bootstrap-only-rustc, r=KobzolMatthias Krüger-8/+13
Only allow `bootstrap` cfg in rustc & related Fixes https://github.com/rust-lang/rust/issues/142150 r? bootstrap
2025-06-09Rollup merge of #141751 - jieyouxu:remap, r=KobzolMatthias Krüger-10/+70
Remap compiler vs non-compiler sources differently (bootstrap side) See [#t-compiler/help > Span pointing to wrong file location (&#96;rustc-dev&#96; component)](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/Span.20pointing.20to.20wrong.20file.20location.20.28.60rustc-dev.60.20component.29/with/521087083). The path remapping and unremapping for compiler sources (distributed via `rustc-dev` dist component) is broken because bootstrap currently remaps all sources unconditionally (if remapping is enabled) to the `/rustc/{hash}` form. However, the `rustc-dev` dist component (compiler sources) and `rust-src` dist component (library sources) unpacks differently: - `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`[^note], meaning that the compiler need to unremap them differently. But the same remapping means that the compiler has no way to distinguish between compiler and non-compiler (esp. standard library) sources. To remedy this, this PR adopts the approach of: - remapping compiler sources (corresponding to `rustc-dev` dist component) with `/rustc-dev/{hash}` (this is `RemapScheme::Compiler`), and - remapping non-compiler sources (corresponding to `rust-src` dist component or other non-compiler sources) with `/rustc/{hash}` (this is `RemapScheme::NonCompiler`). A different remapping allows the compiler to reverse the remapping differently. This PR implements the bootstrap side. A follow-up compiler-side change is needed to implement the unremapping change to address the reported issue completely. This PR introduces another env var `CFG_VIRTUAL_RUSTC_DEV_SOURCE_BASE_DIR` that is made available to the compiler when building compiler sources to know what the remap scheme for `rustc-dev` (`RemapScheme::Compiler`) is. Compiler sources are built with the compiler remapping scheme. As far as I know, this change should not introduce new regressions, because the compiler source unremapping (through `rustc-dev`) is already broken. [^note]: (Notice the `src` vs `rustc-src` difference.)
2025-06-08Rollup merge of #142053 - heiher:loong32-none, r=wesleywiserJubilee-0/+3
Add new Tier-3 targets: `loongarch32-unknown-none*` MCP: https://github.com/rust-lang/compiler-team/issues/865 NOTE: LoongArch32 ELF object support is available starting with object v0.37.0.
2025-06-08moved render_tests in utils to new execution contextbit-aloo-2/+1
2025-06-08move git command to new execution contextbit-aloo-19/+39
2025-06-08add execution context to bootstrap workflowbit-aloo-8/+46
2025-06-08Add execution contextbit-aloo-2/+222
2025-06-07Rollup merge of #142116 - jieyouxu:fix-tracing, r=Mark-SimulacrumGuillaume Gomez-4/+0
Fix bootstrap tracing imports
2025-06-07Only allow `bootstrap` cfg in rustc, related and tool-stdUrgau-8/+13
2025-06-07Auto merge of #141917 - petrochenkov:nobinroot, r=jieyouxubors-4/+2
bootstrap: Remove `rustc_snapshot_libdir` from PATH in one more place Same as https://github.com/rust-lang/rust/pull/141657 but in a different part of the build system, with the same goal of addressing [#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). It seems to work on windows-{gnu,msvc} and linux-gnu at least. r? jieyouxu
2025-06-06Auto merge of #141800 - workingjubilee:build-std-with-less-leaf-pointers, ↵bors-1/+2
r=saethlin bootstrap: build std sans leaf frame pointers Sometimes leaf frame-pointers can impact LLVM inlining choices, and that can be a real problem for things like `mul_add`.
2025-06-06bootstrap: fix tracing importsJieyou Xu-4/+0
2025-06-06Auto merge of #141272 - Shourya742:2025-05-18-modularize-config-module, r=Kobzolbors-1986/+2228
modularize the config module bootstrap Currently, our `config` module is quite large over 3,000 lines, and handles a wide range of responsibilities. This PR aims to break it down into smaller, more focused submodules to improve readability and maintainability: * **`toml`**: Introduces a dedicated `toml` submodule within the `config` module. Its sole purpose is to define configuration-related structs along with their corresponding deserialization logic. It also contains the `parse_inner` method, which serves as the central function for extracting relevant information from the TOML structs and constructing the final configuration. * **`rust`, `dist`, `install`, `llvm`, `build`, `gcc`, and others**: Each of these modules contains TOML subsections specific to their domain, along with the logic necessary to convert them into parts of the final configuration struct. * **`config/mod.rs`**: Contains shared types and enums used across multiple TOML subsections. * **`config/config.rs`**: Houses the logic that integrates all the TOML subsections into the complete configuration struct. r? `@kobzol`
2025-06-06Add new Tier-3 targets: `loongarch32-unknown-none*`WANG Rui-0/+3
MCP: https://github.com/rust-lang/compiler-team/issues/865
2025-06-05Auto merge of #142081 - matthiaskrgr:rollup-secpezz, r=matthiaskrgrbors-1/+2
Rollup of 7 pull requests Successful merges: - rust-lang/rust#141709 (jsondocck: Refactor directive handling) - rust-lang/rust#141974 (`tests/ui`: A New Order [4/N]) - rust-lang/rust#141989 (rustdoc-json-type: Depend on `serde` and `serde_derive` seperately) - rust-lang/rust#142015 (Report the actual item that evaluation failed for) - rust-lang/rust#142026 (bootstrap: Fix file permissions when dereferencing symlinks) - rust-lang/rust#142032 (Fix parsing of frontmatters with inner hyphens) - rust-lang/rust#142036 (Update the `compiler-builtins` subtree) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-05Rollup merge of #142026 - smpdt:master, r=KobzolMatthias Krüger-1/+2
bootstrap: Fix file permissions when dereferencing symlinks ## Problem When copying files in the bootstrap process with `dereference_symlinks = true`, we're incorrectly using the symlink's metadata to set permissions on the copied regular file, which results in the following error: ``` Warning: Failed to set file times for "/build/nix-build-rustc-1.86.0.drv-0/rustc-1.86.0-src/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-strip" (permissions: Permissions(FilePermissions { mode: 0o100000 (----------) })) error: Permission denied (os error 13) ``` Verbose Logs confirming the error: ``` TRACE: Found llvm-strip copy operation Source: /n/nix/tech/store/n34yzv2n50p6lbjmx089vjym121wbl4j-llvm-19.1.7/bin/llvm-strip Destination: /build/nix-build-rustc-1.86.0.drv-0/rustc-1.86.0-src/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-strip Source is_symlink (via symlink_metadata): true Source symlink_metadata permissions: 120000 Source symlink_metadata file_type: FileType { is_file: false, is_dir: false, is_symlink: true, .. } Source is symlink pointing to: llvm-objcopy Source raw mode: 120000 Source filetype: 120000 Setting permissions: Permissions(FilePermissions { mode: 0o120000 (l---------) }) Permission mode to set: 120000 Raw permission bits: 120000 File type bits being set: 120000 Permission bits being set: 0 WARNING: Attempting to set symlink file type (120000) on regular file! WARNING: Setting zero permission bits will make file inaccessible! Destination permissions after set_permissions: 100000 ``` ## Solution After canonicalizing a symlink path, fetch the metadata of the target file instead of continuing to use the symlink's metadata. This ensures: - Correct file type detection - Proper permission bits for the target file - Maintains existing behavior for non-symlink cases ## Testing Verified fix resolves permission errors: ``` rustc> llvm-strip: Original metadata mode: 120000, is_symlink: true rustc> llvm-strip: Target metadata mode after fix: 100555 rustc> llvm-strip: Final permissions mode: 100555 ```
2025-06-05correct the imports in flags, tests and downloadbit-aloo-5/+8
2025-06-05Rollup merge of #141970 - onur-ozkan:skip-stage1-std, r=KobzolMatthias Krüger-0/+23
implement new `x` flag: `--skip-std-check-if-no-download-rustc` One of our developers (``@RalfJung)`` [reported](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Surprising.20stages.20for.20check.20build.20after.20stage.20reorg/with/521925606)[#t-infra/bootstrap > Surprising stages for check build after stage reorg](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Surprising.20stages.20for.20check.20build.20after.20stage.20reorg/with/521925606) that working on both the compiler and the library simultaneously with RA enabled is extremely difficult because checking library creates a heavy load on machines (by building stage1 compiler) on each modification. `--skip-std-check-if-no-download-rustc` flag is intended to reduce this heavy load on their IDE integration as much as possible. Fixes: rust-lang/rust#141955
2025-06-05Rollup merge of #141938 - ZuseZ4:offload-updates, r=KobzolMatthias Krüger-6/+9
update rust offload bootstrap r? ``@ghost``
2025-06-04Auto merge of #142002 - onur-ozkan:follow-ups2, r=jieyouxubors-26/+26
redesign stage 0 std follow-ups part2 Fixes three bugs: 1. `x check` fails when run on rustdoc without `download-rustc` enabled. (1st commit) 2. `x check` fails when run on the compiler with `download-rustc` enabled. (2nd commit) 3. `x test library` fails with `download-rustc` enabled. (3rd commit) Fixes rust-lang/rust#142018 (case 1) Fixes https://github.com/rust-lang/rust/issues/141983 (case 3)
2025-06-04bootstrap: Fix file permissions when dereferencing symlinkssmpdt-1/+2
2025-06-04update `skip_std_check_if_no_download_rustc` doc-commentsonur-ozkan-2/+6
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-04remove outdated RUSTC_SYSROOT handling for ci-rustconur-ozkan-10/+0
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-04bootstrap: don't symlink source dir into stage0 sysrootAleksey Kliger-13/+17
In StdLink::run we subsequently recursively copy the initial sysroot lib directory into the stage0-sysroot lib directory. If the initial sysroot is a toolchain that includes the `rust-src` component (in lib/rustlib/src/rust), if we add this symlink, that recursive copy will overwrite the repo sources with the toolchain's sources.
2025-06-04make it possible to request stage 0 std with `Builder::ensure`onur-ozkan-15/+19
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-04run `check::Std` as the final steponur-ozkan-1/+7
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-03update gpu offload build commandManuel Drehwald-6/+9
2025-06-03Auto merge of #141961 - matthiaskrgr:rollup-r09j2sp, r=matthiaskrgrbors-18/+55
Rollup of 8 pull requests Successful merges: - rust-lang/rust#141724 (fix(rust-lang/rust#141141): When expanding `PartialEq`, check equality of scalar types first.) - rust-lang/rust#141833 (`tests/ui`: A New Order [2/N]) - rust-lang/rust#141861 (Switch `x86_64-msvc-{1,2}` back to Windows Server 2025 images) - rust-lang/rust#141914 (redesign stage 0 std follow-ups) - rust-lang/rust#141918 (Deconstruct values in the THIR visitor) - rust-lang/rust#141923 (Update books) - rust-lang/rust#141931 (Deconstruct values in the THIR visitor) - rust-lang/rust#141956 (Remove two trait methods from cg_ssa) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-03add change-entryonur-ozkan-0/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-03bless tidyonur-ozkan-2/+2
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-03implement new `x` flag: `--skip-std-check-if-no-download-rustc`onur-ozkan-0/+14
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-03Auto merge of #136942 - Kobzol:stage0-sccache, r=jieyouxubors-0/+22
Use ccache for stage0 tool builds Now after the stage0 redesign, we can actually start ccaching the build of the compiler itself. We can also cache the bootstrap tools, since these are also built with the stage0 compiler. Stage0 compiler builds are now being cached: https://github.com/rust-lang/rust/actions/runs/15397246267#summary-43321151192 (`..bootstrap::core::build_steps::compile::Rustc 483.10s 40.41s -91.6%`). It's not a gigantic win everywhere, but it should help. It seems to make the Linux jobs ~10 minute faster. It should be especially useful on PR builds after https://github.com/rust-lang/rust/pull/141948. r? `@jieyouxu` try-job: `x86_64-gnu-llvm-19*` try-job: `x86_64-msvc*` try-job: `x86_64-apple*` try-job: `dist-x86_64-linux`
2025-06-03Rollup merge of #141914 - onur-ozkan:follow-ups, r=KobzolMatthias Krüger-18/+55
redesign stage 0 std follow-ups Various follow-ups pointed out on Zulip during post-merge discussions of [redesign stage 0 std #119899](https://github.com/rust-lang/rust/pull/119899). r? `@jieyouxu` Fixes https://github.com/rust-lang/rust/issues/141902. Fixes https://github.com/rust-lang/rust/issues/141905. cc `@jyn514`
2025-06-03use better default stage for `check::Std` when stage isn't explicitonur-ozkan-9/+29
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-03Rollup merge of #141949 - onur-ozkan:move-test-float-parse, r=KobzolMatthias Krüger-7/+7
move `test-float-parse` tool into `src/tools` dir Obviously `test-float-parse` is a tool like any other in `src/tools`. cc `@tgross35`
2025-06-03handle stage0 on `Std::check`onur-ozkan-11/+24
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-03add config.rs with new module structuringbit-aloo-1982/+122
2025-06-03Move all common types, macros and utility method to config/mod.rsbit-aloo-0/+411
2025-06-03move target selection to its separate modulebit-aloo-0/+147