Skip to content

Fix RNTester hermesc build issue on iOS#51989

Closed
janicduplessis wants to merge 1 commit into
facebook:mainfrom
janicduplessis:@janic/fix-rntester-hermes-ios
Closed

Fix RNTester hermesc build issue on iOS#51989
janicduplessis wants to merge 1 commit into
facebook:mainfrom
janicduplessis:@janic/fix-rntester-hermes-ios

Conversation

@janicduplessis
Copy link
Copy Markdown
Contributor

Summary:

I am not sure exactly why, but I've been getting this error when running RNTester on iOS, when it tries to build hermesc from source. We're clearing the env using env -i which seems to cause the issue. If I add PATH to the env we set then it builds fine.

++ hermesc_dir_path=/Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/hermes-engine/build_host_hermesc
++ shift
++ jsi_path=/Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/../../react-native/ReactCommon/jsi
+++ xcode-select -p
++ SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
++ env -i SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk /opt/homebrew/bin/cmake -S /Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/hermes-engine -B /Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/hermes-engine/build_host_hermesc -DJSI_DIR=/Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/../../react-native/ReactCommon/jsi
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Command PhaseScriptExecution failed with a nonzero exit code

Changelog:

[INTERNAL] [FIXED] - Fix RNTester hermesc build issue on iOS

Test Plan:

Build RN tester locally

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Jun 12, 2025
Copy link
Copy Markdown
Contributor

@cipolleschi cipolleschi left a comment

Choose a reason for hiding this comment

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

Well spotted! The reason is a Cmake cache issue. Without the path I think it struggles to get the right version of CMake and when you change xcode with xcode-select, the caches might get poisoned.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jun 16, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@cipolleschi merged this pull request in 1da608f.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @janicduplessis in 1da608f

When will my fix make it into a release? | How to file a pick request?

@Kudo Kudo mentioned this pull request Jun 18, 2025
3 tasks
@chrfalch
Copy link
Copy Markdown
Collaborator

@janicduplessis Does this work with cmake 4.x after the fix? It seems like a few of us had the same issue and after downgrading to cmake 3.x it worked.

@janicduplessis
Copy link
Copy Markdown
Contributor Author

Yes I do have cmake 4, this might explain why not everyone has this issue.

@janicduplessis janicduplessis deleted the @janic/fix-rntester-hermes-ios branch June 18, 2025 13:59
gabrieldonadel pushed a commit to expo/react-native that referenced this pull request Jul 1, 2025
Summary:
I am not sure exactly why, but I've been getting this error when running RNTester on iOS, when it tries to build hermesc from source. We're clearing the env using `env -i` which seems to cause the issue. If I add PATH to the env we set then it builds fine.

```
++ hermesc_dir_path=/Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/hermes-engine/build_host_hermesc
++ shift
++ jsi_path=/Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/../../react-native/ReactCommon/jsi
+++ xcode-select -p
++ SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
++ env -i SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk /opt/homebrew/bin/cmake -S /Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/hermes-engine -B /Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/hermes-engine/build_host_hermesc -DJSI_DIR=/Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/../../react-native/ReactCommon/jsi
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Command PhaseScriptExecution failed with a nonzero exit code
```

## Changelog:

[INTERNAL] [FIXED] - Fix RNTester hermesc build issue on iOS

Pull Request resolved: facebook#51989

Test Plan: Build RN tester locally

Reviewed By: cortinico

Differential Revision: D76606335

Pulled By: cipolleschi

fbshipit-source-id: f442b77aefb3afacd6d9fb1f3d515b8d63c526ba
(cherry picked from commit 1da608f)
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. Contributor A React Native contributor. Merged This PR has been merged. 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.

5 participants