Skip to content

Stop the host Hermes compiler build from targeting visionOS - #443

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

Stop the host Hermes compiler build from targeting visionOS#443
kraenhansen merged 2 commits into
nextfrom
claude/hermes-prebuilt-visionos-env-zk13mc

Conversation

@kraenhansen

@kraenhansen kraenhansen commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Fixes the Hermes prebuilt workflow, which had failed on every run (1, 2, 3) with:

CMake Error at external/llvh/cmake/modules/CheckAtomic.cmake:53 (message):
  Host compiler appears to require libatomic, but cannot find it.

Verified: run 31719660147 on this branch built Hermes in 26m46s and published the first assethermes-5a795c9f8800-rn0.88.0-nightly-20260809-db662caea-debug-iphoneos-iphonesimulator-arm64.tar.gz, 118 MB, into the release the first failure had left empty.

The actual cause

buildArchive exported all three deployment targets build-apple-framework.sh can ask for to every command it ran, including the host compiler configure. XROS_DEPLOYMENT_TARGET is not only the name that script reads — it is also a clang driver variable. With it set and no explicit target, clang built for visionOS:

clang: warning: using sysroot for 'MacOSX' but targeting 'XR' [-Wincompatible-sysroot]
/…/MacOSX.sdk/usr/include/sys/_types/_fd_def.h:64:18: error:
  '__darwin_check_fd_set_overflow' is unavailable: not available on visionOS
/…/c++/v1/__thread/support/pthread.h:54:14: error:
  'pthread_mutexattr_init' is unavailable: not available on visionOS

Every feature check touching an API marked unavailable on visionOS failed, and CMake reports those as a bare not found. That is what made this hard to read from the console log: unistd.h reported missing while sys/stat.h did not, which looks impossible until you see that unistd.h reaches _fd_def.h through sys/select.h and sys/stat.h doesn't. CheckAtomic was simply the first such check that treats failure as fatal.

Each platform build now gets only the deployment target that platform needs, and the host compiler build gets none. This also explains why React Native's own [RN] [1] Build Hermesc never hit it: that runs its CMake under env -i, so nothing from the job environment reaches clang.

How it was found

Two earlier attempts were guesses from console output and both were wrong — first CMAKE_OSX_ARCHITECTURES (#442, removed on a hypothesis that turned out not to be the cause; that change is still worth keeping for the archive-naming reasons in its own description), then a suspicion about inherited environment in general, right in shape but not actionable without knowing which variable.

What settled it was the failure-only diagnostic added here: it dumps CMake's CMakeConfigureLog.yaml, where the compiler's real complaint lives, plus the job environment, xcode-select -p and the SDK path, and uploads the full log as an artifact. Those steps are kept — this configure was misdiagnosed twice from the console log alone, and they turn the next occurrence into one round trip.

A useful control along the way: the identical configure succeeds on Linux against the same pinned Hermes (every header found, HAVE_CXX_ATOMICS_WITHOUT_LIB - Success), which ruled out the Hermes source, the pin and the CMake arguments.

Test plan

  • Hermes prebuilt dispatched on this branch gets past the host compiler and publishes an asset
  • The published asset name round-trips: GitHub stored it byte-identical to what --print name produces, and the URL --print url composes serves a valid gzip
  • Use the prebuilt Hermes archive for iOS builds #441 is restacked on this branch — its Test app (iOS) should now download the asset rather than build

kraenhansen and others added 2 commits August 13, 2026 16:08
CMake reports a failed feature check as a bare "not found", with the
compiler's actual complaint only in its configure log. The host hermesc
configure is failing on the macOS runner with checks that succeed
everywhere else, so surface that log rather than guess at it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UkNbgdyuKgHaFwT27RahGH
Every command got all three deployment targets build-apple-framework.sh
can ask for, including the host compiler build. XROS_DEPLOYMENT_TARGET is
also a clang driver variable, so clang targeted visionOS against the macOS
sysroot:

  clang: warning: using sysroot for 'MacOSX' but targeting 'XR'
  error: 'pthread_mutexattr_init' is unavailable: not available on visionOS

Every API marked unavailable on visionOS then failed to compile, which is
why unistd.h (which reaches _fd_def.h through sys/select.h) came back "not
found" while sys/stat.h did not, and why the configure died on CheckAtomic.

Each platform build now gets only the deployment target it needs, and the
host compiler build gets none.

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
@kraenhansen
kraenhansen merged commit 8f91084 into next Aug 13, 2026
17 checks passed
@kraenhansen
kraenhansen deleted the claude/hermes-prebuilt-visionos-env-zk13mc branch August 13, 2026 17:07
kraenhansen added a commit that referenced this pull request Aug 13, 2026
The paths filter fires on any edit to hermes.ts, hermes-prebuilt.ts or
this workflow, not just a bumped pin — and `--no-download` meant the run
then rebuilt for half an hour and re-uploaded 118 MB identical to what was
already on the release. Merging #443 did exactly that.

The Actions cache does not cover this: it is scoped to the branch that
wrote it, so a build on a feature branch leaves nothing behind for `next`,
and it evicts after 7 days idle or under the repository's 10 GB cap, which
several multi-gigabyte ccache entries already compete for.

The archive name covers every input that changes its contents, so an asset
already published under that name is what the run would rebuild. Look it
up and skip the build and the upload, with a `force` dispatch input for
deliberate rebuilds.


Claude-Session: https://claude.ai/code/session_01UkNbgdyuKgHaFwT27RahGH

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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