Skip to content

fix(release): prime the macOS x86_64 dependency cache (from #9327) - #9328

Merged
proggeramlug merged 2 commits into
mainfrom
fix/9327-guard
Aug 31, 2026
Merged

fix(release): prime the macOS x86_64 dependency cache (from #9327)#9328
proggeramlug merged 2 commits into
mainfrom
fix/9327-guard

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Lands #9327 with one hardening. The author's commit is preserved.

The diagnosis is right and the deadlock is real: the macOS x86_64 leg must run on an Intel runner, a cold dist build there hit GitHub's hard 6h ceiling, and a cancelled job skips its post-steps — so rust-cache saved nothing and the leg could never warm the cache it needed to finish. A priming job with cache-on-failure inside the ceiling breaks that cycle.

The hardening. prime-macos-x86_64-cache is a needs dependency of build, and it is this repository's first job-level continue-on-error — every other use is step-level. The PR's stated contract is "if it fails or times out, build runs exactly as it would have", which relies on GitHub treating a continue-on-error job failure as satisfying a needs edge. That may well be right, but the cost of it being wrong is a release that silently builds nothing, which is the same shape as the "gate unable to fail" family CLAUDE.md catalogues.

So build now names its gate explicitly rather than inferring it:

if: >-
  ${{ !cancelled()
  && needs.preflight.result == 'success'
  && needs.await-tests.result == 'success' }}

await-tests stays the gate, preflight must have produced the outputs the signing steps consume, and the warmer's outcome is deliberately unexamined — which is exactly the intent the comment already stated. It holds whatever continue-on-error does to the needs edge.

Verified: the workflow parses, build.needs and the new if resolve as intended, check_node_version_consistency.py passes, and actionlint reports 7 issues on this branch and 7 on origin/main — no new findings (the two shellcheck style hits at lines 208 and 849 are pre-existing).

Separately — not fixed here, and still live: build-cross at line 1183 still pairs os: macos-15 (the Arm64 image) with target: x86_64-apple-darwin for perry-ui-macos. That is the same arm64-LLVM-cannot-link-x86_64 mismatch this PR fixes at line 426, one matrix over, and because build-cross sets fail-fast: false it fails quietly as a missing x86_64 UI bundle rather than a red release. Worth its own change.

Summary by CodeRabbit

  • Bug Fixes

    • Improved reliability of macOS Intel release builds by preparing and caching dependencies before compilation.
    • Prevented cold dependency builds from exceeding the CI job time limit and being cancelled.
  • Documentation

    • Added a changelog entry describing the macOS x86_64 release build reliability improvement.

Ralph Küpper added 2 commits August 31, 2026 23:45
The x86_64 macOS leg has to run on an Intel runner -- the bare macos-15 label
is the Arm64 image, whose arm64-only LLVM cannot link an x86_64 binary. Intel
runners are materially slower: the arm64 leg takes ~3h40m with a warm cache,
and a cold dist build on Intel ran to GitHub's hard 6h ceiling and was
cancelled (stage run 33395471638, 13:52:22Z -> 19:52:44Z).

It was not a defect. The job compiled through perry-stdlib-static, so the
link failure that moved it to this runner is genuinely fixed; it simply ran
out of wall clock.

The problem is that a cancelled job SKIPS its post-steps, so rust-cache saved
nothing -- the leg could not finish without a warm cache and could not warm one
without finishing. cache-on-failure does not help: it covers failed jobs, not
cancelled ones.

Add a preparatory job that compiles the third-party dependencies for that
target under a 330-minute timeout, inside the ceiling, with cache-on-failure so
the cache is saved even if it does not complete. rust-cache stores dependencies
only -- it evicts workspace-crate fingerprints (#4856) -- and those are the bulk
of a cold build, so the release build then starts from compiled dependencies and
recompiles only workspace crates.

It is continue-on-error and shares the build job's cache key, so it is an
optimization rather than a gate: if it fails, build runs exactly as before.
…armer

prime-macos-x86_64-cache is an optimization with job-level continue-on-error --
the repo's first -- and a needs edge whose skip semantics would cost a silently
skipped release to discover. Name the gate instead.
@proggeramlug
proggeramlug merged commit 9943dd9 into main Aug 31, 2026
17 of 21 checks passed
@proggeramlug
proggeramlug deleted the fix/9327-guard branch August 31, 2026 21:46
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: d6908148-4e04-40b1-8fa9-3f3cdb96115b

📥 Commits

Reviewing files that changed from the base of the PR and between 1f8ad06 and 18ce5e6.

📒 Files selected for processing (2)
  • .github/workflows/release-packages.yml
  • changelog.d/9327-macos-x64-cache-prime.md

📝 Walkthrough

Walkthrough

The release workflow adds a non-blocking macOS x86_64 cache-priming job. The build job waits for this job but gates execution only on preflight, test completion, and cancellation status. A changelog entry documents the change.

Changes

macOS x86_64 release cache priming

Layer / File(s) Summary
Dependency cache priming
.github/workflows/release-packages.yml, changelog.d/9327-macos-x64-cache-prime.md
The workflow adds an Intel macOS job that compiles the perry distribution profile for x86_64-apple-darwin, restores or saves the shared Rust cache, and continues on error. The changelog records the cache-priming behavior.
Release build gating
.github/workflows/release-packages.yml
The build job waits for the cache-priming job. Its condition requires successful preflight and completed tests, and ignores the cache-priming result.

Estimated code review effort: 3 (Moderate) | ~15–30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ReleaseWorkflow as release-packages workflow
  participant PrimeJob as prime-macos-x86_64-cache
  participant RustCache as rust-cache
  participant BuildJob as build
  ReleaseWorkflow->>PrimeJob: start cache priming
  PrimeJob->>RustCache: restore or save x86_64 dependency cache
  PrimeJob-->>ReleaseWorkflow: complete with success or failure
  ReleaseWorkflow->>BuildJob: check preflight and await-tests results
  BuildJob->>BuildJob: ignore cache primer result
Loading

Suggested reviewers: jdalton

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/9327-guard

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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