Give a better error message when CI download fails#120098
Give a better error message when CI download fails#120098Teapot4195 wants to merge 1 commit intorust-lang:masterfrom
Conversation
|
(rustbot has picked a reviewer for you, use r? to override) |
|
Not exactly as suggested in the original issue, however based on this zulip discussion it seems like putting it under |
This comment has been minimized.
This comment has been minimized.
b1dcabf to
05dce7c
Compare
61e204f to
0fdf0a4
Compare
src/bootstrap/src/core/download.rs
Outdated
| .map(|c| c as char) | ||
| .collect(); | ||
| let upstream = git::get_rust_lang_rust_remote( | ||
| &GitConfig { git_repository: "rust-lang/rust.git", nightly_branch: "" }, |
There was a problem hiding this comment.
we should use something like self.config.git_config() or similar, not hardcode these values.
src/bootstrap/src/core/download.rs
Outdated
|
|
||
| fn check_outdated(commit: &String) { | ||
| let check_outdated_msg = || { | ||
| if !commit.is_empty() { |
There was a problem hiding this comment.
It seems surprising to do all of the user.name-based work, and then end up not actually looking at any timestamps anyway because commit.is_empty().
There was a problem hiding this comment.
commit.is_empty() is really just a sanity check, it should be very unlikely to hit that branch of the if statement now. Not sure how this should be refactored.
src/bootstrap/src/core/download.rs
Outdated
| "NOTE: origin/master is {} days out of date, CI builds disappear in 168 days.", | ||
| diff / (24 * 60 * 60) | ||
| ); | ||
| eprintln!("HELP: Consider updating your fork of the rust sources"); |
There was a problem hiding this comment.
fork doesn't sound right here. origin/master should be the rust-lang/rust remote, not a fork.
There was a problem hiding this comment.
Original remote is the contributor's fork no? And then usually it would be upstream that is rust-lang/rust.
0fdf0a4 to
7358d65
Compare
|
fixed, did some thinking and it doesn't really make sense to check for commits not by the current user in |
src/bootstrap/src/core/download.rs
Outdated
| .unwrap_or("".to_string()); | ||
| match SystemTime::now().duration_since(SystemTime::UNIX_EPOCH) { | ||
| Ok(n) => { | ||
| let replaced = last_commit.replace("\n", ""); |
There was a problem hiding this comment.
| let replaced = last_commit.replace("\n", ""); | |
| let replaced = last_commit.trim(); |
I suspect this is the actual intent.
7358d65 to
8c8c7cf
Compare
|
@rustbot ready |
src/bootstrap/src/core/download.rs
Outdated
| tempfile: &Path, | ||
| url: &str, | ||
| help_on_error: &str, | ||
| commit: &String, |
There was a problem hiding this comment.
| commit: &String, | |
| commit: &str, |
src/bootstrap/src/core/download.rs
Outdated
| } | ||
|
|
||
| fn download_file(&self, url: &str, dest_path: &Path, help_on_error: &str) { | ||
| fn download_file(&self, url: &str, dest_path: &Path, help_on_error: &str, commit: &String) { |
There was a problem hiding this comment.
| fn download_file(&self, url: &str, dest_path: &Path, help_on_error: &str, commit: &String) { | |
| fn download_file(&self, url: &str, dest_path: &Path, help_on_error: &str, commit: &str) { |
&String should almost never be in any API.
src/bootstrap/src/core/download.rs
Outdated
| } | ||
| } | ||
|
|
||
| fn check_outdated(commit: &String) { |
There was a problem hiding this comment.
| fn check_outdated(commit: &String) { | |
| fn check_outdated(commit: &str) { |
src/bootstrap/src/core/download.rs
Outdated
| Command::new("git") | ||
| .arg("show") | ||
| .arg("-s") | ||
| .arg("--format=%ar") |
There was a problem hiding this comment.
Why author date here. vs commit date above? Can we add comments indicating what the percent codes mean?
src/bootstrap/src/core/download.rs
Outdated
| .unwrap_or("".to_string()); | ||
| if build_date.is_empty() { | ||
| eprintln!( | ||
| "NOTE: tried to download builds for {}, CI builds will be gone in 168 days", |
There was a problem hiding this comment.
| "NOTE: tried to download builds for {}, CI builds will be gone in 168 days", | |
| "NOTE: tried to download builds for {}, CI builds are only retained for 168 days", |
src/bootstrap/src/core/download.rs
Outdated
| ); | ||
| } else { | ||
| eprintln!( | ||
| "NOTE: tried to download builds for {} (from {}), CI builds will be gone in 168 days", |
There was a problem hiding this comment.
| "NOTE: tried to download builds for {} (from {}), CI builds will be gone in 168 days", | |
| "NOTE: tried to download builds for {} (from {}), CI builds are only retained for 168 days", |
| commit, build_date | ||
| ); | ||
| } | ||
| eprintln!("HELP: Consider updating your copy of the rust sources"); |
There was a problem hiding this comment.
This feels like a suggestion we could improve upon, but I guess it's OK for now. It seems like we still have a divergence between rustc components and LLVM components on how we compute the right commit to download, so there's not necessarily single guidance we can give here.
8c8c7cf to
ff84e21
Compare
|
@rustbot ready |
|
☔ The latest upstream changes (presumably #122389) made this pull request unmergeable. Please resolve the merge conflicts. |
ff84e21 to
6a57629
Compare
|
Needed to take a break, but hopefully I understood the changes you wanted to be done. |
This comment has been minimized.
This comment has been minimized.
6a57629 to
c899cbd
Compare
|
☔ The latest upstream changes (presumably #124883) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@Teapot4195 this is still waiting on the review suggestions, if you can update those or mark them as resolved we can move this forward |
|
@Teapot4195 @rustbot label: +S-inactive |
Fixes an issue introduced in 7b5577985df7. Looks like a typo, checked the output from diff and doesn't look like there are any other issues in with the commit.
resolves 118758