about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2025-06-12Move `shared_helpers` test to a dedicated moduleJakub Beránek-8/+3
2025-06-12Add support for snapshot tests with instaJakub Beránek-0/+43
2025-06-12Rename tool-config to tool and add docsStypox-15/+17
2025-06-12Rollup merge of #142303 - Kobzol:bootstrap-cleanup-1, r=jieyouxuMatthias Krüger-215/+243
Assorted bootstrap cleanups (step 1) Now that the stage0 redesign has landed, we can finally start cleaning up many things in bootstrap, and lord knows it deserves it! I plan to send many PRs once I figure out an incremental way forward, this is the first one of them. It doesn't actually change anything, just renames stuff and adds more documentation, but the rename is bitrotty, so I wanted to push the PR eagerly. r? `@jieyouxu`
2025-06-11Rollup merge of #142374 - Kobzol:fix-newline, r=tmiaskoMatthias Krüger-1/+2
Fix missing newline trim in bootstrap Fixes [this comment](https://github.com/rust-lang/rust/pull/141909/files#r2140632918). Fixes: https://github.com/rust-lang/rust/issues/142350
2025-06-11Rollup merge of #142364 - Kobzol:download-ci-incremental-warning-remove, ↵Matthias Krüger-2/+1
r=RalfJung Do not warn on `rust.incremental` when using download CI rustc Discussed on Zulip. r? `@RalfJung`
2025-06-11Rollup merge of #142346 - ↵Matthias Krüger-0/+2
Shourya742:2025-06-11-add-tracing-import-to-execution-context, r=Kobzol Add tracing import to execution context In https://github.com/rust-lang/rust/pull/141909, we missed adding the trace_cmd import in the execution context module. This PR fixes that. Additionally, we are updating the mingw-check-2 check command to include BOOTSTRAP_TRACING=1 to help ensure we don't miss such cases in future PRs. r? `@Kobzol`
2025-06-11Add bootstrap option to compile a tool with featuresStypox-2/+34
2025-06-11Auto merge of #142358 - matthiaskrgr:rollup-fxe6m7k, r=matthiaskrgrbors-1/+1
Rollup of 9 pull requests Successful merges: - rust-lang/rust#141967 (Configure bootstrap backport nominations through triagebot) - rust-lang/rust#142042 (Make E0621 missing lifetime suggestion verbose) - rust-lang/rust#142272 (tests: Change ABIs in tests to more future-resilient ones) - rust-lang/rust#142282 (Only run `citool` tests on the `auto` branch) - rust-lang/rust#142297 (Implement `//@ needs-target-std` compiletest directive) - rust-lang/rust#142298 (Make loongarch-none target maintainers more easily pingable) - rust-lang/rust#142306 (Dont unwrap and re-wrap typing envs) - rust-lang/rust#142324 (Remove unneeded `FunctionCx` from some codegen methods) - rust-lang/rust#142328 (feat: Add `bit_width` for unsigned integer types) Failed merges: - rust-lang/rust#141639 (Expose discriminant values in stable_mir) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-11Fix missing newline trim in bootstrapJakub Beránek-1/+2
2025-06-11Do not warn on `rust.incremental` when using download CI rustcJakub Beránek-2/+1
2025-06-11Rollup merge of #142297 - jieyouxu:needs-target-std, r=KobzolMatthias Krüger-1/+1
Implement `//@ needs-target-std` compiletest directive Closes rust-lang/rust#141863. Needed to unblock rust-lang/rust#139244 and rust-lang/rust#141856. ### Summary This PR implements a `//@ needs-target-std` compiletest directive that gates test execution based on whether the target supports std or not. For some cases, this should be preferred over e.g. some combination of `//@ ignore-none`, `//@ ignore-nvptx` and more[^none-limit]. ### Implementation limitation Unfortunately, since there is currently [no reliable way to determine from metadata whether a given target supports std or not](https://github.com/rust-lang/rust/issues/142296), we have to resort to a hack. Bootstrap currently determines whether or not a target supports std by a naive target tuple substring comparison: a target supports std if its target tuple does *not* contain one of `["-none", "nvptx", "switch"]` substrings. This PR simply pulls that hack out into `build_helpers` to avoid reimplementing the same hack in compiletest, and uses that logic to inform `//@ needs-target-std`. ### Auxiliary changes This PR additionally changes a few run-make tests to use `//@ needs-target-std` over an inconsistent combination of target-based `ignore`s. This should help with rust-lang/rust#139244. --- r? bootstrap [^none-limit]: Notably, `target_os = "none"` is **not** a sufficient condition for "target does not support std"
2025-06-11Revert "add `Cargo.lock` to CI-rustc allowed list for non-CI env"Jakub Beránek-34/+21
This reverts commit c3de813944873940b8e1a7734991f3c9f3f55156.
2025-06-11add trace_cmd import in tracing feature in execution contextbit-aloo-0/+2
2025-06-10Improve documentation of the `Rustc` step and rename `compiler` to ↵Jakub Beránek-41/+57
`build_compiler` in a few places
2025-06-10Rename `build` to `host_target`Jakub Beránek-176/+188
Host is the machine where bootstrap runs, and this field represents the target of the (host) stage0/beta compiler. This is much clearer than `build`, which also conflicts with the `Build` struct, which is stored under the name `build` inside `Builder` (lol).
2025-06-10Rollup merge of #141909 - Shourya742:2025-06-01-add-execution-context, r=KobzolLeón Orell Valerian Liehr-272/+364
Add central execution context to bootstrap This PR continues the effort toward command centralization as outlined in https://github.com/rust-lang/rust/issues/126819. It introduces a centralized execution context through which all commands will be executed. Previously, centralization was limited to build methods; this PR extends it to the `config` module and updates the remaining methods accordingly. Best reviewed commit by commit. r? ``@Kobzol``
2025-06-10Extract target no-std hack to `build_helpers`Jieyou Xu-1/+1
To centralize this hack in one place with a backlink to the issue tracking this hack, as this logic is also needed by compiletest to implement a `//@ needs-target-std` directive.
2025-06-10Pass `jemalloc` feature to Clippy in bootstrapJakub Beránek-2/+15
2025-06-09Don't create .msi installer for gnullvm hostsMateusz Mikuła-1/+2
WIX toolset works only on Windows hosts and we need to boostrap this host.
2025-06-09Initialize the execution context in parse_inner, start using dry run from ↵bit-aloo-28/+29
the execution context, add getters and setters in the config, and update the tests and other relevant areas accordingly.
2025-06-09remove execution context from flag module and correct the command invocation ↵bit-aloo-25/+19
according to suggestions
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