From f00e8baff6570e065539ccd85ce72b04e8036f75 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Fri, 30 Aug 2024 15:50:07 -0700 Subject: [PATCH] Update InspectorFlags to use NDEBUG flag (#46282) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46282 We intended to enable Fusebox on `main` since https://github.com/facebook/react-native/pull/45469 — this worked when building under Buck, however was not working for builds under Xcode/Android Studio. This is because the `HERMES_ENABLE_DEBUGGER` preprocessor flag is not equivalently defined in these build configurations. This diff genericises these checks to `!defined(NDEBUG)` (i.e. *any debug build*), meaning we are correctly able to evaluate the `ReactNativeFeatureFlags::fuseboxEnabledDebug()` setting. Changelog: [Internal] NOTE: `NDEBUG` should be the as-generic-as-possible choice to select a debug build in both OSS and fbsource. Having `HERMES_ENABLE_DEBUGGER` set remains significant (AFAIK) **within the Hermes codebase** (there are no other references in `jsinspector-modern`). Evaluation of whether the lack of this flag works in OSS continues in T200241280. Reviewed By: hoxyq Differential Revision: D61966685 fbshipit-source-id: d30950172420a0afd6c137dbf014794f3353bb7a --- .../ReactCommon/jsinspector-modern/InspectorFlags.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/react-native/ReactCommon/jsinspector-modern/InspectorFlags.cpp b/packages/react-native/ReactCommon/jsinspector-modern/InspectorFlags.cpp index d71944064e5..f43ff1d4215 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/InspectorFlags.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/InspectorFlags.cpp @@ -39,10 +39,9 @@ const InspectorFlags::Values& InspectorFlags::loadFlagsAndAssertUnchanged() true, #elif defined(REACT_NATIVE_FORCE_DISABLE_FUSEBOX) false, -#elif defined(HERMES_ENABLE_DEBUGGER) && \ - defined(REACT_NATIVE_ENABLE_FUSEBOX_DEBUG) +#elif !defined(NDEBUG) && defined(REACT_NATIVE_ENABLE_FUSEBOX_DEBUG) true, -#elif defined(HERMES_ENABLE_DEBUGGER) +#elif !defined(NDEBUG) ReactNativeFeatureFlags::fuseboxEnabledDebug(), #else ReactNativeFeatureFlags::fuseboxEnabledRelease(),