Configure the host Hermes compiler for one architecture - #442
Merged
Conversation
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
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
3 tasks
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.
The
Hermes prebuiltworkflow fails on its first run (31713076501), and so does theBuild prebuilt Hermesstep on #441. Same cause, mine, introduced in #440.What broke
prebuilt-hermesconfigured the host compiler withCMAKE_OSX_ARCHITECTURES=arm64;x86_64, so that thehermescshipped 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:Neither Hermes'
build_host_hermescnor React Native's[RN] [1] Build Hermescpasses architectures here, and both work. This drops the flag and keeps onlyCMAKE_BUILD_TYPE, which the pinned Hermes does require (it hard-errors without one — see #392).Consequence:
hermescis native to the builderdestroot/bin/hermescis now a binary for whichever Mac built the archive, and the archive is otherwise architecture-independent. So the archive name carries the host architecture: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
hermescdies with "bad CPU type in executable".A genuinely universal
hermescis still possible later: build the native one, cross-build the other architecture as a single-arch configure importing the native host compilers, andlipothem. 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 Hermesreported success in 38 seconds while cmake was failing inside it, and the run only went red atgh release upload "". The step body was:Inside
echo "x=$(cmd)"the exit status isecho's, so a failing command passes the step with an empty value. Each substitution is now assigned first — a bareVAR=$(cmd)does propagate the status under the step'sbash -e.check.ymlin #441 is unaffected there; its build step is a plainrun:and failed correctly.Leftover
The failed run created release
hermes-prebuilt-5a795c9f8800with 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
Hermes prebuiltand confirm it gets past the host compiler and publishes an assetTest app (iOS)gets a greenBuild prebuilt HermesNot 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