From 6cf68e3d633908fcd184ab5210430a9970a829b7 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 20 May 2026 19:52:12 -0400 Subject: [PATCH] Set always_out_of_date on hermes-engine Replace Hermes phase The `[Hermes] Replace Hermes for the right configuration, if needed` script_phase has no declared outputs because it overwrites the prebuilt Hermes binary in place based on `$CONFIGURATION`. Xcode 14+ emits "will be run during every build because it does not specify any outputs" on every clean build of every project on the prebuilt-release tarball path. Set `script_phase[:always_out_of_date] = "1"` guarded by a `Pod::VERSION >= 1.13.0` check. Apple's documented opt-in for "yes, this phase intentionally runs every build." The phase still runs every build. The warning downgrades to a `note`. Matches the existing shape of the two sibling `Replace X for the right configuration` script_phases in the same package: - `React-Core-prebuilt.podspec` (#52133) - `third-party-podspecs/ReactNativeDependencies.podspec` (#49812) Same property previously accepted in #48495 (`088fcb1e5d`) for `React-RCTFBReactNativeSpec.podspec` and the codegen podspecs (later consolidated in #50317). `hermes-engine` is the last `Replace X` phase in the package without it. --- .../sdks/hermes-engine/hermes-engine.podspec | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/react-native/sdks/hermes-engine/hermes-engine.podspec b/packages/react-native/sdks/hermes-engine/hermes-engine.podspec index 6ef12a1f68ae..96c9e53d6fd7 100644 --- a/packages/react-native/sdks/hermes-engine/hermes-engine.podspec +++ b/packages/react-native/sdks/hermes-engine/hermes-engine.podspec @@ -83,7 +83,7 @@ Pod::Spec.new do |spec| # We ignore this if we provide a specific tarball: the assumption here is that if you are providing a tarball, is because you want to # test something specific for that tarball. if source_type == HermesEngineSourceType::DOWNLOAD_PREBUILD_RELEASE_TARBALL - spec.script_phase = { + script_phase = { :name => "[Hermes] Replace Hermes for the right configuration, if needed", :execution_position => :before_compile, :script => <<-EOS @@ -97,6 +97,15 @@ Pod::Spec.new do |spec| "$NODE_BINARY" "$REACT_NATIVE_PATH/sdks/hermes-engine/utils/replace_hermes_version.js" -c "$CONFIG" -r "#{version}" -p "$PODS_ROOT" EOS } + + + # :always_out_of_date is only available in CocoaPods 1.13.0 and later + if Gem::Version.new(Pod::VERSION) >= Gem::Version.new('1.13.0') + # always run the script without warning + script_phase[:always_out_of_date] = "1" + end + + spec.script_phase = script_phase end elsif HermesEngineSourceType::isFromSource(source_type) then