From d37a1c51796a3fe755fc139c7e9ff97e4d3f5a6f Mon Sep 17 00:00:00 2001 From: Scott Cao Date: Mon, 12 Jan 2026 15:41:51 -0800 Subject: [PATCH] Make soft_error not fail in OSS when quiet = True Differential Revision: D90535409 --- app/buck2_env/src/soft_error.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/buck2_env/src/soft_error.rs b/app/buck2_env/src/soft_error.rs index 182df4d67de66..3c555dbe90604 100644 --- a/app/buck2_env/src/soft_error.rs +++ b/app/buck2_env/src/soft_error.rs @@ -199,6 +199,8 @@ pub fn handle_soft_error( ALL_SOFT_ERROR_COUNTERS.lock().unwrap().push(count); }); + let quiet = options.quiet; + // We want to limit each error to appearing at most 10 times in a build (no point spamming people) if count.fetch_add(1, Ordering::SeqCst) < 10 { if let Some(handler) = HANDLER.get() { @@ -220,9 +222,10 @@ pub fn handle_soft_error( // @oss-disable: let is_open_source = false; let is_open_source = true; // @oss-enable - if is_open_source { + if is_open_source && !quiet { // We don't log these, and we have no legacy users, and they might not upgrade that often, - // so lets just break open source things immediately. + // so lets just break open source things immediately. We only do this when quiet = False + // because we typically use quiet = True for logging purposes. return Err(err); }