Skip to content

bootstrap: Build using download-rustc can modify Cargo.lock for non compiler/ deps, causing rustc to not be downloaded on next build #141986

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
aDotInTheVoid opened this issue Jun 3, 2025 · 5 comments
Labels
A-download-rustc Area: The `rust.download-rustc` build option. C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@aDotInTheVoid
Copy link
Member

aDotInTheVoid commented Jun 3, 2025

EDIT: See #141986 (comment) for the actual problem/reproduction steps

Summary

When using profile = "tools", building rustdoc requires building rustc, instead of using download-rustc to

Command used

./x build ./src/librustdoc/

Expected behaviour

I don't build 300 crates of rustc

Actual behaviour

It builds rustc from source, instead of downloading CI artifacts.

Bootstrap configuration (bootstrap.toml)

profile = "tools"
change-id = "ignore"

[rust]
deny-warnings = false

Operating system

Ubuntu 24.04.1 LTS

HEAD

a124fb3

Additional context

Build Log

gh-aDotInTheVoid@dev-desktop-eu-1:~/rust1$ rm -rf ./build/
gh-aDotInTheVoid@dev-desktop-eu-1:~/rust1$ ./x build ./src/librustdoc/
downloading https://static.rust-lang.org/dist/2025-05-26/rust-std-beta-aarch64-unknown-linux-gnu.tar.xz
##################################################################################################################################################### 100.0%
downloading https://static.rust-lang.org/dist/2025-05-26/rustc-beta-aarch64-unknown-linux-gnu.tar.xz
##################################################################################################################################################### 100.0%
downloading https://static.rust-lang.org/dist/2025-05-26/cargo-beta-aarch64-unknown-linux-gnu.tar.xz
##################################################################################################################################################### 100.0%
extracting /home/gh-aDotInTheVoid/rust1/build/cache/2025-05-26/rust-std-beta-aarch64-unknown-linux-gnu.tar.xz
extracting /home/gh-aDotInTheVoid/rust1/build/cache/2025-05-26/rustc-beta-aarch64-unknown-linux-gnu.tar.xz
extracting /home/gh-aDotInTheVoid/rust1/build/cache/2025-05-26/cargo-beta-aarch64-unknown-linux-gnu.tar.xz
Building bootstrap
   Compiling proc-macro2 v1.0.89
   Compiling libc v0.2.172
   Compiling unicode-ident v1.0.13
   Compiling memchr v2.7.4
   Compiling typenum v1.17.0
   Compiling version_check v0.9.5
   Compiling shlex v1.3.0
   Compiling crossbeam-utils v0.8.20
   Compiling serde v1.0.215
   Compiling regex-syntax v0.8.5
   Compiling rustix v1.0.7
   Compiling cfg-if v1.0.0
   Compiling pkg-config v0.3.31
   Compiling bitflags v2.6.0
   Compiling linux-raw-sys v0.9.3
   Compiling clap_lex v0.7.2
   Compiling anstyle v1.0.10
   Compiling heck v0.5.0
   Compiling same-file v1.0.6
   Compiling semver v1.0.23
   Compiling serde_json v1.0.132
   Compiling log v0.4.22
   Compiling bootstrap v0.0.0 (/home/gh-aDotInTheVoid/rust1/src/bootstrap)
   Compiling ryu v1.0.18
   Compiling itoa v1.0.11
   Compiling termcolor v1.4.1
   Compiling home v0.5.9
   Compiling walkdir v2.5.0
   Compiling cc v1.2.23
   Compiling clap_builder v4.5.20
   Compiling generic-array v0.14.7
   Compiling aho-corasick v1.1.3
   Compiling object v0.36.5
   Compiling crossbeam-epoch v0.9.18
   Compiling quote v1.0.37
   Compiling crossbeam-deque v0.8.5
   Compiling syn v2.0.87
   Compiling cmake v0.1.54
   Compiling filetime v0.2.25
   Compiling cpufeatures v0.2.15
   Compiling lzma-sys v0.1.20
   Compiling regex-automata v0.4.9
   Compiling crypto-common v0.1.6
   Compiling block-buffer v0.10.4
   Compiling digest v0.10.7
   Compiling sha2 v0.10.8
   Compiling xattr v1.5.0
   Compiling fd-lock v4.0.4
   Compiling tar v0.4.43
   Compiling toml v0.5.11
   Compiling clap_derive v4.5.18
   Compiling serde_derive v1.0.215
   Compiling bstr v1.10.0
   Compiling globset v0.4.15
   Compiling opener v0.5.2
   Compiling ignore v0.4.23
   Compiling clap v4.5.20
   Compiling clap_complete v4.5.37
   Compiling xz2 v0.1.7
   Compiling build_helper v0.1.0 (/home/gh-aDotInTheVoid/rust1/src/build_helper)
    Finished `dev` profile [unoptimized] target(s) in 22.26s
