Skip to content

Add a non-required macOS arm64 leg to the selfhost workflow - #1445

Merged
julia-script merged 10 commits into
selfhostfrom
selfhost-macos-ci
Oct 12, 2026
Merged

julia-script merged 10 commits into
selfhostfrom
selfhost-macos-ci

Conversation

@julia-script

@julia-script julia-script commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Milestone (iii) needs macOS arm64 in CI. This adds it without a macOS seed asset or a seed schema change.

  • silkc build accepts --target <triple>. It feeds the build profile's existing target input, so every target fact comes from the triple and none from the host. A non-host target emits only LLVM IR (--emit llvm-ir). An executable build for a non-host target is an invalid build profile, since the driver links only for its host, and there is no host fallback. The TypeScript CLI already has --target.
  • New job macos-ir (Linux, needs native-n1): N1 cross-emits the compiler for aarch64-apple-darwin from the checkout.
  • New job macos (macos-15, needs macos-ir) works in three steps:
    • It links that IR with a pinned LLVM 22.1.8 macOS release (sha256-verified, cached) and SDKROOT from xcrun. It passes the same clang arguments silkc's own link uses.
    • The result M1 emits the compiler from its own checkout, and the bytes must equal the cross-emitted IR. That is the fixpoint, since M2 would be clang(same IR). On a mismatch the first differing lines are printed.
    • M1 runs the native corpus (corpus-full).
  • Both jobs run on selfhost pushes and on manual workflow_dispatch only, not on PRs. A change to target or ABI code can dispatch the workflow on its branch. Both jobs are non-required: neither feeds Focused Linux Silk or publish-seed.
  • Focused Linux Silk accepts skipped bootstrap cases on any non-push event (!= push), so on a dispatch as on a PR. Without that, a dispatch would post a red required check on the PR's head. The step keeps Fail the required aggregate when any shard fails #1460's one-test-per-line shard checks.
  • compiler/scripts/test-native-build.ts covers cross-target emission (it emits IR without invoking clang, and that IR differs from host IR). It also covers rejecting an executable for a non-host target, an unknown triple, and a repeated --target. It passes locally with this branch's N1.
  • compiler/README.md documents the flag. PAPERCUTS gains two entries.

None of the touched files is a guarded input, so this lands on selfhost directly.

Validation

Local bootstrap compile on head 94e4fb1 (selfhost 11525ab, including #1459, #1458 and #1461, merged in), as required for compiler-changing PRs: node packages/cli/dist/bin.js check --manifest-path compiler/silk.toml, using a CLI built from current main, reports 1 succeeded, 0 failed (14m21s, 10.8 GB peak RSS). It checks the compiler root src/main.silk, which carries the --target change. An earlier run on adf5fd3 also passed.

Dispatch run 38184329312 on head 23e2b36: no fixed path, each leg builds from its own checkout, which #1450 made possible.

step time
macos-ir job, Linux about 2m
link M1 51s
M1 re-emits the compiler, byte-identical to the Linux cross-emission 1m49s
native corpus with M1 failed on the four P6 programs, as Linux did then

#1459 has since fixed those four on selfhost.

Earlier PR run 38176701398, before P6, with the then-temporary fixed path: the macOS leg was fully green, corpus pass=414 fail=0 unsupported=5. Timings: macos job 18m57s (LLVM cache restore 59s, link 64s, re-emit 3m57s, corpus 12m31s), macos-ir 2m07s.

Cost per run is about 21 runner-minutes (19 on macOS). It now applies only to selfhost pushes and dispatches, so PR latency is unchanged.

For #567 ("Current status")

macOS arm64: built and self-built in CI on selfhost pushes (non-required; workflow_dispatch for PRs touching target or ABI code). The Linux N1 cross-emits the compiler for aarch64-apple-darwin (silkc build --target), macOS links it as M1, and M1 re-emits byte-identical compiler IR. The native corpus runs on M1 (414 pass, 0 fail, 5 unsupported).

🤖 Generated with Claude Code

https://claude.ai/code/session_01SJak9tcQcwEZgNXjANPTiA

silkc build accepts --target <triple>. A non-host target emits only LLVM IR, so
the Linux N1 cross-emits the compiler for aarch64-apple-darwin and macOS needs no
seed of its own. The macOS job links that IR as M1 with a pinned LLVM 22.1.8,
checks that M1 emits byte-identical compiler IR, and runs the native corpus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SJak9tcQcwEZgNXjANPTiA
The source snapshot script needs workspace dependencies; the checkout already is
the exact committed tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SJak9tcQcwEZgNXjANPTiA
Package module identities contain the package root's absolute path, so the
Linux and macOS emissions only agree byte for byte from the same directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SJak9tcQcwEZgNXjANPTiA
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SJak9tcQcwEZgNXjANPTiA
A PR run no longer waits on macOS. workflow_dispatch runs the whole workflow on a
branch, so a target or ABI change can request the macOS leg; the required
aggregate accepts the skipped bootstrap shards there as it does on a PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SJak9tcQcwEZgNXjANPTiA
#1450 removed the checkout path from package identities, so the Linux and macOS
emissions agree without staging sources at a fixed path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SJak9tcQcwEZgNXjANPTiA

Copy link
Copy Markdown
Collaborator Author

"Selfhost native corpus" fails on this head (run 38184331627) with four pinned programs: nominal-union-operator-provider, operator-interface-contract, vector-sort-search-stability and vector-move-only-sort-and-cleanup.

This failure isn't caused by this PR. This PR touches only the workflow, the --target CLI option and docs. The same four failures happen on the selfhost push of 3ca78ea (run 38183198621), which predates this branch's latest base merge. No fix exists yet, so nothing is ported here.

The aggregate check passed on that push despite the red corpus. That gate hole is fixed separately in #1460.


Generated by Claude Code

@julia-script
julia-script marked this pull request as ready for review October 11, 2026 23:58
@julia-script
julia-script merged commit 0e80119 into selfhost Oct 12, 2026
12 checks passed
julia-script added a commit that referenced this pull request Oct 18, 2026
Add a non-required macOS arm64 leg to the selfhost workflow
@julia-script
julia-script deleted the selfhost-macos-ci branch October 18, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants