Skip to content

Commit d0bcbf4

Browse files
committed
Make --dry-run more useful when download-rustc is enabled
Previously, it would always treat download-rustc as set to false, which made bootstrap issues with download-rustc hard to debug.
1 parent 4353b1e commit d0bcbf4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/bootstrap/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1813,11 +1813,11 @@ impl Config {
18131813
self.download_rustc_commit().is_some()
18141814
}
18151815

1816-
pub(crate) fn download_rustc_commit(&self) -> Option<&'static str> {
1816+
pub(crate) fn download_rustc_commit(&self) -> Option<&str> {
18171817
static DOWNLOAD_RUSTC: OnceCell<Option<String>> = OnceCell::new();
18181818
if self.dry_run() && DOWNLOAD_RUSTC.get().is_none() {
18191819
// avoid trying to actually download the commit
1820-
return None;
1820+
return self.download_rustc_commit.as_deref();
18211821
}
18221822

18231823
DOWNLOAD_RUSTC

src/bootstrap/download.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,10 @@ impl Config {
402402

403403
fn ci_component_contents(&self, stamp_file: &str) -> Vec<String> {
404404
assert!(self.download_rustc());
405+
if self.dry_run() {
406+
return vec![];
407+
}
408+
405409
let ci_rustc_dir = self.out.join(&*self.build.triple).join("ci-rustc");
406410
let stamp_file = ci_rustc_dir.join(stamp_file);
407411
let contents_file = t!(File::open(&stamp_file), stamp_file.display().to_string());

0 commit comments

Comments
 (0)