Skip to content

Commit 1da608f

Browse files
janicduplessisfacebook-github-bot
authored andcommitted
Fix RNTester hermesc build issue on iOS (#51989)
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: #51989 Test Plan: Build RN tester locally Reviewed By: cortinico Differential Revision: D76606335 Pulled By: cipolleschi fbshipit-source-id: f442b77aefb3afacd6d9fb1f3d515b8d63c526ba
1 parent 98f5a4e commit 1da608f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

packages/react-native/sdks/hermes-engine/utils/build-hermesc-xcode.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,17 @@ hermesc_dir_path="$1"; shift
1010
jsi_path="$1"
1111

1212
# This script is supposed to be executed from Xcode "run script" phase.
13-
# Xcode sets up its build environment based on the build target (iphone, iphonesimulator, macodsx).
13+
# Xcode sets up its build environment based on the build target (iphone, iphonesimulator, macosx).
1414
# We want to make sure that hermesc is built for mac.
1515
# So we clean the environment with env -i, and explicitly set SDKROOT to macosx
1616
SDKROOT=$(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
17-
env -i SDKROOT="$SDKROOT" "$CMAKE_BINARY" -S "${PODS_ROOT}/hermes-engine" -B "$hermesc_dir_path" -DJSI_DIR="$jsi_path"
18-
env -i SDKROOT="$SDKROOT" "$CMAKE_BINARY" --build "$hermesc_dir_path" --target hermesc -j "$(sysctl -n hw.ncpu)"
17+
18+
env -i \
19+
PATH="$PATH" \
20+
SDKROOT="$SDKROOT" \
21+
"$CMAKE_BINARY" -S "${PODS_ROOT}/hermes-engine" -B "$hermesc_dir_path" -DJSI_DIR="$jsi_path"
22+
23+
env -i \
24+
PATH="$PATH" \
25+
SDKROOT="$SDKROOT" \
26+
"$CMAKE_BINARY" --build "$hermesc_dir_path" --target hermesc -j "$(sysctl -n hw.ncpu)"

0 commit comments

Comments
 (0)