Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bootstrap.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@
# "rust-analyzer",
# "rust-analyzer-proc-macro-srv",
# "analysis",
# "src",
# "rust-src",
# "wasm-component-ld",
# "miri", "cargo-miri" # for dev/nightly channels
#]
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/src/core/build_steps/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,12 @@ impl CommandLineStep for Src {
const IS_HOST: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.path("src")
run.alias("rust-src")

@Mark-Simulacrum Mark-Simulacrum Sep 13, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will break

SKIP_SRC := --skip=src
-- can you fix that up? And look for some other cases of it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it, and fixed the remaining 4 occurrences I could find. I have taken the approach of everywhere src is used, it is intentional that rust-src is included, but given the size of the src directory, this may not always be the case, so if someone with more domain knowledge can take a look that would be great.

@jieyouxu jieyouxu Sep 16, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @Kobzol as well, in case you know of an edge case for this alias.

EDIT: ah, but this is an install alias, which I am much less worried about (as opposed to build/dist aliases).

View changes since the review

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments. I think that @Mark-Simulacrum's comment wasn't correct.

}

fn is_default_step(builder: &Builder<'_>) -> bool {
let config = &builder.config;
config.extended && config.tools.as_ref().is_none_or(|t| t.contains("src"))
config.extended && config.tools.as_ref().is_none_or(|t| t.contains("rust-src"))
}

fn make_run(run: RunConfig<'_>) {
Expand Down
36 changes: 2 additions & 34 deletions src/bootstrap/src/core/builder/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2798,7 +2798,7 @@ mod snapshot {
let ctx = TestCtx::new();
insta::assert_snapshot!(
ctx.config("install")
.path("src")
.path("rust-src")
.args(&[
// Using backslashes fails with `--set`
"--set", &format!("install.prefix={}", ctx.normalized_dir()),
Expand All @@ -2815,36 +2815,7 @@ mod snapshot {
.render_with(RenderConfig {
normalize_host: false
}), @r"
[build] llvm <x86_64-unknown-linux-gnu>
[build] rustc 0 <x86_64-unknown-linux-gnu> -> rustc 1 <x86_64-unknown-linux-gnu>
[build] rustc 1 <x86_64-unknown-linux-gnu> -> std 1 <x86_64-unknown-linux-gnu>
[build] rustc 0 <x86_64-unknown-linux-gnu> -> UnstableBookGen 1 <x86_64-unknown-linux-gnu>
[build] rustc 0 <x86_64-unknown-linux-gnu> -> Rustbook 1 <x86_64-unknown-linux-gnu>
[doc] unstable-book (book) <x86_64-unknown-linux-gnu>
[doc] book (book) <x86_64-unknown-linux-gnu>
[doc] book/first-edition (book) <x86_64-unknown-linux-gnu>
[doc] book/second-edition (book) <x86_64-unknown-linux-gnu>
[doc] book/2018-edition (book) <x86_64-unknown-linux-gnu>
[build] rustdoc 1 <x86_64-unknown-linux-gnu>
[doc] rustc 1 <x86_64-unknown-linux-gnu> -> standalone 2 <x86_64-unknown-linux-gnu>
[doc] rustc 1 <x86_64-unknown-linux-gnu> -> std 1 <x86_64-unknown-linux-gnu> crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,rustc-std-workspace-core,std,std_detect,sysroot,test,unwind]
[build] rustc 1 <x86_64-unknown-linux-gnu> -> rustc 2 <x86_64-unknown-linux-gnu>
[build] rustc 1 <x86_64-unknown-linux-gnu> -> error-index 2 <x86_64-unknown-linux-gnu>
[doc] rustc 1 <x86_64-unknown-linux-gnu> -> error-index 2 <x86_64-unknown-linux-gnu>
[doc] nomicon (book) <x86_64-unknown-linux-gnu>
[doc] rustc 1 <x86_64-unknown-linux-gnu> -> reference (book) 2 <x86_64-unknown-linux-gnu>
[doc] rustdoc (book) <x86_64-unknown-linux-gnu>
[doc] rust-by-example (book) <x86_64-unknown-linux-gnu>
[build] rustc 0 <x86_64-unknown-linux-gnu> -> LintDocs 1 <x86_64-unknown-linux-gnu>
[doc] rustc (book) <x86_64-unknown-linux-gnu>
[doc] cargo (book) <x86_64-unknown-linux-gnu>
[doc] clippy (book) <x86_64-unknown-linux-gnu>
[doc] embedded-book (book) <x86_64-unknown-linux-gnu>
[doc] edition-guide (book) <x86_64-unknown-linux-gnu>
[doc] style-guide (book) <x86_64-unknown-linux-gnu>
[doc] rustc 1 <x86_64-unknown-linux-gnu> -> releases 2 <x86_64-unknown-linux-gnu>
[build] rustc 0 <x86_64-unknown-linux-gnu> -> RustInstaller 1 <x86_64-unknown-linux-gnu>
[dist] docs <x86_64-unknown-linux-gnu>
[dist] src <>
");
}
Expand All @@ -2854,7 +2825,7 @@ mod snapshot {
let ctx = TestCtx::new();
insta::assert_snapshot!(
ctx.config("install")
.path("src")
.path("rust-src")
.args(&[
// Using backslashes fails with `--set`
"--set", &format!("install.prefix={}", ctx.normalized_dir()),
Expand All @@ -2872,10 +2843,7 @@ mod snapshot {
.render_with(RenderConfig {
normalize_host: false
}), @r"
[build] llvm <x86_64-unknown-linux-gnu>
[build] rustc 0 <x86_64-unknown-linux-gnu> -> rustc 1 <x86_64-unknown-linux-gnu>
[build] rustc 0 <x86_64-unknown-linux-gnu> -> RustInstaller 1 <x86_64-unknown-linux-gnu>
[dist] docs <x86_64-unknown-linux-gnu>
[dist] src <>
");
}
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/src/utils/change_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,4 +671,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
severity: ChangeSeverity::Warning,
summary: "The `override-allocator` option has been renamed: The global setting is now `build.allocator` and the per-target setting is `target.<target>.allocator`. It can now be set to 'system' to explicitly request the system allocator.",
},
ChangeInfo {
change_id: 162423,
severity: ChangeSeverity::Warning,
summary: "You should now use `x install rust-src` instead of `x install src` to install the standard library source component. If you want to install it as part of a custom `build.tools` set, include `rust-src` in `build.tools.",
},
];
Loading