fix(0.83, hermes): resolve hermes from version files instead of merge-base#3011
Open
Saadnajmi wants to merge 10 commits into
Open
fix(0.83, hermes): resolve hermes from version files instead of merge-base#3011Saadnajmi wants to merge 10 commits into
Saadnajmi wants to merge 10 commits into
Conversation
Saadnajmi
commented
Jul 7, 2026
tido64
approved these changes
Jul 7, 2026
Package.swift and ios-prebuild/hermes.js already reference hermesvm.xcframework (the HermesV1 product introduced in RN 0.83), but the Resolve Hermes job still recomposed hermes.xcframework and resolved Hermes commits on the legacy `main` branch. With the upstream build scripts now unconditionally producing hermesvm, this left the SPM build path internally inconsistent. - microsoft-hermes.js: resolve commits on Hermes `static_h` branch; add `hermesV1Tag()` helper that reads sdks/.hermesv1version - resolve-hermes.mts: recompose hermesvm.xcframework / hermesvm.framework - microsoft-resolve-hermes.yml: bump cache key (hermes-v1- -> hermesv1-engine-) so stale V0-shaped caches aren't reused as V1 artifacts Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
HermesV1's static_h CMakeLists requires CMAKE_BUILD_TYPE to be set; the upstream `build_host_hermesc` helper in build-apple-framework.sh doesn't pass it, so the from-source fallback in Resolve Hermes failed at the hermesc step with "Please set CMAKE_BUILD_TYPE". Invoke cmake directly from the workflow with -DCMAKE_BUILD_TYPE=Release (the host compiler is always built Release for perf, matching configure_apple_framework's behavior in Debug builds of the apple frameworks). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
HermesV1 (static_h) replaces the legacy API/hermes/inspector/ headers with API/hermes/cdp/, so the unconditional cp commands in build_apple_framework and prepare_dest_root_for_ci fail with 'No such file or directory' when building from V1 sources. Guard each copy with compgen so the copy is skipped cleanly when the source directory is empty. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Package.swift links against hermesvm.xcframework (HermesV1) but never defines HERMES_V1_ENABLED, so headers like ReactCommon/hermes/inspector-modern/chrome/Registration.h still try to #include <hermes/inspector/RuntimeAdapter.h> — a legacy header V1 dropped. Set HERMES_V1_ENABLED=1 in the shared cxxSettings (alongside USE_HERMES); this matches what cocoapods/utils.rb does when RCT_HERMES_V1_ENABLED=1. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
12bfe36 to
19f6014
Compare
… 0.84 Upstream 0.83-stable defaults to Hermes V0 (sdks/.hermesversion = hermes-v0.14.1); V1 is opt-in via RCT_HERMES_V1_ENABLED and only becomes the default in 0.84 (react#54989, commit bbe02de, not backported to 0.83). The `hermes` -> `hermesvm` product rename, however, already landed in 0.83 (react#53094), so the fork's resolve-hermes.mts genuinely needed to catch up to the new artifact name. Reduce the PR to just that V0-compatible rename catch-up and revert the V1-engine bits to match upstream 0.83: - resolve-hermes.mts: keep hermes.* -> hermesvm.* (needed on 0.83). - Package.swift: drop HERMES_V1_ENABLED define (inherited at 0.84 merge). - microsoft-hermes.js: revert static_h -> main; drop unused hermesV1Tag(). - hermes-utils.rb: revert static_h/main gate back to main (V0). - build-apple-framework.sh: revert inspector-header guard (V0 ships them). - microsoft-resolve-hermes.yml: revert cache-key rename + cmake hermesc change (build_host_hermesc works for V0). Net: 6 files -> 1; the five reverted files now match upstream/0.83-merge. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… coordinate resolve-hermes.mts queried com/facebook/react/react-native-artifacts/<rn-version> for the Hermes tarball, but upstream publishes prebuilt Hermes under com/facebook/hermes/hermes-ios/<HERMES_VERSION> (keyed by the Hermes version, not the react-native version). That coordinate has no Hermes classifier, so the download always 404'd and every 0.83 Resolve Hermes run fell back to an expensive from-source build. Point the download at upstream's real coordinate and read the Hermes version from sdks/hermes-engine/version.properties, mirroring the CocoaPods release_tarball_url: HERMES_VERSION_NAME by default (RN 0.83 ships V0 0.14.0), or HERMES_V1_VERSION_NAME when RCT_HERMES_V1_ENABLED=1. The existing recompose step then merges the standalone macOS slice into the universal xcframework. Verified locally end-to-end: - download-hermes Debug -> hermes-ios/0.14.0 (200), recompose -> hermesvm.xcframework with 8 slices incl. macos-arm64_x86_64 (recomposed=true) - RCT_HERMES_V1_ENABLED=1 -> hermes-ios/250829098.0.2 (200) - V0/V1 x debug/release URLs all resolve 200 on repo1.maven.org Result: 0.83 downloads upstream's prebuilt Hermes (on par with RN 0.83's default V0 engine) and no longer builds Hermes from source, so the from-source V1 machinery is unnecessary on 0.83. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The macOS 'resolve Hermes' from-source fallback resolved a Hermes commit from the merge base with facebook/react-native. Now that upstream pins the Hermes version in sdks/.hermesversion (V0) and sdks/.hermesv1version (V1) — files that travel with the RN source — resolve-commit reads the pinned tag (a valid actions/checkout ref) instead. Retires the merge-base heuristic from this path; the from-source fallback jobs are unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…n files Revert scripts/ios-prebuild/hermes.js fully to upstream (facebook/0.83-stable), removing the fork's [macOS] Hermes machinery: the RN-version mapping, the build-from-hermes-commit source type, and buildFromHermesCommit. This also removes a latent bug where the react-native version was fed into the Hermes Maven coordinate (com/facebook/hermes/hermes-ios/<ver>), which 404s on 0.83. In macOS CI this path is short-circuited anyway (HERMES_VERSION=prebuilt). In sdks/hermes-engine/hermes-utils.rb, restore podspec_source_build_from_github_main to upstream and delete the [macOS] hermes_commit_at_merge_base helper (plus its now-unused open3/json/tmpdir requires). Hermes resolution on 0.83 stays covered: the release tarball (hermes-ios/0.14.0) serves the prebuilt path, and BUILD_FROM_GITHUB_TAG (sdks/.hermesversion / .hermesv1version) serves from-source. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…t-hermes Deletes hermesCommitAtMergeBase() (and its now-unused abort helper and os/path imports) now that Phases 1-2 removed its callers in resolve-hermes.mts and hermes.js. The RN-version resolvers (findMatchingHermesVersion, findVersionAtMergeBase, getLatestStableVersionFromNPM) are retained — they still key the reactnative-dependencies artifact, which legitimately stays react-native-version-keyed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes Hermes resolution for the macOS SPM prebuild on
0.83-mergeand, in doing so, retires the fork-specific Hermes resolution machinery in favor of the version files upstream now ships.Root cause:
resolve-hermes.mtsqueriedcom/facebook/react/react-native-artifacts/<rn-version>for the Hermes tarball. Upstream relocated the Hermes artifact at 0.83 tocom/facebook/hermes/hermes-ios/<hermes-version>— keyed by the Hermes version insdks/hermes-engine/version.properties, decoupled from the RN version in react#53985. The old coordinate 404s at 0.83, so every "Resolve Hermes" run silently fell back to a ~30 min from-source build.What changed
1. Download prebuilt Hermes from upstream's real coordinate
resolve-hermes.mtsreadsversion.properties(HERMES_VERSION_NAMEby default → V00.14.0;HERMES_V1_VERSION_NAMEwhenRCT_HERMES_V1_ENABLED=1) and downloadscom/facebook/hermes/hermes-ios/<version>, mirroring the CocoaPodsrelease_tarball_urlinhermes-utils.rb. The existing recompose step merges the standalonemacosx/hermesvm.frameworkinto the universalhermesvm.xcframework.2. Keep 0.83 on V0 (defer V1 to 0.84)
static_hresolution,CMAKE_BUILD_TYPE, inspector-header guard,HERMES_V1_ENABLEDdefine) is reverted to0.83-merge. RN 0.83's default engine is V0 (0.14.0); V1-as-default is an upstream 0.84 change ([RN][HermesV1] Use Hermes V1 as default engine react/react-native#54989, not backported). V1 is inherited naturally at the 0.84 merge.3. Retire fork-specific Hermes resolution (reduce divergence from upstream)
resolve-hermes.mts resolve-commitnow emits the pinned.hermesversion/.hermesv1versiontag (a validfacebook/hermescheckout ref) instead of the merge-base heuristic.hermes.jsreverted to be byte-identical to facebook/react-native0.83-stable— removes the RN-version→Hermes mapping,BUILD_FROM_HERMES_COMMIT, and a latent RN-version-into-hermes-coordinate 404.hermes-utils.rb:hermes_commit_at_merge_basedeleted;podspec_source_build_from_github_mainrestored to upstream.microsoft-hermes.js:hermesCommitAtMergeBaseremoved.findMatchingHermesVersion/findVersionAtMergeBaseare kept — still required for thereactnative-dependenciesartifact, which upstream still keys by the RN version.Why
Upstream pins the Hermes version in
version.properties+.hermesversion(react#53985) — files that travel with the RN source at merge time. The fork's merge-base / RN-version resolution predated that and is now obsolete for Hermes, so deferring to the pinned files is both simpler and more correct, and removes standing fork↔upstream divergence (e.g.hermes.jsis now diff-free).Verification (local)
download-hermes Debug→hermes-ios/0.14.0(200) → recompose →hermesvm.xcframeworkwith 8 slices incl.macos-arm64_x86_64RCT_HERMES_V1_ENABLED=1→hermes-ios/250829098.0.2(200); V0/V1 × debug/release all 200resolve-commit→hermes-v0.14.0(V0) /hermes-v250829098.0.2(V1) — both validfacebook/hermestagshermes.js== upstream0.83-stable; merge-base helpers gone repo-wide;ruby -c+ eslint cleanTest plan (CI — validates the CocoaPods/iOS paths not exercisable locally)
Resolve Hermesreportsrecomposed=true(download fast-path taken; from-source jobs skipped)Prebuild macOS Core / Build *link the recomposed Hermes and passBuild RNTester / *(ios / macos / visionos) pass — validates thehermes.jsandhermes-utils.rbrevertsSupersedes