Skip to content

Commit c17da4e

Browse files
okwasniewskifacebook-github-bot
authored andcommitted
fix: minor fixes for hermes scripts (#45841)
Summary: This PR fixes few issues with Hermes scripts: - Set visionOS vendored frameworks - Fail if env variables are not set ## Changelog: [INTERNAL] [FIXED] - Hermes script should fail when no deployment target is set Pull Request resolved: #45841 Test Plan: Try to build Hermes Reviewed By: blakef Differential Revision: D60901886 Pulled By: cipolleschi fbshipit-source-id: b9ff470ac6c07e1bd5abc7410ac0c366d66016c5
1 parent e9e5fb0 commit c17da4e

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

packages/react-native/sdks/hermes-engine/hermes-engine.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Pod::Spec.new do |spec|
3636

3737
spec.ios.vendored_frameworks = "destroot/Library/Frameworks/ios/hermes.framework"
3838
spec.osx.vendored_frameworks = "destroot/Library/Frameworks/macosx/hermes.framework"
39+
spec.visionos.vendored_frameworks = "destroot/Library/Frameworks/xros/hermes.framework"
3940

4041
if HermesEngineSourceType::isPrebuilt(source_type) then
4142

packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,29 @@ function use_env_var_or_ruby_prop {
3131
fi
3232
}
3333

34+
function use_env_var {
35+
if [[ -n "$1" ]]; then
36+
echo "$1"
37+
else
38+
echo "error: Missing $2 environment variable"
39+
exit 1
40+
fi
41+
}
42+
3443
function get_release_version {
3544
use_env_var_or_ruby_prop "${RELEASE_VERSION}" "version"
3645
}
3746

3847
function get_ios_deployment_target {
39-
use_env_var_or_ruby_prop "${IOS_DEPLOYMENT_TARGET}" "deployment_target('ios')"
48+
use_env_var "${IOS_DEPLOYMENT_TARGET}" "IOS_DEPLOYMENT_TARGET"
4049
}
4150

4251
function get_visionos_deployment_target {
43-
use_env_var_or_ruby_prop "${XROS_DEPLOYMENT_TARGET}" "deployment_target('visionos')"
52+
use_env_var "${XROS_DEPLOYMENT_TARGET}" "XROS_DEPLOYMENT_TARGET"
4453
}
4554

4655
function get_mac_deployment_target {
47-
use_env_var_or_ruby_prop "${MAC_DEPLOYMENT_TARGET}" "deployment_target('osx')"
56+
use_env_var "${MAC_DEPLOYMENT_TARGET}" "MAC_DEPLOYMENT_TARGET"
4857
}
4958

5059
# Build host hermes compiler for internal bytecode

packages/react-native/sdks/hermes-engine/utils/build-ios-framework.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ function build_universal_framework {
5959
# this is used to preserve backward compatibility
6060
function create_framework {
6161
if [ ! -d destroot/Library/Frameworks/universal/hermes.xcframework ]; then
62-
ios_deployment_target=$(get_ios_deployment_target)
63-
6462
build_framework "iphoneos"
6563
build_framework "iphonesimulator"
6664
build_framework "catalyst"

0 commit comments

Comments
 (0)