about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2025-06-17add created at to command executionbit-aloo-4/+8
2025-06-17remove new method from command executionbit-aloo-12/+14
2025-06-17remove start_porcess helper methodbit-aloo-29/+0
2025-06-17move from start process to new start and wait for output api'sbit-aloo-18/+23
2025-06-17add start methods in execbit-aloo-3/+18
2025-06-17add deferred command in execution context and update run methodbit-aloo-46/+91
2025-06-17Auto merge of #137944 - davidtwco:sized-hierarchy, r=oli-obkbors-2/+2
Sized Hierarchy: Part I This patch implements the non-const parts of rust-lang/rfcs#3729. It introduces two new traits to the standard library, `MetaSized` and `PointeeSized`. See the RFC for the rationale behind these traits and to discuss whether this change makes sense in the abstract. These traits are unstable (as is their constness), so users cannot refer to them without opting-in to `feature(sized_hierarchy)`. These traits are not behind `cfg`s as this would make implementation unfeasible, there would simply be too many `cfg`s required to add the necessary bounds everywhere. So, like `Sized`, these traits are automatically implemented by the compiler. RFC 3729 describes changes which are necessary to preserve backwards compatibility given the introduction of these traits, which are implemented and as follows: - `?Sized` is rewritten as `MetaSized` - `MetaSized` is added as a default supertrait for all traits w/out an explicit sizedness supertrait already. There are no edition migrations implemented in this, as these are primarily required for the constness parts of the RFC and prior to stabilisation of this (and so will come in follow-up PRs alongside the const parts). All diagnostic output should remain the same (showing `?Sized` even if the compiler sees `MetaSized`) unless the `sized_hierarchy` feature is enabled. Due to the use of unstable extern types in the standard library and rustc, some bounds in both projects have had to be relaxed already - this is unfortunate but unavoidable so that these extern types can continue to be used where they were before. Performing these relaxations in the standard library and rustc are desirable longer-term anyway, but some bounds are not as relaxed as they ideally would be due to the inability to relax `Deref::Target` (this will be investigated separately). It is hoped that this is implemented such that it could be merged and these traits could exist "under the hood" without that being observable to the user (other than in any performance impact this has on the compiler, etc). Some details might leak through due to the standard library relaxations, but this has not been observed in test output. **Notes:** - Any commits starting with "upstream:" can be ignored, as these correspond to other upstream PRs that this is based on which have yet to be merged. - This best reviewed commit-by-commit. I've attempted to make the implementation easy to follow and keep similar changes and test output updates together. - Each commit has a short description describing its purpose. - This patch is large but it's primarily in the test suite. - I've worked on the performance of this patch and a few optimisations are implemented so that the performance impact is neutral-to-minor. - `PointeeSized` is a different name from the RFC just to make it more obvious that it is different from `std::ptr::Pointee` but all the names are yet to be bikeshed anyway. - `@nikomatsakis` has confirmed [that this can proceed as an experiment from the t-lang side](https://rust-lang.zulipchat.com/#narrow/channel/435869-project-goals/topic/SVE.20and.20SME.20on.20AArch64.20.28goals.23270.29/near/506196491) - FCP in https://github.com/rust-lang/rust/pull/137944#issuecomment-2912207485 Fixes rust-lang/rust#79409. r? `@ghost` (I'll discuss this with relevant teams to find a reviewer)
2025-06-17Add `StepMetadata` to describe stepsJakub Beránek-45/+83
This is used to replace the previous downcasting of executed steps, which wasn't very scalable. In addition to tests, we could also use the metadata e.g. for tracing.
2025-06-17Actually take `--build` into account in bootstrapJakub Beránek-1/+3
I went back 20 *stable* versions of Rust and I couldn't find this flag actually being used. Despite some of our CI workflows actually set this flag (!).
2025-06-16don't unwrap in enzyme builds in case of missing llvm-configManuel Drehwald-13/+14
2025-06-16bootstrap: address lint failuresDavid Wood-2/+2
Unexpected Clippy lint triggering is fixed in upcoming commits but is necessary for `cfg(bootstrap)`.
2025-06-16Rollup merge of #142431 - Kobzol:bootstrap-snapshot-tests, r=jieyouxuJakub Beránek-20/+158
Add initial version of snapshot tests to bootstrap When making any changes to bootstrap (steps), it is very difficult to realize how does it affect various common bootstrap commands, and if everything still works as we expect it to. We are far away from having actual end-to-end tests, but what we could at least do is have a way of testing what steps does bootstrap execute in dry run mode. Now, we already have something like this in `src/bootstrap/src/core/builder/tests.rs`, however that is quite limited, because it only checks executed steps for a specific impl of `Step` and it does not consider step order. Recently, when working on what I thought was one of the simplest possible step untanglings in bootstrap (https://github.com/rust-lang/rust/pull/142357), I ran into errors in tests that were quite hard to debug. Partly also because the current staging test diffs are multiline and use `Debug` output, so it's quite difficult for me to make sense of them. In this PR, I introduce `insta`, which allows writing snapshot tests in a very simple way. With it, I want to allow writing tests that will clearly show us what is going on during bootstrap execution, and then write golden tests for `build/check/test` stage `0/1/2` for compiler/std/tools etc., to make sure that we don't regress something, and also to help with [#t-infra/bootstrap > Proposal to cleanup stages and steps after the redesign](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Proposal.20to.20cleanup.20stages.20and.20steps.20after.20the.20redesign/with/523488806), to help avoid a situation where we would (again) have to make a flurry of staging changes because of unexpected consequences. In the snapshot tests, we currently render the build of rustc, std and LLVM. Currently I render the executed steps using downcasting, which is not super pretty, but it allows us to make the test rendering localized in one place, and it's IMO enough for now. I implemented only a single test using the new machinery. Maybe if you take a look at it, you will understand why :laughing: Bootstrap currently does some peculiar things, such as running a stage 0 std step (even though stage 0 std no longer exists) and running the Rustc stage 0 -> 1 step twice, once with a single crates, once with all rustc crates. So I think that even with this single step, there will be a bunch of things to fix in the near future... The way we currently prepare the Config test fixtures is far from ideal, this is something I think ``@Shourya742`` could work on as a part of their GSoC project (remove as much command execution from Config construction as possible, actually run bootstrap on a temporary directory instead of running it on the rustc checkout, create a Builder-like API for creating the Config test fixtures). r? ``@jieyouxu``
2025-06-16Rollup merge of #142416 - Kobzol:bootstrap-cleanup-2, r=jieyouxuJakub Beránek-90/+87
Assorted bootstrap cleanups (step 2) Very small improvements designed towards making bootstrap tests less hacky/special, and towards making it possible to run bootstrap tests in parallel. Best reviewed commit by commit. r? ``@jieyouxu``
2025-06-14remove check_run function from helpersbit-aloo-27/+9
2025-06-14remove check_run method from configbit-aloo-13/+2
2025-06-14replace all instances of check_run in download with execution contextbit-aloo-2/+2
2025-06-14replace all instances of check_run in config with execution contextbit-aloo-17/+15
2025-06-13Rollup merge of #142459 - Shourya742:2025-06-11-remove-output-helper, r=KobzolJubilee-36/+29
Remove output helper bootstrap This PR removes output utility helper method. r? `@Kobzol`
2025-06-13remove output from helpersbit-aloo-19/+0
2025-06-13replace output usage in bootstrap/lib.rs with new execution contextbit-aloo-11/+21
2025-06-13replace output usage in sanity with new execution contextbit-aloo-6/+8
2025-06-13Rollup merge of #142379 - Stypox:bootstrap-tool-config, r=KobzolMatthias Krüger-2/+36
Add bootstrap option to compile a tool with features Add an option to specify which features to build a tool with, e.g. it will be useful to build Miri with tracing enabled: ```toml tool-config.miri.features = ["tracing"] ``` See [this Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Passing.20--features.20to.20Miri.20build.20using.20.2E.2Fx.2Epy/with/523564773) for the options considered. If the final decision will be different than what I wrote now, I will update the code as needed. The reason why the option is `tool-config.miri.features` instead of something like `tool-features.miri` is to possibly allow adding more tool-specific configurations in the future. I didn't do any validation of the keys of the `tool-config` hashmap, since I saw that no validation is done on the `tools` hashset either. I don't like much the fact that features can be chosen by various places of the codebase: `Step`s can have some fixed `extra_features`, `prepare_tool_cargo` will add features depending on some bootstrapping options, and the newly added option can also contribute features to tools. However I think it is out of scope of this PR to try to refactor all of that (if it even is refactorable), so I left a comment in the codebase explaining all of the sources of features I could find.
2025-06-12Add lightweight snapshot testing for bootstrap testsJakub Beránek-10/+107
2025-06-12Simplify `configure_with_args`Jakub Beránek-10/+8
2025-06-12Move submodule path cache from `parse_gitmodules` to `Builder`Jakub Beránek-11/+20
It would not be correct if multiple values of `target_dir` were ever passed to the function in the same process.
2025-06-12Remove environment variable modification in `test_default_compiler_wasi`Jakub Beránek-8/+10
2025-06-12Remove `RefCell` from `cc/cxx/ar/ranlib`Jakub Beránek-49/+44
It wasn't really needed there.
2025-06-12Stop using Config for `tempdir-as-a-service` in `build_stamp` testsJakub Beránek-14/+10
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