downloading https://static.rust-lang.org/dist/2025-05-27/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.xz
##################################################################################################################################################### 100.0%
extracting /home/gh-aDotInTheVoid/rust1/build/cache/2025-05-27/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.xz to /home/gh-aDotInTheVoid/rust1/build/aarch64-unknown-linux-gnu/rustfmt
downloading https://static.rust-lang.org/dist/2025-05-27/rustc-nightly-aarch64-unknown-linux-gnu.tar.xz
##################################################################################################################################################### 100.0%
extracting /home/gh-aDotInTheVoid/rust1/build/cache/2025-05-27/rustc-nightly-aarch64-unknown-linux-gnu.tar.xz to /home/gh-aDotInTheVoid/rust1/build/aarch64-unknown-linux-gnu/rustfmt
downloading https://ci-artifacts.rust-lang.org/rustc-builds/ae3b909a323aa771db8ee3919c1454b77db05fbf/rust-dev-nightly-aarch64-unknown-linux-gnu.tar.xz
##################################################################################################################################################### 100.0%
extracting /home/gh-aDotInTheVoid/rust1/build/cache/llvm-ae3b909a323aa771db8ee3919c1454b77db05fbf-false/rust-dev-nightly-aarch64-unknown-linux-gnu.tar.xz to /home/gh-aDotInTheVoid/rust1/build/aarch64-unknown-linux-gnu/ci-llvm
/home/gh-aDotInTheVoid/rust1/build/aarch64-unknown-linux-gnu/ci-llvm/bin/llvm-strip does not exist; skipping copy
Building compiler artifacts (stage0 -> stage1, aarch64-unknown-linux-gnu)
   Compiling proc-macro2 v1.0.95
   Compiling unicode-ident v1.0.18
   Compiling cfg-if v1.0.0
   Compiling libc v0.2.172
   Compiling memchr v2.7.4
   Compiling shlex v1.3.0
   Compiling stable_deref_trait v1.2.0
   Compiling bitflags v2.9.0
   Compiling smallvec v1.15.0
   Compiling once_cell v1.21.3
   Compiling equivalent v1.0.2
   Compiling autocfg v1.4.0
   Compiling foldhash v0.1.5
   Compiling allocator-api2 v0.2.21
   Compiling getrandom v0.3.3
   Compiling parking_lot_core v0.9.10
   Compiling typenum v1.18.0
   Compiling version_check v0.9.5
   Compiling scopeguard v1.2.0
   Compiling log v0.4.27
   Compiling rustc-hash v1.1.0
   Compiling pin-project-lite v0.2.16
   Compiling crossbeam-utils v0.8.21
   Compiling rustix v1.0.7
   Compiling zerocopy v0.8.25
   Compiling rustc-stable-hash v0.1.2
   Compiling linux-raw-sys v0.9.4
   Compiling rustc_macros v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_macros)
   Compiling proc-macro-hack v0.5.20+deprecated
   Compiling fastrand v2.3.0
   Compiling thin-vec v0.2.14
   Compiling arrayvec v0.7.6
   Compiling either v1.15.0
   Compiling rustc-hash v2.1.1
   Compiling elsa v1.11.2
   Compiling rustc_graphviz v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_graphviz)
   Compiling arrayref v0.3.9
   Compiling cc v1.2.16
   Compiling itoa v1.0.15
   Compiling constant_time_eq v0.3.1
   Compiling tracing-core v0.1.30
   Compiling rustc_hashes v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_hashes)
   Compiling unicode-width v0.2.0
   Compiling scoped-tls v1.0.1
   Compiling rustc_arena v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_arena)
   Compiling thiserror v2.0.12
   Compiling serde v1.0.219
   Compiling adler2 v2.0.0
   Compiling ena v0.14.3
   Compiling wasmparser v0.222.1
   Compiling static_assertions v1.1.0
   Compiling crc32fast v1.4.2
   Compiling icu_locid_transform_data v1.5.1
   Compiling object v0.36.7
   Compiling litemap v0.7.5
   Compiling miniz_oxide v0.8.8
   Compiling writeable v0.5.5
   Compiling hashbrown v0.15.3
   Compiling generic-array v0.14.7
   Compiling rustc-literal-escaper v0.0.2
   Compiling unicode-properties v0.1.3
   Compiling serde_json v1.0.140
   Compiling unicode-xid v0.2.6
   Compiling icu_list_data v1.5.1
   Compiling lock_api v0.4.12
   Compiling ryu v1.0.20
   Compiling itertools v0.12.1
   Compiling rustc_lexer v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_lexer)
   Compiling regex-automata v0.2.0
   Compiling type-map v0.5.0
   Compiling strsim v0.11.1
   Compiling ident_case v1.0.1
   Compiling fnv v1.0.7
   Compiling odht v0.3.1
   Compiling self_cell v1.2.0
   Compiling anstyle v1.0.10
   Compiling unicode-width v0.1.14
   Compiling quote v1.0.40
   Compiling rustc_error_codes v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_error_codes)
   Compiling termcolor v1.4.1
   Compiling rustc_apfloat v0.2.2+llvm-462a31f5a5ab
   Compiling flate2 v1.1.1
   Compiling datafrog v2.0.1
   Compiling rustc_parse_format v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_parse_format)
   Compiling annotate-snippets v0.11.5
   Compiling syn v2.0.101
   Compiling crossbeam-epoch v0.9.18
   Compiling getopts v0.2.21
   Compiling tinyvec_macros v0.1.1
   Compiling aho-corasick v1.1.3
   Compiling regex-syntax v0.8.5
   Compiling tinyvec v1.9.0
   Compiling rustc_proc_macro v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_proc_macro)
   Compiling unicode-script v0.5.7
   Compiling libloading v0.8.7
   Compiling regex-syntax v0.6.29
   Compiling fallible-iterator v0.3.0
   Compiling indexmap v2.9.0
   Compiling crossbeam-deque v0.8.6
   Compiling polonius-engine v0.13.0
   Compiling punycode v0.4.1
   Compiling rustc-demangle v0.1.24
   Compiling rustc-rayon-core v0.5.1
   Compiling lazy_static v1.5.0
   Compiling pulldown-cmark v0.11.3
   Compiling leb128 v0.2.5
   Compiling cfg_aliases v0.2.1
   Compiling overload v0.1.1
   Compiling nix v0.30.1
   Compiling block-buffer v0.10.4
   Compiling crypto-common v0.1.6
   Compiling wasm-encoder v0.219.2
   Compiling nu-ansi-term v0.46.0
   Compiling sharded-slab v0.1.7
   Compiling digest v0.10.7
   Compiling thread_local v1.1.8
   Compiling unicase v2.8.1
   Compiling pulldown-cmark-escape v0.11.0
   Compiling pathdiff v0.2.3
   Compiling tracing-log v0.2.0
   Compiling unicode-normalization v0.1.24
   Compiling nu-ansi-term v0.50.1
   Compiling jiff v0.2.13
   Compiling psm v0.1.26
   Compiling stacker v0.1.21
   Compiling blake3 v1.8.2
   Compiling rustc_llvm v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_llvm)
   Compiling md-5 v0.10.6
   Compiling rustc-main v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc)
   Compiling rustc_serialize v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_serialize)
   Compiling ppv-lite86 v0.2.21
   Compiling tempfile v3.20.0
   Compiling memmap2 v0.2.3
   Compiling jobserver v0.1.33
   Compiling parking_lot v0.12.3
   Compiling cpufeatures v0.2.17
   Compiling getrandom v0.2.16
   Compiling rand_core v0.9.3
   Compiling termize v0.1.1
   Compiling sha2 v0.10.9
   Compiling sha1 v0.10.6
   Compiling rand_core v0.6.4
   Compiling rustc_fs_util v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_fs_util)
   Compiling unicode-security v0.1.2
   Compiling gimli v0.31.1
   Compiling measureme v12.0.1
   Compiling rand_chacha v0.9.0
   Compiling rand_xoshiro v0.7.0
   Compiling rand_chacha v0.3.1
   Compiling rand v0.9.1
   Compiling rand v0.8.5
   Compiling regex-automata v0.4.9
   Compiling regex-automata v0.1.10
   Compiling twox-hash v1.6.3
   Compiling synstructure v0.13.2
   Compiling darling_core v0.20.11
   Compiling ruzstd v0.7.3
   Compiling matchers v0.1.0
   Compiling ctrlc v3.4.7
   Compiling displaydoc v0.2.5
   Compiling tracing-attributes v0.1.28
   Compiling rustc_index_macros v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_index_macros)
   Compiling derive-where v1.4.0
   Compiling zerofrom-derive v0.1.6
   Compiling yoke-derive v0.7.5
   Compiling zerovec-derive v0.10.3
   Compiling thiserror-impl v2.0.12
   Compiling serde_derive v1.0.219
   Compiling icu_provider_macros v1.5.0
   Compiling rustc_type_ir_macros v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_type_ir_macros)
   Compiling tinystr v0.8.1
   Compiling unic-langid-impl v0.9.6
   Compiling regex v1.11.1
   Compiling bstr v1.12.0
   Compiling zerofrom v0.1.6
   Compiling unic-langid-macros-impl v0.9.6
   Compiling tracing v0.1.37
   Compiling yoke v0.7.5
   Compiling darling_macro v0.20.11
   Compiling fluent-syntax v0.12.0
   Compiling zerovec v0.10.4
   Compiling tracing-subscriber v0.3.18
   Compiling unic-langid-macros v0.9.6
   Compiling unic-langid v0.9.6
   Compiling fluent-langneg v0.13.0
   Compiling intl_pluralrules v7.0.2
   Compiling intl-memoizer v0.5.3
   Compiling darling v0.20.11
   Compiling derive_setters v0.1.7
   Compiling fluent-bundle v0.16.0
   Compiling tinystr v0.7.6
   Compiling icu_locid v1.5.0
   Compiling rustc_index v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_index)
   Compiling rustc_fluent_macro v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_fluent_macro)
   Compiling tracing-tree v0.3.1
   Compiling rustc_data_structures v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_data_structures)
   Compiling rustc_log v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_log)
   Compiling icu_provider v1.5.0
   Compiling icu_locid_transform v1.5.0
   Compiling thorin-dwp v0.9.0
   Compiling ar_archive_writer v0.4.2
   Compiling icu_list v1.5.0
   Compiling icu_provider_adapters v1.5.0
   Compiling rustc_span v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_span)
   Compiling rustc_ast_ir v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_ast_ir)
   Compiling rustc_baked_icu_data v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_baked_icu_data)
