about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorErick Tryzelaar <etryzelaar@google.com>2025-06-07 03:24:35 +0000
committerMark Rousskov <mark.simulacrum@gmail.com>2025-09-27 08:43:22 -0400
commitd42acf522ff234e187aef2de8c6903bc94efe444 (patch)
treeac7047be0a5cf646cfc41961c7e8f7f8931d1478 /src/bootstrap
parentade84871f718ea20a6460d28e82290353b4bf3d2 (diff)
downloadrust-d42acf522ff234e187aef2de8c6903bc94efe444.tar.gz
rust-d42acf522ff234e187aef2de8c6903bc94efe444.zip
Include additional hashes in src/stage0
This patch changes `bump-stage0` to include:

* The sha256 hash of the channel manifest used to create `src/stage0`.
* The rust and rustfmt git commit in `src/stage0`.
* Hashes of all the artifacts, like the source tarball, in `src/stage0`.

Combined this will allow for:

* Projects that bootstrap their own compiler, such as Fuchsia, or users
  of [bootstrap], to build their compilers offline without needing to
  communicate with static.rust-lang.org.

* Auditors to detect if the channel manifest, and all the artifacts
  inside the manifest, were modified after it was used to generate
  `src/stage0`. Furthermore, if they did find modified artifacts, they
  could determine if the Rust Signing Key was compromised by checking if
  any modified file was signed properly.

Finally, it allows regeneration of `src/stage0` when specifying both the
day of the build for rust, and the day of the build for rustfmt, which
can allow a maintainer to regenerate `src/stage0` to verify nothing
changed.

[bootstrap]: https://github.com/dtolnay/bootstrap
[mrustc]: https://github.com/thepowersgang/mrustc
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/src/core/download.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bootstrap/src/core/download.rs b/src/bootstrap/src/core/download.rs
index 37871f0fe1e..a096d116e73 100644
--- a/src/bootstrap/src/core/download.rs
+++ b/src/bootstrap/src/core/download.rs
@@ -506,7 +506,7 @@ pub(crate) fn maybe_download_rustfmt<'a>(
         return Some(PathBuf::new());
     }
 
-    let VersionMetadata { date, version } = dwn_ctx.stage0_metadata.rustfmt.as_ref()?;
+    let VersionMetadata { date, version, .. } = dwn_ctx.stage0_metadata.rustfmt.as_ref()?;
     let channel = format!("{version}-{date}");
 
     let host = dwn_ctx.host_target;