Skip to content

Bootstrap regression in 1.71.0 #114338

Open
Open
@lovesegfault

Description

@lovesegfault

If I look at the bins that are part of rustc's tarball in 1.70.0 I see this:

$ tar tvf old-release/rustc-1.70.0-aarch64-unknown-linux-gnu.tar.xz | rg 'rustc/bin/'
-rwxr-xr-x 12569/100       980 2023-07-22 14:15 rustc-1.70.0-aarch64-unknown-linux-gnu/rustc/bin/rust-gdb
-rwxr-xr-x 12569/100      1072 2023-07-22 14:15 rustc-1.70.0-aarch64-unknown-linux-gnu/rustc/bin/rust-lldb
-rwxr-xr-x 12569/100  13517832 2023-07-22 14:15 rustc-1.70.0-aarch64-unknown-linux-gnu/rustc/bin/rustdoc
-rwxr-xr-x 12569/100   2919232 2023-07-22 14:15 rustc-1.70.0-aarch64-unknown-linux-gnu/rustc/bin/rustc
-rwxr-xr-x 12569/100      2164 2023-07-22 14:15 rustc-1.70.0-aarch64-unknown-linux-gnu/rustc/bin/rust-gdbgui

But when I built Rust again in 1.71.0, and inspected the produced artifacts, I see:

$ tar tvf pre-patch/rustc-1.71.0-aarch64-unknown-linux-gnu.tar.xz | rg 'rustc/bin/'
-rwxr-xr-x 22314791/100    980 2023-07-31 20:34 rustc-1.71.0-aarch64-unknown-linux-gnu/rustc/bin/rust-gdb
-rwxr-xr-x 22314791/100   1072 2023-07-31 20:34 rustc-1.71.0-aarch64-unknown-linux-gnu/rustc/bin/rust-lldb
-rwxr-xr-x 22314791/100 13628504 2023-07-31 20:34 rustc-1.71.0-aarch64-unknown-linux-gnu/rustc/bin/rustdoc
-rwxr-xr-x 22314791/100  2919256 2023-07-31 20:34 rustc-1.71.0-aarch64-unknown-linux-gnu/rustc/bin/rustc
-rwxr-xr-x 22314791/100     2164 2023-07-31 20:34 rustc-1.71.0-aarch64-unknown-linux-gnu/rustc/bin/rust-gdbgui
-rwxr-xr-x 22314791/100  12758400 2023-07-31 20:34 rustc-1.71.0-aarch64-unknown-linux-gnu/rustc/bin/clippy-driver
-rwxr-xr-x 22314791/100   5902856 2023-07-31 20:34 rustc-1.71.0-aarch64-unknown-linux-gnu/rustc/bin/cargo-fmt
-rwxr-xr-x 22314791/100   6089640 2023-07-31 20:34 rustc-1.71.0-aarch64-unknown-linux-gnu/rustc/bin/rustfmt
-rwxr-xr-x 22314791/100   1815536 2023-07-31 20:34 rustc-1.71.0-aarch64-unknown-linux-gnu/rustc/bin/cargo-clippy

The difference being that cargo-fmt, rustfmt, cargo-clippy, and clippy-driver are now included.

I tracked this change down to this commit: 6d99d6a, which was a part of #110365 by @ozkanonur.

I validated my claim by applying this patch to Rust's source:

diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
index b3791efaf58..70633f5b41c 100644
--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -790,7 +790,7 @@ fn run(mut $sel, $builder: &Builder<'_>) -> Option<PathBuf> {
                     allow_features: concat!($($allow_features)*),
                 })?;
 
-                if (false $(|| !$add_bins_to_sysroot.is_empty())?) && $sel.compiler.stage > 0 {
+                if false {
                     let bindir = $builder.sysroot($sel.compiler).join("bin");
                     t!(fs::create_dir_all(&bindir));

And upon re-building, inspecting the tarball again:

$ tar tvf post-patch/rustc-1.71.0-x86_64-unknown-linux-gnu.tar.xz | rg 'rustc/bin'
drwxr-xr-x 22314791/100      0 2023-08-01 00:16 rustc-1.71.0-x86_64-unknown-linux-gnu/rustc/bin
-rwxr-xr-x 22314791/100    980 2023-08-01 00:16 rustc-1.71.0-x86_64-unknown-linux-gnu/rustc/bin/rust-gdb
-rwxr-xr-x 22314791/100   1072 2023-08-01 00:16 rustc-1.71.0-x86_64-unknown-linux-gnu/rustc/bin/rust-lldb
-rwxr-xr-x 22314791/100 13462808 2023-08-01 00:16 rustc-1.71.0-x86_64-unknown-linux-gnu/rustc/bin/rustdoc
-rwxr-xr-x 22314791/100  2777920 2023-08-01 00:16 rustc-1.71.0-x86_64-unknown-linux-gnu/rustc/bin/rustc
-rwxr-xr-x 22314791/100     2164 2023-08-01 00:16 rustc-1.71.0-x86_64-unknown-linux-gnu/rustc/bin/rust-gdbgui

I spoke with @jyn514, who said:

ah. hmm. that's likely a real bug. dist::Rustc needs to only package rustc/rustdoc, not blindly copy everything currently in the sysroot

One thing that isn't clear to me is why do the officially produced artifacts served through static.rust-lang.org not suffer from this:

$ curl -sSLN https://static.rust-lang.org/dist/2023-07-13/rustc-1.71.0-x86_64-unknown-linux-gnu.tar.xz | tar tvJ | rg 'rustc/bin/'
-rwxr-xr-x 1000/1000       980 2023-07-12 00:58 rustc-1.71.0-x86_64-unknown-linux-gnu/rustc/bin/rust-gdb
-rwxr-xr-x 1000/1000      1072 2023-07-12 00:58 rustc-1.71.0-x86_64-unknown-linux-gnu/rustc/bin/rust-lldb
-rwxr-xr-x 1000/1000  13481400 2023-07-12 00:58 rustc-1.71.0-x86_64-unknown-linux-gnu/rustc/bin/rustdoc
-rwxr-xr-x 1000/1000   2821488 2023-07-12 00:58 rustc-1.71.0-x86_64-unknown-linux-gnu/rustc/bin/rustc
-rwxr-xr-x 1000/1000      2164 2023-07-12 00:58 rustc-1.71.0-x86_64-unknown-linux-gnu/rustc/bin/rust-gdbgui

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.E-needs-investigationCall for partcipation: This issues needs some investigation to determine current statusT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions