Skip to content

Commit 19af5c8

Browse files
committed
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.
1 parent ef683f7 commit 19af5c8

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Pod::Spec.new do |spec|
8383
# 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
8484
# test something specific for that tarball.
8585
if source_type == HermesEngineSourceType::DOWNLOAD_PREBUILD_RELEASE_TARBALL
86-
spec.script_phase = {
86+
script_phase = {
8787
:name => "[Hermes] Replace Hermes for the right configuration, if needed",
8888
:execution_position => :before_compile,
8989
:script => <<-EOS
@@ -97,6 +97,15 @@ Pod::Spec.new do |spec|
9797
"$NODE_BINARY" "$REACT_NATIVE_PATH/sdks/hermes-engine/utils/replace_hermes_version.js" -c "$CONFIG" -r "#{version}" -p "$PODS_ROOT"
9898
EOS
9999
}
100+
101+
102+
# :always_out_of_date is only available in CocoaPods 1.13.0 and later
103+
if Gem::Version.new(Pod::VERSION) >= Gem::Version.new('1.13.0')
104+
# always run the script without warning
105+
script_phase[:always_out_of_date] = "1"
106+
end
107+
108+
spec.script_phase = script_phase
100109
end
101110

102111
elsif HermesEngineSourceType::isFromSource(source_type) then

0 commit comments

Comments
 (0)