^C  Building [===================>     ] 274/335: icu_list, rustc_llvm(build), rustc_baked_icu_data, serde, rustc_span
Build completed unsuccessfully in 0:01:16

The lines

extracting /home/gh-aDotInTheVoid/rust1/build/cache/2025-05-27/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.xz to /home/gh-aDotInTheVoid/rust1/build/aarch64-unknown-linux-gnu/rustfmt
downloading https://static.rust-lang.org/dist/2025-05-27/rustc-nightly-aarch64-unknown-linux-gnu.tar.xz
##################################################################################################################################################### 100.0%
extracting /home/gh-aDotInTheVoid/rust1/build/cache/2025-05-27/rustc-nightly-aarch64-unknown-linux-gnu.tar.xz to /home/gh-aDotInTheVoid/rust1/build/aarch64-unknown-linux-gnu/rustfmt

Look sus, as it's says it's extracting to rustfmt twice, but I think that that's unrelated.

@aDotInTheVoid aDotInTheVoid added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. labels Jun 3, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 3, 2025
@onur-ozkan onur-ozkan removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 4, 2025
@onur-ozkan
Copy link
Member

I cannot reproduce this on 792fc2b.

@jieyouxu
Copy link
Member

jieyouxu commented Jun 4, 2025

I have trouble reproducing this as well. (I'm on d9a7393)

Does this repro for you against d9a7393, on the same config?

@jieyouxu jieyouxu added the S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. label Jun 4, 2025
@onur-ozkan
Copy link
Member

I think they some had changes on either bootstrap or compiler tree.

@aDotInTheVoid
Copy link
Member Author

Ok, I've mangaged to figure out why this was happening. I had no changes in bootstrap or compiler, but I had changes in rustdoc's Cargo.toml. That ment really weird things were happening, as this caused Cargo.lock to change, and that was invalidating download rustc, but only after cargo ran, so the first build was fine.

Repro

We start on 61413ae (master at the time of writing), with the same config, and no changes. download-rustc works as expected.

gh-aDotInTheVoid@dev-desktop-eu-1:~/rust1$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
gh-aDotInTheVoid@dev-desktop-eu-1:~/rust1$ git rev-parse HEAD
61413aea937d9663d01b62902535f8d4ec85cc95
gh-aDotInTheVoid@dev-desktop-eu-1:~/rust1$ cat ./bootstrap.toml

profile = "tools"
change-id = "ignore"

[rust]
deny-warnings = false
gh-aDotInTheVoid@dev-desktop-eu-1:~/rust1$ ./x build ./src/librustdoc/
Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.06s
/home/gh-aDotInTheVoid/rust1/build/aarch64-unknown-linux-gnu/ci-llvm/bin/llvm-strip does not exist; skipping copy
Creating a sysroot for stage2 compiler (use `rustup toolchain link 'name' build/host/stage2`)
Build completed successfully in 0:00:01

Then we edit src/librustdoc/Cargo.toml to add a new dependency. We can build rustdoc with this new dependeny, and download-rustc still kicks in.

gh-aDotInTheVoid@dev-desktop-eu-1:~/rust1$ git diff
diff --git a/src/librustdoc/Cargo.toml b/src/librustdoc/Cargo.toml
index bba8e630bcc..df073499b7e 100644
--- a/src/librustdoc/Cargo.toml
+++ b/src/librustdoc/Cargo.toml
@@ -19,6 +19,7 @@ regex = "1"
 rustdoc-json-types = { path = "../rustdoc-json-types" }
 serde_json = "1.0"
 serde = { version = "1.0", features = ["derive"] }
+serde_derive = "1.0"
 smallvec = "1.8.1"
 tempfile = "3"
 tracing = "0.1"
gh-aDotInTheVoid@dev-desktop-eu-1:~/rust1$ ./x build ./src/librustdoc/
Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.09s
/home/gh-aDotInTheVoid/rust1/build/aarch64-unknown-linux-gnu/ci-llvm/bin/llvm-strip does not exist; skipping copy
Creating a sysroot for stage2 compiler (use `rustup toolchain link 'name' build/host/stage2`)
/home/gh-aDotInTheVoid/rust1/build/aarch64-unknown-linux-gnu/ci-llvm/bin/llvm-strip does not exist; skipping copy
Building tool rustdoc_tool_binary (stage1 -> stage2, aarch64-unknown-linux-gnu)
   Compiling rustdoc v0.0.0 (/home/gh-aDotInTheVoid/rust1/src/librustdoc)
   Compiling rustdoc-tool v0.0.0 (/home/gh-aDotInTheVoid/rust1/src/tools/rustdoc)
    Finished `release` profile [optimized] target(s) in 29.65s
Build completed successfully in 0:00:31

However, doing this build has caused cargo to update Cargo.lock, to record the new dependency on serde_derive

gh-aDotInTheVoid@dev-desktop-eu-1:~/rust1$ git diff
diff --git a/Cargo.lock b/Cargo.lock
index 43f5f40925b..60bf2501c06 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4644,6 +4644,7 @@ dependencies = [
  "regex",
  "rustdoc-json-types",
  "serde",
+ "serde_derive",
  "serde_json",
  "sha2",
  "smallvec",
diff --git a/src/librustdoc/Cargo.toml b/src/librustdoc/Cargo.toml
index bba8e630bcc..df073499b7e 100644
--- a/src/librustdoc/Cargo.toml
+++ b/src/librustdoc/Cargo.toml
@@ -19,6 +19,7 @@ regex = "1"
 rustdoc-json-types = { path = "../rustdoc-json-types" }
 serde_json = "1.0"
 serde = { version = "1.0", features = ["derive"] }
+serde_derive = "1.0"
 smallvec = "1.8.1"
 tempfile = "3"
 tracing = "0.1"

So now, when we run the build again, it builds rustc locally, instead of downloading it:

gh-aDotInTheVoid@dev-desktop-eu-1:~/rust1$ ./x build ./src/librustdoc/
Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.06s
/home/gh-aDotInTheVoid/rust1/build/aarch64-unknown-linux-gnu/ci-llvm/bin/llvm-strip does not exist; skipping copy
Building compiler artifacts (stage0 -> stage1, aarch64-unknown-linux-gnu)
   Compiling cc v1.2.16
   Compiling tracing-core v0.1.30
   Compiling libc v0.2.172
   Compiling indexmap v2.9.0
   Compiling crossbeam-utils v0.8.21
   Compiling rustix v1.0.7
   Compiling zerocopy v0.8.25
   Compiling miniz_oxide v0.8.8
   Compiling itertools v0.12.1
   Compiling regex-automata v0.2.0
   Compiling syn v2.0.101
   Compiling generic-array v0.14.7
   Compiling wasmparser v0.222.1
   Compiling rustc_lexer v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_lexer)
   Compiling annotate-snippets v0.11.5
   Compiling aho-corasick v1.1.3
   Compiling regex-syntax v0.8.5
   Compiling rustc_proc_macro v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_proc_macro)
   Compiling regex-syntax v0.6.29
   Compiling rustc-demangle v0.1.24
   Compiling getopts v0.2.21
   Compiling tinyvec v1.9.0
   Compiling thread_local v1.1.8
   Compiling wasm-encoder v0.219.2
   Compiling sharded-slab v0.1.7
   Compiling nix v0.30.1
   Compiling nu-ansi-term v0.46.0
   Compiling pulldown-cmark-escape v0.11.0
   Compiling unicase v2.8.1
   Compiling pathdiff v0.2.3
   Compiling nu-ansi-term v0.50.1
   Compiling jiff v0.2.13
   Compiling rustc-main v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc)
   Compiling rustc_parse_format v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_parse_format)
   Compiling pulldown-cmark v0.11.3
   Compiling tracing-log v0.2.0
   Compiling crossbeam-epoch v0.9.18
   Compiling crypto-common v0.1.6
   Compiling block-buffer v0.10.4
   Compiling flate2 v1.1.1
   Compiling crossbeam-deque v0.8.6
   Compiling digest v0.10.7
   Compiling rustc_serialize v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_serialize)
   Compiling gimli v0.31.1
   Compiling rustc-rayon-core v0.5.1
   Compiling md-5 v0.10.6
   Compiling unicode-normalization v0.1.24
   Compiling psm v0.1.26
   Compiling stacker v0.1.21
   Compiling blake3 v1.8.2
   Compiling getrandom v0.3.3
   Compiling parking_lot_core v0.9.10
   Compiling memmap2 v0.2.3
   Compiling cpufeatures v0.2.17
   Compiling jobserver v0.1.33
   Compiling sha2 v0.10.9
   Compiling tempfile v3.20.0
   Compiling ppv-lite86 v0.2.21
   Compiling parking_lot v0.12.3
   Compiling sha1 v0.10.6
   Compiling getrandom v0.2.16
   Compiling rand_core v0.9.3
   Compiling termize v0.1.1
   Compiling unicode-security v0.1.2
   Compiling rustc_llvm v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_llvm)
   Compiling regex-automata v0.1.10
   Compiling measureme v12.0.1
   Compiling rand_core v0.6.4
   Compiling rand_chacha v0.9.0
   Compiling rand_xoshiro v0.7.0
   Compiling rustc_fs_util v0.0.0 (/home/gh-aDotInTheVoid/rust1/compiler/rustc_fs_util)
   Compiling regex-automata v0.4.9
   Compiling rand_chacha v0.3.1
   Compiling rand v0.9.1
   Compiling rand v0.8.5
   Compiling matchers v0.1.0
   Compiling twox-hash v1.6.3
   Compiling ruzstd v0.7.3
