Skip to content

ci: add macOS matrix coverage on main pushes#901

Merged
gregmagolan merged 6 commits into
mainfrom
ci-macos-matrix-main-only
Jun 23, 2026
Merged

ci: add macOS matrix coverage on main pushes#901
gregmagolan merged 6 commits into
mainfrom
ci-macos-matrix-main-only

Conversation

@gregmagolan

@gregmagolan gregmagolan commented Jun 23, 2026

Copy link
Copy Markdown
Member

Adds macOS coverage to the preset CI matrix so Apple-Silicon-only breakage can't slip through a green Linux build — the way the gcr.io/distroless/base linux/arm64/v8 manifest bug (#900) did, breaking aspect build //... for Go projects on Macs while CI stayed green.

macOS runners are billed at 10x Linux on GHA, so the os dimension expands to [ubuntu-latest, macos-latest] only on main pushes and stays [ubuntu-latest] on PRs. PR cost is unchanged; only post-merge runs pay for the macOS legs.

Standing up the macOS legs surfaced three real, latent issues this matrix now guards against — two are genuine template fixes that also help anyone building locally on Apple Silicon:

  1. GitHub API rate-limit (CI). On a cold macOS cache all presets stampede the unauthenticated GitHub releases API the aspect-launcher/bazelisk use (60 req/hr per IP) → 403. Fixed by authenticating those calls with the job token (GH_TOKEN/GITHUB_TOKEN/BAZELISK_GITHUB_TOKEN) + contents: read.
  2. LLVM too old for the macOS 15 SDK (template). The hermetic toolchain pinned LLVM 15, whose clang can't parse the macOS 15.5 SDK's libc++ (unknown type name '__remove_cv'). Bumped to LLVM 19.1.7 (single entry — 19.1.7 ships linux-x64 + darwin-arm64 + darwin-x64).
  3. rules_cc target rename (template). toolchains_llvm 1.8.0's generated cc_toolchain selects on //cc/toolchains/args/archiver_flags:use_libtool_on_macos_setting, which rules_cc 0.2.19 renamed away. Pinned rules_cc to 0.2.18 (newest with the target) and widened its gate from cpp to cpp or (rust and lint) to match where the LLVM toolchain is registered.

Two follow-ups, both scoped out deliberately:

  • clang-tidy lint is skipped on macOS for cpp/kitchen-sink. This is an unfixed upstream bug — rules_lint's _update_flag strips absolute -isystem libc++ paths as MSVC /flags (rules_lint#924, open PR #779). Build/test/format still run on macOS for cpp. Re-enable once that ships.
  • Per-task GitHub status comments/checks disabled (--github-status-comments:enabled=false --github-status-checks:enabled=false) on all task calls — ~7 tasks × 12 presets × 2 OSes was tripping the App-installation API limit. The GHA check is the source of truth for the matrix.

The actionlint download step is now uname-derived (OS + arch) so it works on the macOS arm64 runners.

