Skip to content

Conversation

@matthargett
Copy link
Contributor

Description

fix compile error in ReactNativeHost.mm when Hermes is not being used:
fatal error: 'ReactCommon/RCTHermesInstance.h' file not found

I found this while updating our @rebeckerspecialties/benchmark repository to React Native 0.82 for re-benchmarking Hermes V1 on real-world devices with real-world hot path workloads.

the USE_HERMES preprocessor definition was only being set in GCC_PREPROCESSOR_DEFINITIONS (for C and Objective-C files), but NOT in OTHER_CPLUSPLUSFLAGS (for [Objective] C++) files. this caused ReactNativeHost.mm to NOT received the USE_HERMES=0 flag, making it incorrectly import Hermes symbols that aren't resolved at link time.

Test plan

Integration tested with a local patch-package in
rebeckerspecialties/benchmarking-test-app#69
alongside the fix in facebook/react-native#54421

fix compile error in ReactNativeHost.mm when Hermes is not being used. `fatal error: 'ReactCommon/RCTHermesInstance.h' file not found`

the USE_HERMES preprocessor definition was only being set in GCC_PREPROCESSOR_DEFINITIONS (for C and Objective-C files), but NOT in OTHER_CPLUSPLUSFLAGS (for [Objective] C++) files. this caused  ReactNativeHost.mm to NOT received the USE_HERMES=0 flag, making it incorrectly import Hermes symbols that aren't resolved at link time.
try to avoid a rapid follow up PR for v8, and make things a little more congruent
another conditional compile restoration. verified this works in my local branch of benchmark-test-app with RN 0.82 and @rnc/javascriptcore
Copy link
Member

@tido64 tido64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Can you run yarn change at repo root to add a change log entry?

matthargett and others added 3 commits November 6, 2025 12:22
Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
@matthargett matthargett requested a review from tido64 November 7, 2025 00:05
matthargett and others added 3 commits November 9, 2025 17:54
Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
@tido64
Copy link
Member

tido64 commented Nov 10, 2025

Superseded by #3854

@tido64 tido64 closed this Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants