Skip to content

Commit 64aae29

Browse files
fix: run all preflight:package steps before failing (#48)
* fix: run all preflight:package steps before failing Previously, the first package failure would stop all remaining preflight checks. Now all crates are attempted and the first error is returned after all steps complete. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: collapse nested if to satisfy clippy::collapsible-if Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * ci: trigger CI re-run Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3f8ed52 commit 64aae29

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

xtask/src/main.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,10 @@ fn publish_preflight() -> Result<()> {
426426

427427
fn run_publish_preflight(runner: &mut receipt::Runner) -> Result<()> {
428428
runner.step("preflight:metadata", None, check_crate_metadata)?;
429+
let mut first_err: Option<anyhow::Error> = None;
429430
for name in PUBLISH_CRATES {
430431
let step_name = format!("preflight:package:{name}");
431-
runner.step(&step_name, None, || {
432+
if let Err(e) = runner.step(&step_name, None, || {
432433
let output = Command::new("cargo")
433434
.args(["package", "--no-verify", "-p", name])
434435
.output()
@@ -444,9 +445,15 @@ fn run_publish_preflight(runner: &mut receipt::Runner) -> Result<()> {
444445
return Ok(());
445446
}
446447
bail!("cargo package -p {name} failed:\n{stderr}");
447-
})?;
448+
}) && first_err.is_none()
449+
{
450+
first_err = Some(e);
451+
}
452+
}
453+
match first_err {
454+
Some(e) => Err(e),
455+
None => Ok(()),
448456
}
449-
Ok(())
450457
}
451458

452459
fn check_crate_metadata() -> Result<()> {

0 commit comments

Comments
 (0)