Fix Mach-O assembly selection for watchOS and visionOS - #152
Open
proggeramlug wants to merge 1 commit into
Open
Conversation
psm fails to build for *-apple-watchos and *-apple-visionos: src/arch/aarch_aapcs64.s:32:1: error: unknown directive .type rust_psm_stack_direction,@function build.rs defines CFG_TARGET_OS_<os> generically from CARGO_CFG_TARGET_OS, but the Mach-O branch in the four affected .s files enumerates only four of the Apple OS names. For watchOS and visionOS the macro is CFG_TARGET_OS_watchos / CFG_TARGET_OS_visionos, no branch matches, and the file falls through to the #else ELF branch -- emitting .type and .size, which the Mach-O assembler rejects. macOS, iOS and tvOS are unaffected, which is why this went unnoticed. Add the two missing OS names to the Apple branch in all four files that carry the guard: aarch_aapcs64.s, arm_aapcs.s, x86.s, x86_64.s.
proggeramlug
added a commit
to PerryTS/perry
that referenced
this pull request
Aug 4, 2026
* fix(release): restore watchOS, unbreak visionOS Two problems, one latent since 2026-07-18. visionOS was broken and no release had caught it. dyn-eval joined perry-runtime's `default` in #6584 and reaches psm three crates down (dyn-eval -> perry-parser -> swc_ecma_parser -> stacker -> psm), whose Mach-O guard enumerates darwin/macos/ios/tvos and omits watchos/visionos -- so both fall through to psm's ELF branch and emit .type/.size, which the Mach-O assembler rejects. Nothing in Perry is involved. release-packages.yml builds these with default features and its last successful run was 2026-07-04, before the regression, so it would have surfaced at the next release. Fixed upstream as rust-lang/stacker#152; until that lands these two build `default` minus `dyn-eval`, losing only runtime `new Function`. watchOS was dropped for a reason that never applied to the triple it ships on. The v0.5.888 note blamed ring 0.17.14's pointer-size assertion -- real, but specific to the ILP32 arm64_32-apple-watchos triple. aarch64-apple-watchos is LP64; ring builds for it, as does perry-ui-watchos. The LP64 device triple and its simulator are restored across all three sites that needed it: the build: cross loop, the build-cross matrix, and bottle staging. arm64_32 stays out until ring is fixed or pinned. Verified per target on stable with the exact feature list the workflow now passes: runtime+static, stdlib+static and the UI crate all build for watchos, watchos-sim, visionos and visionos-sim. library_search.rs already maps _watchos/_watchos_sim, so no compiler-side change was needed. Three stale comments claiming watchOS was dropped, and one asserting the device triple is arm64_32, are corrected -- the second is what kept the platform out for months. Claude-Session: https://claude.ai/code/session_01EaD6yNwoinzdW1JbYNkMMF * docs: rename changelog fragment to the real PR number (#7379) Claude-Session: https://claude.ai/code/session_01EaD6yNwoinzdW1JbYNkMMF --------- Co-authored-by: Ralph Küpper <ralph@skelpo.com>
Member
|
If you could summarize the description into a sentence or two for the commit message, that would be amazing. |
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.
psmfails to build for*-apple-watchosand*-apple-visionos:Cause
build.rsdefinesCFG_TARGET_OS_<os>generically fromCARGO_CFG_TARGET_OS:but the Mach-O branch enumerates only four of the Apple OS names:
For watchOS and visionOS the macro is
CFG_TARGET_OS_watchos/CFG_TARGET_OS_visionos, no branch matches, and the file falls through to the#elseELF branch — emitting.typeand.size, which the Mach-O assembler rejects. macOS, iOS and tvOS are unaffected, which is why this went unnoticed.The same guard with the same omission appears in all four files that have it:
aarch_aapcs64.s,arm_aapcs.s,x86.s,x86_64.s.Fix
Add the two missing OS names to the Apple branch. No other change.
Verification
Reproduced and verified downstream in a project that reaches
psmviastacker←swc_ecma_parser. With this patch applied via[patch.crates-io], both targets build where they previously failed in the build script:aarch64-apple-watchosaarch64-apple-visionosaarch64-apple-iosaarch64-apple-tvosaarch64-apple-darwinA possible alternative, if you prefer it
build.rscould instead defineCFG_TARGET_VENDOR_<vendor>and the guard become#if defined(CFG_TARGET_VENDOR_apple), which would cover future Apple platforms without another edit. I kept this PR to the minimal change because that variant alters the guard's semantics — the existing branch spells outdarwinexplicitly alongsidemacos— and that seemed like your call rather than mine. Happy to switch it over.