Skip to content

Configure the host Hermes compiler for one architecture - #442

Merged
kraenhansen merged 2 commits into
nextfrom
claude/hermes-prebuilt-fix-hermesc-zk13mc
Aug 13, 2026
Merged

Configure the host Hermes compiler for one architecture#442
kraenhansen merged 2 commits into
nextfrom
claude/hermes-prebuilt-fix-hermesc-zk13mc

Conversation

@kraenhansen

Copy link
Copy Markdown
Collaborator

The Hermes prebuilt workflow fails on its first run (31713076501), and so does the Build prebuilt Hermes step on #441. Same cause, mine, introduced in #440.

What broke

prebuilt-hermes configured the host compiler with CMAKE_OSX_ARCHITECTURES=arm64;x86_64, so that the hermesc shipped in the archive would run on Intel Macs too. A multi-arch host configure makes llvh's feature try-compiles fail. The tell is in the log — standard headers reporting as missing:

-- Looking for unistd.h - not found
-- Looking for sys/types.h - not found
-- Looking for isatty - not found
...
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Failed
CMake Error at external/llvh/cmake/modules/CheckAtomic.cmake:53 (message):
  Host compiler appears to require libatomic, but cannot find it.

Neither Hermes' build_host_hermesc nor React Native's [RN] [1] Build Hermesc passes architectures here, and both work. This drops the flag and keeps only CMAKE_BUILD_TYPE, which the pinned Hermes does require (it hard-errors without one — see #392).

Consequence: hermesc is native to the builder

destroot/bin/hermesc is now a binary for whichever Mac built the archive, and the archive is otherwise architecture-independent. So the archive name carries the host architecture:

hermes-5a795c9f8800-rn0.88.0-nightly-...-debug-iphoneos-iphonesimulator-arm64.tar.gz

Archives are published from Apple Silicon runners. An Intel Mac now finds no matching archive and builds its own — slow, but correct — instead of downloading one whose hermesc dies with "bad CPU type in executable".

A genuinely universal hermesc is still possible later: build the native one, cross-build the other architecture as a single-arch configure importing the native host compilers, and lipo them. That is more machinery than the current problem warrants, and it is not what upstream does.

The failure hid one step too long

Build prebuilt Hermes reported success in 38 seconds while cmake was failing inside it, and the run only went red at gh release upload "". The step body was:

echo "path=$(pnpm exec react-native-node-api prebuilt-hermes --no-download)" >> "$GITHUB_OUTPUT"

Inside echo "x=$(cmd)" the exit status is echo's, so a failing command passes the step with an empty value. Each substitution is now assigned first — a bare VAR=$(cmd) does propagate the status under the step's bash -e. check.yml in #441 is unaffected there; its build step is a plain run: and failed correctly.

Leftover

The failed run created release hermes-prebuilt-5a795c9f8800 with no assets, before failing to upload. It is harmless — the next successful run uploads into it — but it can be deleted if you would rather it not sit there empty.

Test plan

Not verified from this worker: the configure only runs on macOS. The diagnosis rests on the run log quoted above, and on the fix restoring the configuration Hermes and React Native both use successfully.


Generated by Claude Code

Passing CMAKE_OSX_ARCHITECTURES=arm64;x86_64 to build a universal hermesc
makes llvh's feature try-compiles fail — standard headers report as
missing and the configure dies on CheckAtomic. Configure it the way Hermes
and React Native do, for the host architecture only.

hermesc is then native to the Mac that built the archive, so the archive
name carries the host architecture: a Mac of the other architecture finds
no published archive and builds its own, instead of downloading a hermesc
it cannot execute.

Also assign each command substitution before echoing it into GITHUB_OUTPUT.
Inside `echo "x=$(cmd)"` the step's exit status is echo's, so the failing
build above passed its step with an empty path and only surfaced one step
later, as `gh release upload ""`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UkNbgdyuKgHaFwT27RahGH
@kraenhansen kraenhansen added CI Continuous integration Apple 🍎 Anything related to the Apple platform (iOS, macOS, Cocoapods, Xcode, XCFrameworks, etc.) labels Aug 13, 2026 — with Claude
The workflow's pull_request trigger doesn't fire on `labeled`, so the
label-gated jobs need a synchronize event to be evaluated against.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UkNbgdyuKgHaFwT27RahGH
@kraenhansen
kraenhansen merged commit 263a3bc into next Aug 13, 2026
16 checks passed
@kraenhansen
kraenhansen deleted the claude/hermes-prebuilt-fix-hermesc-zk13mc branch August 13, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Apple 🍎 Anything related to the Apple platform (iOS, macOS, Cocoapods, Xcode, XCFrameworks, etc.) CI Continuous integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant