From 0cb52e850a584e47db58d116f5ff52050d4d323a Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Tue, 14 Oct 2025 15:16:06 -0400 Subject: [PATCH] xtask: tolerate curl failure when possible Codex sandbox forbids network access. --- xtask/src/run.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xtask/src/run.rs b/xtask/src/run.rs index 79433217..b52e8890 100644 --- a/xtask/src/run.rs +++ b/xtask/src/run.rs @@ -208,7 +208,7 @@ pub(crate) fn run(opts: Options) -> Result<()> { let etag_path_exists = etag_path.try_exists().with_context(|| { format!("failed to check existence of {}", etag_path.display()) })?; - if !dest_path_exists && etag_path_exists { + if dest_path_exists != etag_path_exists { println!( "cargo:warning=({}).exists()={} != ({})={} (mismatch)", dest_path.display(), @@ -237,7 +237,14 @@ pub(crate) fn run(opts: Options) -> Result<()> { .with_context(|| format!("failed to run {curl:?}"))?; let Output { status, .. } = &output; if status.code() != Some(0) { - bail!("{curl:?} failed: {output:?}") + if dest_path_exists { + println!( + "cargo:warning={curl:?} failed ({status:?}); using cached {}", + dest_path.display() + ); + } else { + bail!("{curl:?} failed: {output:?}") + } } let mut patch = Command::new("patch");