Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
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.
  • Loading branch information
jyn514 committed Jul 9, 2023
commit d0bcbf4979db2014c0668c0016c353cb71978751
4 changes: 2 additions & 2 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1813,11 +1813,11 @@ impl Config {
self.download_rustc_commit().is_some()
}

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

DOWNLOAD_RUSTC
Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@ impl Config {

fn ci_component_contents(&self, stamp_file: &str) -> Vec<String> {
assert!(self.download_rustc());
if self.dry_run() {
return vec![];
}

let ci_rustc_dir = self.out.join(&*self.build.triple).join("ci-rustc");
let stamp_file = ci_rustc_dir.join(stamp_file);
let contents_file = t!(File::open(&stamp_file), stamp_file.display().to_string());
Expand Down