Scope note: this only touches the template repo's own validation CI (.github/workflows/ci.yaml). The stamped CI shipped into generated projects (template/.github/workflows/ci.yaml) is unchanged — macOS billing there is the user's call. (The LLVM/rules_cc bumps in #2/#3 are in the shipped template/MODULE.bazel, since they fix real local builds for users.)


Changes are visible to end-users: yes

  • Searched for relevant documentation and updated as needed: yes

  • Breaking change (forces users to change their own code or config): no

  • Suggested release notes appear below: yes

  • Fixed the hermetic C++ toolchain on Apple Silicon / macOS 15 SDK: bumped LLVM 15 → 19.1.7 and pinned rules_cc to 0.2.18, so aspect build //... works locally for cpp and rust+lint projects on Macs (previously failed with unknown type name '__remove_cv' / missing use_libtool_on_macos_setting).

Test plan

  • Manual testing; please provide instructions so we can reproduce:
    • Verified on macOS 15.5 SDK (Apple Silicon): cpp builds + 2/2 tests pass, rust builds (incl. the C++-backed formatter that previously failed).
    • Full macOS matrix proven green (12/12 presets) on a temporary forced-on run; the gated os: expression keeps PRs ubuntu-only and was confirmed to produce 0 macOS / 12 ubuntu legs on this PR.

gregmagolan and others added 6 commits June 23, 2026 13:37
Add an `os` dimension to the preset CI matrix that expands to both
ubuntu-latest and macos-latest on main pushes, and stays ubuntu-only on
PRs. macOS runners are billed at 10x Linux on GHA, so PR cost is
unchanged; only post-merge runs pay for the macOS legs.

This catches Apple-Silicon-only breakage that the Linux matrix can't —
e.g. the gcr.io/distroless/base linux/arm64/v8 manifest bug that broke
`aspect build //...` for Go projects on Macs while CI stayed green.

Also makes the actionlint download OS/arch-aware (uname-derived) so the
lint step works on the macOS arm64 runners.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The macOS legs failed at the render step with "403 API rate limit
exceeded": on the first-ever macOS run the cache is cold, so all 12
presets stampede the unauthenticated GitHub releases API (60 req/hr by
IP) that the aspect-launcher and bazelisk use to resolve their versions.

Set GH_TOKEN / GITHUB_TOKEN / BAZELISK_GITHUB_TOKEN from the job token so
those calls get the 5000 req/hr authenticated limit, and add the
contents:read permission the token needs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The hermetic C++ toolchain failed to build on macOS 15.5 / Xcode 16.4
(surfaced by the new macOS CI legs) for cpp, rust, and kitchen-sink:

1. clang 15 can't parse the macOS 15 SDK's libc++ headers ("unknown type
   name '__remove_cv'"). Bump to LLVM 19.1.7 — clang 19 handles the SDK,
   and 19.1.7 ships linux-x64 + darwin-arm64 + darwin-x64, so the
   per-platform version map collapses to a single entry.

2. toolchains_llvm 1.8.0's generated cc_toolchain selects on the rules_cc
   target //cc/toolchains/args/archiver_flags:use_libtool_on_macos_setting,
   which rules_cc 0.2.19 renamed away → macOS analysis failed with "no
   such target". Pin rules_cc to 0.2.18 (newest version that still has it)
   and widen its gate from `cpp` to `cpp or (rust and lint)` to match the
   condition under which the LLVM toolchain is registered — rust+lint
   pulls in the toolchain too, so it needs the same pin.

Verified locally on macOS 15.5 SDK (Apple Silicon): cpp builds + tests
pass, rust builds (incl. the C++-backed formatter that previously failed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The per-task --task:name values were keyed only on the preset, so a
macOS leg and its Linux counterpart emitted the same task name (e.g.
test-go), colliding in the PR summary comment / status checks. Append
matrix.os to each so they're distinct (test-go-ubuntu-latest vs
test-go-macos-latest).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The clang-tidy lint aspect fails on macOS for cpp and kitchen-sink:
rules_lint's _update_flag strips absolute `-isystem` paths as if they
were MSVC `/flags`, dropping the macOS SDK libc++ include so clang-tidy
can't find <string>/<iostream>. It's an unfixed upstream bug with no
released fix and no public knob on the aspect.

Skip the Lint step for those two presets on macOS legs only; build, test,
and format still run there. Re-enable once
aspect-build/rules_lint#924 ships (PR #779).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Each preset runs ~7 aspect tasks across 12 presets × 2 OSes; every task
posting a GitHub status comment + check run hammered the App-installation
API limit (HTTP 403 "API rate limit exceeded for installation"). Disable
--github-status-comments and --github-status-checks on every task call —
the GHA check itself is the source of truth for the matrix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gregmagolan gregmagolan force-pushed the ci-macos-matrix-main-only branch from b3375f5 to 5be0550 Compare June 23, 2026 23:08
@aspect-build aspect-build deleted a comment from aspect-workflows Bot Jun 23, 2026
@gregmagolan gregmagolan merged commit 341bc5c into main Jun 23, 2026
14 checks passed
@gregmagolan gregmagolan deleted the ci-macos-matrix-main-only branch June 23, 2026 23:25
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.

1 participant