Repository navigation
build: cargo dev aliases, mold on Linux, and warm worktree targets - #1211
Conversation
RecommendationRevise. Why, what, and impactA cold worktree, or a switch between feature sets, compiles the Lance and DataFusion stack again. Link time is a large part of each test binary. This pull request adds local build configuration so that cost is paid less often. It does not change queries, writes, publication, or the on-disk graph. Four Linux CI test jobs link with mold. I checked the fallback with mold removed from Blocking
Optional
Tradeoffs and liabilityThe linker script is the right single owner. One The seed script is the right owner for the warm directory. The ancestor checksum is a narrow copy of Cargo's config walk. It hashes parent The aliases are a second copy of the canonical feature string. What this removes: repeated feature-unification rebuilds for the three test aliases, full cold builds for a matching macOS worktree, and link time on the CI jobs that install mold. What this adds: a shell process on every Linux link, including release. A macOS-only clone script that Linux contributors are still told to run. A Claude hook. Another copy of the feature string. Docs that track Cargo fingerprint rules and the sccache hash. Those docs are accurate today. sccache 0.16.0 (the CI pin), 0.19.0, and current
No engine invariant is in play. There is no second publication door, no snapshot mix, and no Lance behavior change. The Lance 13.0.0 pin is untouched. Other open pull requests are product and RFC work. I do not see one that needs a different linker or a different alias set. A later toolchain bump still goes through this wrapper. The safe fallback is the one this script has now: forward rustc's arguments, including ValidationHead reviewed: GQT cannot see a linker or a Cargo alias. I did not add a
Probe program, output
Alias checks at the head:
Other checks:
The timing table in the pull-request description is the author's macOS measurement. I did not reproduce those wall times. LimitationsI did not run Inline comments
The Give
This The header says every failure is silent. |
What
Faster local and CI build loops, configuration and docs only; no engine or test code changes.
.cargo/config.tomladds thecargo dev-test,dev-nextest,dev-build-testsanddev-clippyaliases, all on the canonical CI graph (omnigraph-engine/failpoints,omnigraph-cluster/failpoints). Moving between them never recompiles a crate for a feature change; subsets are chosen at run time (cargo dev-nextest -E 'package(omnigraph-engine)').target.{x86_64,aarch64}-unknown-linux-gnu.linker = "scripts/cargo-linker.sh"adds-fuse-ld=moldwhen mold is onPATHand runsccunchanged otherwise. Onlylinkeris set (atarget.*.rustflagsentry would replace[build] rustflags), and the linker is not part of any fingerprint. The CI test, lint, nightly and DST jobs installmold; release and publish jobs don't, and link as before.scripts/seed-target.shseeds itstarget/as an APFS copy-on-write clone (cp -c -R -p) of$OMNIGRAPH_WARM_TARGETor of the most recently builttarget/among the repository's worktrees whose ancestor Cargo configs match. It does nothing whentarget/exists, off macOS, or across volumes. It checks for the same APFS volume becausecp -csilently falls back to a full byte copy.-pkeeps mtimes so Cargo still rebuilds workspace crates whose sources differ. A checked-in.claude/settings.jsonSessionStarthook (matcherstartup) runs it for Claude Code sessions;.gitignorenow ignores.claude/*except that file, so.claude/worktrees/stays ignored. Codex and other agents get the instruction from AGENTS.md.docs/dev/local-builds.md(linked from AGENTS.md, which also gains a one-line pointer in Build and test, the dev index and testing.md), a short note in ci.md, and optional shared sccache S3/R2 backend configuration. No buckets or credentials are created.Findings
Integration-test consolidation (test: consolidate integration suites into shared binaries #945) and nextest scheduling (ci: schedule workspace tests with
cargo nextest#930) were already onmain. The standalone engine binaries left today need their own process (failpoints,current_exere-exec, env mutation), apart fromschema_apply,writesandpolicy_engine_chassis. Main'stest-workspace-build-timingsshows those compile in parallel after the engine lib (12.2s, 10.1s), whileintegrationis already 22.3s on the critical path. Folding them in would trade link time for a longer serial step, so they stay as they are.sccache shares only part of a cold build across worktrees: its Rust key hashes the compile's cwd (
src/compiler/rust.rs, step 9, unchanged on main). Cargo compiles registry crates from their own directory, so those can hit, but compiles workspace crates from the workspace root, so they miss in every worktree. Proc-macros, links and build-script runs are never cached.SCCACHE_BASEDIRSis C/C++ only. The CoW target clone reuses all of it.Worktrees nested in the main checkout (
.claude/worktrees/*) build with--cfg tokio_unstabletwice, because Cargo joinsbuild.rustflagsarrays from every ancestor.cargo/config.toml. Their artifact hashes therefore differ from the main checkout's, and a clone of the main checkout'starget/rebuilt all 646 units. The seed script only clones from a worktree with identical ancestor configs. A string-valuedrustflags(which Cargo doesn't join) is not used, because Cargo refuses to merge a string with an array, so every checkout still on the array form would fail to load its config.Measurements
cargo test --no-run -p omnigraph-engine --lockedon this Mac (18 cores, Rust 1.98.0, sccache 0.18). Two other sessions were building at the same time (load 13–40), so absolute times are inflated; the ratios are what matter.target/(sccache: 51% Rust hits)target/cloned from the main checkout (config mismatch)seed-target.shclone (3.9 s)touch crates/omnigraph/src/lib.rstarget/after the engine test build: 9.2 GB. The clone consumed about 0.3 GB of new disk (copy-on-write); the rebuilt workspace crates add the rest.