Skip to content

Commit 5dd0f73

Browse files
dmytrorykunfacebook-github-bot
authored andcommitted
Various fixes for Hermes build-from-source behaviour
Summary: Original title: **[RN] Do not encode path to cmake in hermes-engine Pod, build hermesc in prepare_pods** The result of `#{%x(command -v cmake | tr -d '\n')}` was being encoded into the `hermes-engine` Pod. This can lead to conflicts in the CocoaPods cache when `pod install` is run on different machines. Instead of running the command during `pod install`, we defer to the actual build scripts so they can find `cmake` when `$CMAKE_BINARY` is not set. More importantly, this fixes an issue that crept into the Sandcastle CocoaPods offline mirrors, but which would only manifest itself when people run `js1 oss prepare-pods`. RNTester would not build due to RNTesterPods.xcworkspace being configured to use cmake from an arbitrary path instead of using the cmake from $PATH. This does not affect Sandcastle due to `CMAKE_BINARY` getting overriden in Sandcastle. --- **Update** by dmytrorykun: It is impossible to address the problem described in the original title by simply adding `CMAKE_BINARY=${CMAKE_BINARY:-cmake}` to `build-hermes-xcode.sh`. This script is supposed to run from Xcode. Since Xcode doesn't have access to system `PATH` variable, it is unable to locate `cmake`, and build fails. However this diff contains other useful changes: 1. Remove trailing newline in `cmake` path in `build-hermes-xcode.sh`. 2. Fix inverted logic in `copy-hermes-xcode.sh`. 3. Fix typo in `remove xcuserdata` step in Sandcastle. 4. Remove unused `HERMES_DISABLE_HERMESC_BUILD`. Changelog: [iOS] [Fixed] - Various fixes for Hermes build-from-source behaviour. Reviewed By: cipolleschi Differential Revision: D41139384 fbshipit-source-id: 4a4a44a7ac201d279718d84cd02d60b4eaf3956b
1 parent cb7f1b1 commit 5dd0f73

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sdks/hermes-engine/utils/build-hermesc-xcode.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -x
88

99
hermesc_dir_path="$1"
1010

11-
CMAKE_BINARY=${CMAKE_BINARY:-cmake}
11+
CMAKE_BINARY=${CMAKE_BINARY:-$(command -v cmake | tr -d '\n')}
1212

1313
if ! "$CMAKE_BINARY" -S . -B "$hermesc_dir_path"
1414
then

sdks/hermes-engine/utils/copy-hermes-xcode.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -x
88

99
source="${PODS_ROOT}/hermes-engine/destroot/Library/Frameworks/${PLATFORM_NAME}/hermes.framework"
1010

11-
if [[ ! -f "$source" ]]; then
11+
if [[ -f "$source" ]]; then
1212
cp -R "$source" "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes/hermes.framework"
1313
cp -R "$source" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
1414
fi

0 commit comments

Comments
 (0)