Skip to content

feat(nix): use crate2nix to cache workspace builds#477

Merged
mergify[bot] merged 35 commits into
mainfrom
ironstar-8g3-crate2nix-migration
Jun 14, 2026
Merged

feat(nix): use crate2nix to cache workspace builds#477
mergify[bot] merged 35 commits into
mainfrom
ironstar-8g3-crate2nix-migration

Conversation

@cameronraysmith

Copy link
Copy Markdown
Contributor

No description provided.

Six superpowers-bridge artifacts for the crane-to-crate2nix build
substrate migration, refactored from beads epic ironstar-8g3 via
audited two-design synthesis. Bound to Linear CAM-15.
@cameronraysmith cameronraysmith self-assigned this Jun 10, 2026
Create openspec/linear.yaml registry (project ironstar-build-performance) and record the T1
Backlog->Todo transition in the proposal D10 ledger.
Task 1 of migrate-crane-to-crate2nix: locked crate2nix input
(0.15.0), just regenerate-cargo-nix recipe pinned via
--inputs-from, generated default-features Cargo.nix (576 crates,
per-member src keystone verified). Crane substrate untouched.
Task 2 of migrate-crane-to-crate2nix: ironstarCrateOverrides
(libduckdb-sys, aws-lc-sys, ring), Cargo.nix import with pinned
toolchain threading, per-member injected source trees for the two
parent-reaching members (embed parity with crane verified
byte-identical), package-set-invariant exclusions. Additive: crane
ironstar drvPath unchanged; eval ratio 1.23x vs crane baseline.
First tasks.md checkbox checked (task 1 bootstrap complete) fired
the apply gate; CAM-15 moved to In Progress and the D10 ledger
appended the transition.
Task 3: crane-free mkWorkspaceGate via importCargoLock +
cargoSetupHook with exact flag parity (cargo-profile dev, default
nextest profile, --deny warnings); 933 passed / 5 network-ignored
skipped reproduced twice; 20 per-crate *-test/*-clippy packages
deleted; 14-check surface unchanged.
Task 4: regenerate-lock-files.yaml extended with Cargo.lock/Cargo.toml
trigger paths and a regenerate+amend step pair mirroring bun.nix;
regenerate-cargo-nix flake app wrapping the pinned crate2nix input;
cargo-nix-lock-sync no-network staleness check (package-scoped
parsing, red-on-mismatch demonstrated). Check surface 14 -> 15.
Synthetic Renovate-style bumps, crane vs crate2nix dry-run rebuild
sets: shallow (adler2) 13/504 crates (2.6%) vs crane's invariant
whole-blob; deep (libc) 135/504 (27%) vs whole-blob. Supports go
on the cache-granularity criterion for the task-5 swap.
10 of 11 members at exact parity (696 passed + 2 ignored matching
per-member baselines); buildRustCrate builds lib AND tests/
integration targets; granularity confirmed (leaf edit rebuilds 2 of
11 test suites); single blocker is a darwin dSYM cp defect in the
crate2nix test runner, fixable without Cargo.nix edits.
Gate-shape revision per the runTests parity experiment: 11
per-member checks on the per-crate graph replace the monolithic
nextest gate; crane-sliver fallback removed from the design;
workspace-clippy remains the sole cargo gate with a crane-free
deps-prebuild as optional follow-up.
11 runTests checks reusing the per-crate rlib graph (one build of
every crate, shared by binary and tests); workspace-test becomes a
zero-cost linkFarm aggregate; darwin dSYM fix via crate-override
postInstall (parity with crane's bare-binary install); 933/5
envelope reconstructed exactly; leaf edit reruns 2 of 11 suites.
Check surface 15 -> 26.
Task 4b minimal slice: snapshot-as-envelope + invariants-as-regulator
(sibling of cargo-nix-lock-sync), hermeticity correction (no recursive
nix in sandbox; snapshot is a committed regenerated artifact), canonical
system x86_64-linux, Rust-core roots, persistent duplication
pinned-as-baseline. Full observability program deferred to follow-up.
build-graph-snapshot app (nix derivation show -r + hash-free
normalization over 16 canonical x86_64-linux Rust-core roots),
committed snapshot envelope + baseline ceilings, pure content-addressed
build-graph-invariants check (red-on-ceiling-breach demonstrated),
just regenerate-build-graph-snapshot recipe, Renovate workflow
lockstep step. Check surface 26 -> 27. Baseline-zero locks the
coexistence topology so tasks 5-6 land as measured deltas.
Task 5: packages.ironstar/ironstar-release are now the crate2nix
builds (drv-identical to the -c2n names: zero rebuilds); crane
buildPackage definitions deleted; checks.ironstar follows via
inherit; transition exclusions removed from package-set-invariant;
build-graph snapshot/baseline root keys migrated (ceiling values
unchanged). E2E 22/1-skip against the c2n binary; post-swap
one-dep-bump cone demo: 13 derivations, matching pre-swap.
Task 6: crane input, crane.cachix.org substituter, and all crane
machinery removed; crane-free source filter verified byte-identical
(zero rebuilds); dead nix-unit input removed; workflows README
updated to the live 27-check surface; build-graph snapshot
byte-identical and regulator green; final one-dep-bump cone demo:
13 derivations rebuild, ~565 deps + 7 members stay cached.
@cameronraysmith cameronraysmith force-pushed the ironstar-8g3-crate2nix-migration branch from 217c03d to 445da5b Compare June 11, 2026 17:12
Rephrase load-bearing comments durably (rust-embed empty-folder
footgun, content-addressed member-src names) and drop design-ruling
citations, task numbers, and migration-phase narration from
production code and the workflows README.
Verify pass failed on artifact drift: the delta spec still encoded
the superseded monolithic-gate contract (nextest mandate, runTests
prohibition, exactly-14 surface). Rewrite the test/clippy requirement
to the as-built per-member shape, add the build-graph
envelope/regulator requirement, reconcile proposal and design figures
(27 checks, 933/5 envelope), and drop residual nix-unit comment
references. Code untouched.
Re-adjudicated after artifact reconciliation: 0 critical, 0 warning,
2 carried suggestions (Renovate-gated live dry-run deferral;
single-system baseline + frozen member-src names, both with recorded
rationale). Overall decision: pass.
verify.md checked PASS after artifact reconciliation; one re-queue
crossing recorded (review_round 1) with the dropped FAIL attempt
preserved in the ledger. CAM-15 description refreshed to the
as-built figures.
@cameronraysmith cameronraysmith force-pushed the ironstar-8g3-crate2nix-migration branch from c5b4617 to fed46d1 Compare June 12, 2026 01:22
@cameronraysmith cameronraysmith changed the title feat(nix): migrate Rust build substrate from crane to crate2nix feat(nix): use crate2nix to cache workspace builds Jun 12, 2026
…on-gating end state

Re-round opsx:verify (2026-06-14) confirmed the build-graph regulator demotion reduced the flake check surface 27->26 with build-graph-invariants absent from .#checks. Regenerate migrate-crane-to-crate2nix verify.md and measurements.md, correct residual 27/build-graph-invariants references in proposal.md and tasks.md, and add the first verify.md for add-build-graph-compendium.
@cameronraysmith cameronraysmith marked this pull request as ready for review June 14, 2026 18:26
@cameronraysmith cameronraysmith added the author-approved Owner self-approval marker; triggers Mergify auto-approve label Jun 14, 2026
@mergify mergify Bot added the queued label Jun 14, 2026
@mergify

mergify Bot commented Jun 14, 2026

Copy link
Copy Markdown

Merge Queue Status

  • Entered queue2026-06-14 18:28 UTC · Rule: default
  • Checks skipped · PR is already up-to-date
  • Merged2026-06-14 18:28 UTC · at 38dcb77011031e7fa972093bace80faad14b4935 · fast-forward

This pull request spent 10 seconds in the queue, including 2 seconds running CI.

Required conditions to merge
  • any of [🛡 GitHub repository ruleset rule buildbot]:
    • check-success = buildbot/nix-build
    • check-neutral = buildbot/nix-build
    • check-skipped = buildbot/nix-build

@mergify mergify Bot merged commit 38dcb77 into main Jun 14, 2026
8 checks passed
@mergify mergify Bot removed the queued label Jun 14, 2026
@cameronraysmith cameronraysmith deleted the ironstar-8g3-crate2nix-migration branch June 14, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author-approved Owner self-approval marker; triggers Mergify auto-approve

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant