From 01760c79ab3fc51ab8b166b3d1a2f4cdac234836 Mon Sep 17 00:00:00 2001 From: zackees Date: Sun, 5 Jul 2026 10:52:59 -0700 Subject: [PATCH] fix(esp32): surface both errors if toolchain AND framework resolve fail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CodeRabbit review on #967: with tokio::join!, checking toolchain_res? before framework_res? dropped the framework/SDK-libs error when both futures failed — often the more actionable failure. Match on both and report both when both fail. Follow-up to #967 / part of #953. Co-Authored-By: Claude Fable 5 --- .../src/esp32/orchestrator/packages.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/crates/fbuild-build/src/esp32/orchestrator/packages.rs b/crates/fbuild-build/src/esp32/orchestrator/packages.rs index 9aabf5ba..d5eda70c 100644 --- a/crates/fbuild-build/src/esp32/orchestrator/packages.rs +++ b/crates/fbuild-build/src/esp32/orchestrator/packages.rs @@ -107,9 +107,19 @@ pub(super) async fn resolve_pioarduino_packages( } Ok::<(), fbuild_core::FbuildError>(()) }; + // Both futures run to completion; surface BOTH errors if both fail so the + // framework/SDK-libs failure (often the more actionable one) isn't dropped + // in favor of the toolchain error (CodeRabbit review on #967). let (toolchain_res, framework_res) = tokio::join!(toolchain_fut, framework_fut); - toolchain_res?; - framework_res?; + match (toolchain_res, framework_res) { + (Err(tc), Err(fw)) => { + return Err(fbuild_core::FbuildError::BuildFailed(format!( + "pioarduino package resolution failed — toolchain: {tc}; framework: {fw}" + ))) + } + (Err(e), _) | (_, Err(e)) => return Err(e), + (Ok(_), Ok(_)) => {} + } Ok((toolchain, framework)) }