^C  Building [==============>          ] 201/335: nix, jiff, regex-syntax, gimli, regex-syntax, ruzstd, regex-automata, rand_chacha, syn, regex-automat...
Build completed unsuccessfully in 0:00:05

So what's the bug.

I think not using download-rustc if Cargo.lock seems fine, even if it's unfortunate. AFAIKT, bootstrap is checking if Cargo.lock has changed from master, and if not then building with download-rustc if not. But doing that build changes Cargo.lock, thus invalidating the check. I think if download-rustc wants to inspect Cargo.lock to decide if it's clean/dirty, it should probably use --locked.

@aDotInTheVoid aDotInTheVoid changed the title bootstrap: profile = "tools" no longer downloads rustc for rustdoc bootstrap: Build that uses download-rustc can cause Cargo.lock to be modified for non compiler/ deps, causing rustc to not be downloaded on subsequent builds. Jun 4, 2025
@aDotInTheVoid aDotInTheVoid changed the title bootstrap: Build that uses download-rustc can cause Cargo.lock to be modified for non compiler/ deps, causing rustc to not be downloaded on subsequent builds. bootstrap: Build using download-rustc can modify Cargo.lock for non compiler/ deps, causing rustc to not be downloaded on next build Jun 4, 2025
@aDotInTheVoid aDotInTheVoid removed the S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. label Jun 4, 2025
@jyn514
Copy link
Member

jyn514 commented Jun 5, 2025

@rustbot label A-download-rustc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-download-rustc Area: The `rust.download-rustc` build option. C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

5 participants