From 8284303ec8d670a421745b3f580f184afa892592 Mon Sep 17 00:00:00 2001 From: Michael Anthony Leon Date: Thu, 8 Dec 2022 14:57:29 -0800 Subject: [PATCH] Always include inspector Summary: Changelog: [Android][Changed] - Include the inspector in all build modes, and only turn it off/on at runtime. Reviewed By: jpporto Differential Revision: D40248901 fbshipit-source-id: f13c58f631e4617a6f157df8899e128959af450a --- ReactAndroid/hermes-engine/build.gradle | 1 - ReactCommon/hermes/React-hermes.podspec | 2 +- ReactCommon/hermes/executor/CMakeLists.txt | 1 - .../hermes/executor/HermesExecutorFactory.cpp | 12 ------------ ReactCommon/hermes/inspector/CMakeLists.txt | 1 - 5 files changed, 1 insertion(+), 16 deletions(-) diff --git a/ReactAndroid/hermes-engine/build.gradle b/ReactAndroid/hermes-engine/build.gradle index 4c10ddf56ba819..551c663775c3b5 100644 --- a/ReactAndroid/hermes-engine/build.gradle +++ b/ReactAndroid/hermes-engine/build.gradle @@ -174,7 +174,6 @@ android { release { externalNativeBuild { cmake { - arguments "-DHERMES_ENABLE_DEBUGGER=False" arguments "-DCMAKE_BUILD_TYPE=MinSizeRel" } } diff --git a/ReactCommon/hermes/React-hermes.podspec b/ReactCommon/hermes/React-hermes.podspec index 96bb1d0e152f62..a4e5ac4d6c339b 100644 --- a/ReactCommon/hermes/React-hermes.podspec +++ b/ReactCommon/hermes/React-hermes.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"${PODS_ROOT}/hermes-engine/destroot/include\" \"$(PODS_TARGET_SRCROOT)/..\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/libevent/include\"", "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" - }.merge!(build_type == :debug ? { "GCC_PREPROCESSOR_DEFINITIONS" => "HERMES_ENABLE_DEBUGGER=1" } : {}) + } s.header_dir = "reacthermes" s.dependency "React-cxxreact", version s.dependency "React-jsiexecutor", version diff --git a/ReactCommon/hermes/executor/CMakeLists.txt b/ReactCommon/hermes/executor/CMakeLists.txt index e10d5f2a14f7fa..de74c65daea888 100644 --- a/ReactCommon/hermes/executor/CMakeLists.txt +++ b/ReactCommon/hermes/executor/CMakeLists.txt @@ -19,7 +19,6 @@ target_link_libraries(hermes_executor_common jsireact hermes-engine::libhermes jsi - debug hermes_inspector ) diff --git a/ReactCommon/hermes/executor/HermesExecutorFactory.cpp b/ReactCommon/hermes/executor/HermesExecutorFactory.cpp index 500eac9340a6fb..ef8bcae5932595 100644 --- a/ReactCommon/hermes/executor/HermesExecutorFactory.cpp +++ b/ReactCommon/hermes/executor/HermesExecutorFactory.cpp @@ -14,10 +14,8 @@ #include #include -#ifdef HERMES_ENABLE_DEBUGGER #include #include -#endif #include "JSITracing.h" @@ -35,8 +33,6 @@ std::unique_ptr makeHermesRuntimeSystraced( return hermes::makeHermesRuntime(runtimeConfig); } -#ifdef HERMES_ENABLE_DEBUGGER - class HermesExecutorRuntimeAdapter : public facebook::hermes::inspector::RuntimeAdapter { public: @@ -67,8 +63,6 @@ class HermesExecutorRuntimeAdapter std::shared_ptr thread_; }; -#endif - struct ReentrancyCheck { // This is effectively a very subtle and complex assert, so only // include it in builds which would include asserts. @@ -152,7 +146,6 @@ class DecoratedRuntime : public jsi::WithRuntimeDecorator { const std::string &debuggerName) : jsi::WithRuntimeDecorator(*runtime, reentrancyCheck_), runtime_(std::move(runtime)) { -#ifdef HERMES_ENABLE_DEBUGGER enableDebugger_ = enableDebugger; if (enableDebugger_) { std::shared_ptr rt(runtime_, &hermesRuntime); @@ -161,15 +154,12 @@ class DecoratedRuntime : public jsi::WithRuntimeDecorator { debugToken_ = facebook::hermes::inspector::chrome::enableDebugging( std::move(adapter), debuggerName); } -#endif } ~DecoratedRuntime() { -#ifdef HERMES_ENABLE_DEBUGGER if (enableDebugger_) { facebook::hermes::inspector::chrome::disableDebugging(debugToken_); } -#endif } private: @@ -182,10 +172,8 @@ class DecoratedRuntime : public jsi::WithRuntimeDecorator { std::shared_ptr runtime_; ReentrancyCheck reentrancyCheck_; -#ifdef HERMES_ENABLE_DEBUGGER bool enableDebugger_; facebook::hermes::inspector::chrome::DebugSessionToken debugToken_; -#endif }; } // namespace diff --git a/ReactCommon/hermes/inspector/CMakeLists.txt b/ReactCommon/hermes/inspector/CMakeLists.txt index ceec7dc1e63618..3dc0fba5de232d 100644 --- a/ReactCommon/hermes/inspector/CMakeLists.txt +++ b/ReactCommon/hermes/inspector/CMakeLists.txt @@ -15,7 +15,6 @@ add_library(hermes_inspector target_compile_options( hermes_inspector PRIVATE - -DHERMES_ENABLE_DEBUGGER=1 -DHERMES_INSPECTOR_FOLLY_KLUDGE=1 -std=c++17 -fexceptions