-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Remove check run bootstrap #142499
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
Remove check run bootstrap #142499
Changes from all commits
e11e640
c67f7ae
b5db059
c9eeeb4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1373,12 +1373,13 @@ impl Config { | |
} | ||
|
||
println!("Updating submodule {relative_path}"); | ||
self.check_run( | ||
helpers::git(Some(&self.src)) | ||
.run_always() | ||
.args(["submodule", "-q", "sync"]) | ||
.arg(relative_path), | ||
); | ||
|
||
helpers::git(Some(&self.src)) | ||
.allow_failure() | ||
.run_always() | ||
.args(["submodule", "-q", "sync"]) | ||
.arg(relative_path) | ||
.run(self); | ||
|
||
// Try passing `--progress` to start, then run git again without if that fails. | ||
let update = |progress: bool| { | ||
|
@@ -1407,26 +1408,23 @@ impl Config { | |
git.arg(relative_path); | ||
git | ||
}; | ||
if !self.check_run(&mut update(true)) { | ||
self.check_run(&mut update(false)); | ||
if !update(true).allow_failure().run(self) { | ||
update(false).allow_failure().run(self); | ||
} | ||
|
||
// Save any local changes, but avoid running `git stash pop` if there are none (since it will exit with an error). | ||
// diff-index reports the modifications through the exit status | ||
let has_local_modifications = !self.check_run(submodule_git().allow_failure().args([ | ||
"diff-index", | ||
"--quiet", | ||
"HEAD", | ||
])); | ||
let has_local_modifications = | ||
!submodule_git().allow_failure().args(["diff-index", "--quiet", "HEAD"]).run(self); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same |
||
if has_local_modifications { | ||
self.check_run(submodule_git().args(["stash", "push"])); | ||
submodule_git().allow_failure().args(["stash", "push"]).run(self); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same |
||
} | ||
|
||
self.check_run(submodule_git().args(["reset", "-q", "--hard"])); | ||
self.check_run(submodule_git().args(["clean", "-qdfx"])); | ||
submodule_git().allow_failure().args(["reset", "-q", "--hard"]).run(self); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same |
||
submodule_git().allow_failure().args(["clean", "-qdfx"]).run(self); | ||
|
||
if has_local_modifications { | ||
self.check_run(submodule_git().args(["stash", "pop"])); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same |
||
submodule_git().allow_failure().args(["stash", "pop"]).run(self); | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,8 @@ use xz2::bufread::XzDecoder; | |
|
||
use crate::core::config::BUILDER_CONFIG_FILENAME; | ||
use crate::utils::build_stamp::BuildStamp; | ||
use crate::utils::exec::{BootstrapCommand, command}; | ||
use crate::utils::helpers::{check_run, exe, hex_encode, move_file}; | ||
use crate::utils::exec::command; | ||
use crate::utils::helpers::{exe, hex_encode, move_file}; | ||
use crate::{Config, t}; | ||
|
||
static SHOULD_FIX_BINS_AND_DYLIBS: OnceLock<bool> = OnceLock::new(); | ||
|
@@ -65,17 +65,6 @@ impl Config { | |
tmp | ||
} | ||
|
||
/// Runs a command, printing out nice contextual information if it fails. | ||
/// Returns false if do not execute at all, otherwise returns its | ||
/// `status.success()`. | ||
pub(crate) fn check_run(&self, cmd: &mut BootstrapCommand) -> bool { | ||
if self.dry_run() && !cmd.run_always { | ||
return true; | ||
} | ||
self.verbose(|| println!("running: {cmd:?}")); | ||
check_run(cmd, self.is_verbose()) | ||
} | ||
|
||
/// Whether or not `fix_bin_or_dylib` needs to be run; can only be true | ||
/// on NixOS | ||
fn should_fix_bins_and_dylibs(&self) -> bool { | ||
|
@@ -214,7 +203,7 @@ impl Config { | |
// options should be kept in sync with | ||
// src/bootstrap/src/core/download.rs | ||
// for consistency | ||
let mut curl = command("curl"); | ||
let mut curl = command("curl").allow_failure(); | ||
curl.args([ | ||
// follow redirect | ||
"--location", | ||
|
@@ -255,7 +244,7 @@ impl Config { | |
curl.arg("--retry-all-errors"); | ||
} | ||
curl.arg(url); | ||
if !self.check_run(&mut curl) { | ||
if !curl.run(self) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same |
||
if self.host_target.contains("windows-msvc") { | ||
eprintln!("Fallback to PowerShell"); | ||
for _ in 0..3 { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run_always