diff --git a/app/buck2_env/src/soft_error.rs b/app/buck2_env/src/soft_error.rs index d929bfa201e08..07158d9538acc 100644 --- a/app/buck2_env/src/soft_error.rs +++ b/app/buck2_env/src/soft_error.rs @@ -274,6 +274,8 @@ pub fn handle_soft_error( options.quiet = false; } + let is_deprecation = options.deprecation; + // 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() { @@ -293,9 +295,9 @@ pub fn handle_soft_error( // @oss-disable: let is_open_source = false; let is_open_source = true; // @oss-enable - if is_open_source { - // 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. + if is_open_source && is_deprecation { + // Deprecation warnings should be hard errors in OSS since there are + // no legacy users that need the grace period. return Err(err); } diff --git a/app/buck2_execute_impl/src/sqlite/incremental_state_db.rs b/app/buck2_execute_impl/src/sqlite/incremental_state_db.rs index 4d669510b6b6d..23741deb414f3 100644 --- a/app/buck2_execute_impl/src/sqlite/incremental_state_db.rs +++ b/app/buck2_execute_impl/src/sqlite/incremental_state_db.rs @@ -71,7 +71,7 @@ impl IncrementalDbState { self.state.insert(key.to_owned(), value.clone().into()); if let Err(e) = db.incremental_state_table().insert(key.to_owned(), value) { - soft_error!( + let _unused = soft_error!( "insert_to_incremental_db", buck2_error::buck2_error!( buck2_error::ErrorTag::Tier0, @@ -79,8 +79,7 @@ impl IncrementalDbState { key, e ), quiet: true - ) - .unwrap(); + ); }; } None => { @@ -95,7 +94,7 @@ impl IncrementalDbState { { // This should be converted into a real error later, marking as a soft error for now as the row not existing // might show up as an error but doesn't actually matter in reality. - soft_error!( + let _unused = soft_error!( "delete_from_incremental_db", buck2_error::buck2_error!( buck2_error::ErrorTag::Tier0, @@ -103,8 +102,7 @@ impl IncrementalDbState { e ), quiet: true - ) - .unwrap(); + ); } self.state.remove(key);