Skip to content

ci: cache Smoke's Nix runtime packages on main - #7662

Merged
kixelated merged 11 commits into
mainfrom
quest/m0/ci/nix-cache-verify
Nov 5, 2026
Merged

kixelated merged 11 commits into
mainfrom
quest/m0/ci/nix-cache-verify

Conversation

@kixelated

@kixelated kixelated commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Smoke's Nix channel builds main's moq-relay and moq, but Cache only published the dev shell. Since moq-dev/moq#7431 removed Smoke's Cachix push, neither runtime closure was published for new heads.

Approach

Keep the existing three-platform dev-shell matrix (now also carrying @moq/libav from main) unchanged. Add an independent x86 Linux runtime job in Cache, matching Smoke's current Nix platform. Publish the existing Crane dependency artifacts first, then build and publish both runtime closures. Keep all writes in cache-write; Smoke remains a reader.

Only the runtime job serializes its active and newest pending runs, avoiding duplicate builds without starving cold uploads or delaying dev shells. It uses Smoke's existing 75-minute cold-build budget. Update the cache docs.

Quest split

Decided 2026-11-05 (maintainer, /quest-audit, recorded in moq-dev/moq#7975): ✅ keep in m0 only what can finish on main, and move the cut-dependent verification to m2 behind /quest/m2/release/cut.md, since the maintainer merges main into release with the next minor cut (decided 2026-11-04), after m1. Not chosen: moving the whole quest; merging main into release now.

  • quest/m0/ci/nix-cache-verify.md is now [XS] Verify the Nix runtime cache: after this PR merges, record a successful Cache Runtime (ubuntu-24.04) upload and a scheduled or push Smoke ubuntu-latest / nix run substituting both closures. Never dispatch Nightly for it.
  • New quest/m2/release-nix-cache.md, requiring the cut: the first tag's Release Nix uploads on all three legs, clean-machine nix run substitution, Cachix retirement, and bucket sizes (not before 2026-11-24, Cloudflare access). Same pattern as quest: audit m0 and m1 (2026-11-05) #7975's quest/m2/mbx-r2-release-cache.md and quest/m2/release-tag-publishers.md; those land with quest: audit m0 and m1 (2026-11-05) #7975, not here.
  • Links in quest/m0/ci/README.md, quest/m0/ci/mbx-r2-verify.md, quest/m0/ci/publish-release-only.md, and quest/m2/README.md follow the split.

The m0 quest cannot finish inside this PR: its evidence needs the main runtime job this PR adds, and Cache only writes from main through cache-write. It clears on the first Cache run after merge plus the next daily (08:00 UTC) Smoke run.

Impact

  • No public API or wire changes.
  • Cache builds and retains both x86 Linux runtime closures and their dependency artifacts under the existing CI bucket's 30-day expiry.

Alternatives

Reuse the existing Cache workflow instead of adding Smoke credentials or another workflow. Separate its runtime job from the dev-shell matrix to keep their scheduling and cold-build budgets independent. The settled scope is the relay and CLI runtime closures. Keep the existing main-push trigger for the settled runtime cache coverage; a nightly-only warm would narrow public HEAD coverage. Limit runtime builds to x86 Linux, the current consumer; retain dev shells on all three platforms. Do not add unused ARM/macOS package builds or a shared dependency-artifact API.

Validation

  • Earlier rounds: a command fixture reproduced the missing runtime coverage, then passed 14 publisher cases (upload ordering, cleanup, build/upload failures, missing credentials). nix build .#moq-relay .#moq passed on x86 Linux; both evaluate for x86 Linux, ARM Linux, and ARM macOS.
  • This round, on 82efe9fd63 (main merged): quest gate nix develop --command just ci origin/main passed (exit 0). quest check --base origin/main, git diff --check, and shellcheck sh/gh/cache-runtime.sh sh/gh/cache.sh pass. sh/gh/cache-runtime.sh now globs its out-links ("$roots"/deps*), matching main's sh/gh/cache.sh.

Follow-ups

None beyond the m2 quest above.

Review

Codex, gpt-6.1-sol, medium effort, reviewed head 82efe9fd6350569eaf81da6d614c16852028c1a3 against origin/main (c0888cfefb), session round 1: no findings.

Previous: Claude Code (claude-opus-5-5, medium) reviewed 54deb8cdf8 (GPT-6.1 Sol's cache changes) with every finding fixed or refuted.

(Written by Claude Opus 5.5)

kixelated and others added 7 commits October 27, 2026 23:36
Nightly run 40506938673 entered the dev shell in about a minute with
nothing compiled. Narrow the quest to the release push, bucket sizes,
and Cachix retirement, and note the smoke nix channel's cache gap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Design change: Publish the dev shell before runtime builds, then build both runtime packages in one Nix invocation. Cache runtime closures only on x86 Linux, Smoke's only current nix platform; retain dev-shell warming on all three platforms. This avoids unused ARM/macOS package builds and preserves shell publication when a runtime build fails. Existing timeout limits stay until hosted evidence justifies changing them.

(Written by GPT-6.1 Sol)

Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Design change: Reuse the existing moq-relay.cargoArtifacts and moq.cargoArtifacts outputs, publishing them before the runtime builds. This lets later warms substitute dependency artifacts without exporting a new flake attribute or refactoring package builds. The combined local closure has 1,061 unique paths and 1,695,959,736 uncompressed NAR bytes; this is not compressed R2 usage or month-long evidence.

Serialize Cache per ref, finish the active publication, and retain only the newest pending run. This bounds overlapping builds while avoiding starvation from canceling a cold dependency build on every merge. GitHub documents this behavior for concurrency without cancel-in-progress. The macOS Smoke comment now calls out the runtime-cache platform gate.

(Written by GPT-6.1 Sol)

Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Design change: Keep the existing three-platform dev-shell matrix unchanged and publish runtime packages in a separate x86 Linux job in Cache. Only the runtime job serializes its active and newest pending runs, so ARM/macOS shells never queue behind Rust builds. Its 75-minute cold-build budget matches the existing Smoke Nix lane; this job does not warm the dev shell too. Dependency artifact publication still happens before the runtime builds. Documentation now names patched kio sources as dependency-artifact inputs.

(Written by GPT-6.1 Sol)

Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Move the release-tag proof, Cachix retirement, and bucket-size checks to
quest/m2/release-nix-cache.md behind the release cut (maintainer,
2026-11-05, #7975), leaving m0 the main-branch runtime evidence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 5, 2026 20:23
@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bc2203be-7675-4dba-8fd2-14210fc9bf8a
Commits

Reviewing files that changed from the base of the PR and between 62ae716 and 82efe9f.

Files selected for processing: 12

  • .github/justfile
  • .github/workflows/cache.yml
  • .github/workflows/smoke.yml
  • flake.nix
  • infra/README.md
  • quest/m0/ci/README.md
  • quest/m0/ci/mbx-r2-verify.md
  • quest/m0/ci/nix-cache-verify.md
  • quest/m0/ci/publish-release-only.md
  • quest/m2/README.md
  • quest/m2/release-nix-cache.md
  • sh/gh/cache-runtime.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed head 82efe9fd6350569eaf81da6d614c16852028c1a3 against base 62ae716265b59681faa82b7f433d91a2f2e5f2e6.

Findings: No actionable defects found in the 12-file diff. There are no earlier published review findings to carry forward.

Direction: The separate x86 Linux runtime job preserves dev-shell independence, serializes publication without canceling active builds, and uploads existing Crane dependency artifacts before both runtime closures. Keeping Smoke read-only and separating post-merge runtime proof from release-cut verification is consistent with the stated scope.

Verification limits: GitHub-only static review of the workflow, recipe, publisher, existing signing/upload helper, flake/Crane definitions, and quest changes. I did not run builds or tests, verify credentials, or observe a hosted upload/substitution. The successful main Cache runtime upload and subsequent Smoke cache hits remain required evidence; current checks do not establish those results.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • New runtime job in Cache — an independent Runtime (ubuntu-24.04) job gated on refs/heads/main, with a 75-minute budget, the cache-write environment, and job-level cache-runtime-<ref> concurrency that finishes the active run and replaces only the pending one. The three-platform warm matrix is untouched.
  • sh/gh/cache-runtime.sh and just gh cache-runtime — publishes .#moq-relay.cargoArtifacts/.#moq.cargoArtifacts first, then .#moq-relay/.#moq, both to nix-ci-moq-dev; out-links are globbed like sh/gh/cache.sh.
  • Docs — flake.nix now states that nix.moq.dev caches the default branch's dev shell plus moq-relay/moq on x86 Linux with the 30-day expiry, and that release tags become permanent only after the cut; smoke.yml comments the cold-build dependency and the platform-matrix requirement; infra/README.md documents the job, the dependency-artifact ordering, and the serialization.
  • Quest split — quest/m0/ci/nix-cache-verify.md narrows to the main evidence with a ## Waiting item, and the new quest/m2/release-nix-cache.md carries the release-tag proof, bucket sizes, and Cachix retirement, with the m0/m2 index links updated.

Verified the load-bearing mechanics: .#pkg.cargoArtifacts resolves (Crane passes it through mkCargoDerivation/mkDerivation, and builtins.derivation preserves the input attribute set), the multi-installable --out-link glob matches the existing sh/gh/cache.sh pattern, and Crane's deps-only derivation launders the source down to manifests/lock plus the extraDummyScript kio sources, so the artifacts are reusable across source-only commits as infra/README.md claims. shellcheck and the flake/YAML parses are clean. Smoke's actual substitution is deferred to the m0 quest's post-merge evidence by design.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 6b00852 Nov 5, 2026
14 of 15 checks passed
@kixelated
kixelated deleted the quest/m0/ci/nix-cache-verify branch November 5, 2026 22:15
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