bootstrap: Move some shared source files into a new shim_utils crate#159756
bootstrap: Move some shared source files into a new shim_utils crate#159756Zalathar wants to merge 1 commit into
shim_utils crate#159756Conversation
|
The list of allowed third-party dependencies may have been modified! You must ensure that any new dependencies have compatible licenses before merging. cc @davidtwco, @BoxyUwU These commits modify the If this was unintentional then you should revert the changes before this PR is merged. Some changes occurred in src/tools/compiletest cc @jieyouxu |
|
|
No changes to any of the actual lists or logic in |
|
Local benchmarks indicate no measurable change to bootstrap build times: hyperfine --warmup=1 --runs=5 --ignore-failure --prepare="./x clean" "./x run cyclic-step" --show-output |
|
Yes! This tripped me up a few times in the past. |
| //! Code in the `shim_utils` crate can be tested here as part of `./x test bootstrap`. | ||
|
|
||
| use crate::utils::shared_helpers::parse_value_from_args; | ||
| use shim_utils::parse_value_from_args; |
There was a problem hiding this comment.
Doesn't have to be in this PR, but I think that these tests should live directly within shim_utils, and we should create a new default test step for that crate in bootstrap.
Bootstrap's `rustc` and `rustdoc` shims are mostly self-contained, but they do share some code with each other or with other bootstrap tools. Historically that sharing was achieved using `#[path]` attributes pointing to the shared files. That's unusual, making the code harder to navigate, and making dependencies and warnings harder to manage. It also causes problems for rust-analyzer, which currently struggles with source files outside the crate root. This PR therefore takes three such source files, and moves them into a new `shim_utils` crate, which can then be used as a normal crate-path dependency. That new crate is separate from the existing `build_helper` crate, since that crate contains other code that is not of interest to the shims specifically. Former paths of the files that have been moved: - `src/bootstrap/src/utils/proc_macro_deps.rs` - `src/bootstrap/src/utils/shared_helpers.rs` - `src/build_helper/src/arg_file_command.rs`
Bootstrap's
rustcandrustdocshims are mostly self-contained, but they do share some code with each other or with other bootstrap tools.Historically that sharing was achieved using
#[path]attributes pointing to the shared files. That's unusual, making the code harder to navigate, and making dependencies and warnings harder to manage. It also causes problems for rust-analyzer, which currently struggles with source files outside the crate root.This PR therefore takes three such source files, and moves them into a new
shim_utilscrate, which can then be used as a normal crate-path dependency. That new crate is separate from the existingbuild_helpercrate, since that crate contains other code that is not of interest to the shims specifically.Former paths of the files that have been moved:
src/bootstrap/src/utils/proc_macro_deps.rssrc/bootstrap/src/utils/shared_helpers.rssrc/build_helper/src/arg_file_command.rsRelevant PRs that created these shared source files:
dylibandbin_helpersand createshared_helpers::parse_value_from_args#127108r? Kobzol (or bootstrap)