diff --git a/packages/react-native/sdks/hermes-engine/hermes-engine.podspec b/packages/react-native/sdks/hermes-engine/hermes-engine.podspec index bf57138877a973..b563b6102f6877 100644 --- a/packages/react-native/sdks/hermes-engine/hermes-engine.podspec +++ b/packages/react-native/sdks/hermes-engine/hermes-engine.podspec @@ -12,7 +12,8 @@ react_native_path = File.join(__dir__, "..", "..") package = JSON.parse(File.read(File.join(react_native_path, "package.json"))) version = package['version'] -source_type = hermes_source_type(version, react_native_path) +# Temporaily build from source until visionOS supports prebuilt binaries +source_type = HermesEngineSourceType::BUILD_FROM_GITHUB_MAIN # hermes_source_type(version, react_native_path) source = podspec_source(source_type, version, react_native_path) Pod::Spec.new do |spec| @@ -35,7 +36,7 @@ Pod::Spec.new do |spec| } spec.ios.vendored_frameworks = "destroot/Library/Frameworks/ios/hermes.framework" - spec.visionos.vendored_frameworks = "destroot/Library/Frameworks/visionos/hermes.framework" + spec.visionos.vendored_frameworks = "destroot/Library/Frameworks/xros/hermes.framework" spec.osx.vendored_frameworks = "destroot/Library/Frameworks/macosx/hermes.framework" if HermesEngineSourceType::isPrebuilt(source_type) then @@ -133,7 +134,7 @@ Pod::Spec.new do |spec| :name => '[RN] [2] Build Hermes', :input_files => ["#{hermesc_path}/ImportHermesc.cmake"], :output_files => [ - "${PODS_ROOT}/hermes-engine/build/iphonesimulator/API/hermes/hermes.framework/hermes" + "${PODS_ROOT}/hermes-engine/build/xrsimulator/API/hermes/hermes.framework/hermes", ], :script => <<-EOS . "${REACT_NATIVE_PATH}/scripts/xcode/with-environment.sh" diff --git a/packages/react-native/sdks/hermes-engine/hermes-utils.rb b/packages/react-native/sdks/hermes-engine/hermes-utils.rb index 8c2f4f6c665a83..f7c424927843fe 100644 --- a/packages/react-native/sdks/hermes-engine/hermes-utils.rb +++ b/packages/react-native/sdks/hermes-engine/hermes-utils.rb @@ -6,7 +6,7 @@ require 'net/http' require 'rexml/document' -HERMES_GITHUB_URL = "https://github.com/facebook/hermes.git" +HERMES_GITHUB_URL = "https://github.com/okwasniewski/hermes.git" module HermesEngineSourceType LOCAL_PREBUILT_TARBALL = :local_prebuilt_tarball diff --git a/packages/rn-tester/Podfile b/packages/rn-tester/Podfile index 6b0cada920c055..a022f536a276b1 100644 --- a/packages/rn-tester/Podfile +++ b/packages/rn-tester/Podfile @@ -40,7 +40,7 @@ def pods(target_name, options = {}) # Hermes is now enabled by default. # The following line will only disable Hermes if the USE_HERMES envvar is SET to a value other than 1 (e.g. USE_HERMES=0). # TODO: Make hermes work - hermes_enabled = false # !ENV.has_key?('USE_HERMES') || ENV['USE_HERMES'] == '1' + hermes_enabled = !ENV.has_key?('USE_HERMES') || ENV['USE_HERMES'] == '1' puts "Configuring #{target_name} with Fabric #{fabric_enabled ? "enabled" : "disabled"}.#{hermes_enabled ? " Using Hermes engine." : ""}" use_react_native!( diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj index 5ac7883390f36f..f71b13d689ebd4 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj +++ b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj @@ -378,6 +378,7 @@ 68CD48B71D2BCB2C007E06A9 /* Build JS Bundle */, 79E8BE2B119D4C5CCD2F04B3 /* [RN] Copy Hermes Framework */, 5625E703156DD564DE9175B0 /* [CP] Copy Pods Resources */, + FA9D5B1EDCCF1279A1157A2D /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -397,6 +398,7 @@ E7DB209C22B2BA84005AC45F /* Frameworks */, E7DB209D22B2BA84005AC45F /* Resources */, 01934C30687B8C926E4F59CD /* [CP] Copy Pods Resources */, + B3A406D440F7F60A503B9652 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -417,6 +419,7 @@ E7DB215022B2F332005AC45F /* Frameworks */, E7DB215122B2F332005AC45F /* Resources */, E446637427ECD101CAACE52B /* [CP] Copy Pods Resources */, + 9263EBF9AC248C00975C6F74 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -588,6 +591,23 @@ shellPath = /bin/sh; shellScript = ". ../react-native/sdks/hermes-engine/utils/copy-hermes-xcode.sh\n"; }; + 9263EBF9AC248C00975C6F74 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; ABDE2A52ACD1B95E14790B5E /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -610,6 +630,23 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; + B3A406D440F7F60A503B9652 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; B7EB74515CDE78D98087DD53 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -649,6 +686,23 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; + FA9D5B1EDCCF1279A1157A2D /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -901,15 +955,18 @@ OTHER_LDFLAGS = ( "-ObjC", "-lc++", + "-Wl", + "-ld_classic", ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../react-native"; - SDKROOT = iphoneos; - USE_HERMES = false; + SDKROOT = xros; + USE_HERMES = true; WARNING_CFLAGS = ( "-Wextra", "-Wall", "-Wno-semicolon-before-method-body", ); + XROS_DEPLOYMENT_TARGET = 1.0; }; name = Debug; }; @@ -995,16 +1052,19 @@ OTHER_LDFLAGS = ( "-ObjC", "-lc++", + "-Wl", + "-ld_classic", ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../react-native"; - SDKROOT = iphoneos; - USE_HERMES = false; + SDKROOT = xros; + USE_HERMES = true; VALIDATE_PRODUCT = YES; WARNING_CFLAGS = ( "-Wextra", "-Wall", "-Wno-semicolon-before-method-body", ); + XROS_DEPLOYMENT_TARGET = 1.0; }; name = Release; };