Skip to content

Conversation

@chrfalch
Copy link
Collaborator

@chrfalch chrfalch commented Jan 27, 2026

Summary

The HERMES_V1_ENABLED compile option was incorrectly scoped inside the else() block, meaning it only applied to Release builds. This caused Debug builds to fail with missing header errors:

fatal error: 'hermes/inspector/RuntimeAdapter.h' file not found

This happens when Expo builds Hermes in release mode but WITH the debugger enabled.

Moved the HERMES_V1_ENABLED compile definition into the centralized target_compile_reactnative_options function in react-native-flags.cmake, eliminating duplicate conditional blocks across 7 CMakeLists.txt files.

This ensures the define is consistently applied to all targets that use
target_compile_reactnative_options when HERMES_V1_ENABLED is set, and makes the codebase easier to maintain.

Files cleaned up:

  • ReactCommon/cmake-utils/react-native-flags.cmake (added centralized logic)
  • ReactCommon/hermes/inspector-modern/CMakeLists.txt
  • ReactCommon/hermes/executor/CMakeLists.txt
  • ReactCommon/react/runtime/CMakeLists.txt
  • ReactCommon/react/runtime/hermes/CMakeLists.txt
  • ReactAndroid/.../hermes/reactexecutor/CMakeLists.txt
  • ReactAndroid/.../runtime/hermes/jni/CMakeLists.txt
  • ReactAndroid/.../runtime/jni/CMakeLists.txt

Changelog:

[ANDROID] [FIXED] - Fixed so that all build types get the HERMES_V1_ENABLED flag

Test Plan:

Build RN Tester with HERMES_V1

…uild types

The HERMES_V1_ENABLED compile option was incorrectly scoped inside the
else() block, meaning it only applied to Release builds. This caused
Debug builds to fail with missing header errors:

  fatal error: 'hermes/inspector/RuntimeAdapter.h' file not found

Move the HERMES_V1_ENABLED conditional outside the Debug/Release if-else
block so the define is applied regardless of build type.

Note: target_compile_options() is additive in CMake, so this correctly
appends to existing options rather than overriding them.
@chrfalch chrfalch requested a review from j-piasecki January 27, 2026 13:19
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 27, 2026
@chrfalch chrfalch requested a review from cortinico January 27, 2026 13:20
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Jan 27, 2026
@meta-codesync
Copy link

meta-codesync bot commented Jan 27, 2026

@cortinico has imported this pull request. If you are a Meta employee, you can view this in D91581367.

Moved the HERMES_V1_ENABLED compile definition into the centralized target_compile_reactnative_options function in react-native-flags.cmake, eliminating duplicate conditional blocks across 7 CMakeLists.txt files.

This ensures the define is consistently applied to all targets that use
target_compile_reactnative_options when HERMES_V1_ENABLED is set, and makes the codebase easier to maintain.

Files cleaned up:
- ReactCommon/cmake-utils/react-native-flags.cmake (added centralized logic)
- ReactCommon/hermes/inspector-modern/CMakeLists.txt
- ReactCommon/hermes/executor/CMakeLists.txt
- ReactCommon/react/runtime/CMakeLists.txt
- ReactCommon/react/runtime/hermes/CMakeLists.txt
- ReactAndroid/.../hermes/reactexecutor/CMakeLists.txt
- ReactAndroid/.../runtime/hermes/jni/CMakeLists.txt
- ReactAndroid/.../runtime/jni/CMakeLists.txt
@github-actions
Copy link

Job Summary for Gradle

Test All :: run_fantom_tests
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
react-native-github :private:react-native-fantom:buildFantomTester 9.0.0 Build Scan not published

@meta-codesync meta-codesync bot closed this in 8d68b11 Jan 27, 2026
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jan 27, 2026
@meta-codesync
Copy link

meta-codesync bot commented Jan 27, 2026

@cortinico merged this pull request in 8d68b11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants