You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Preparing the SDK provider cache takes about 17 minutes, and any change to the compiler checkout triggers the whole thing. Two independent causes, both structural.
The cache key hashes the entire compiler source tree.sdk_provider_store_identity hashes the whole checkout when one is present, excluding only .git, target, and .github. Editing any file invalidates all ten components — including files that cannot affect how a stdlib component compiles, such as src/oven/, src/lsp/, and tests/.
The current design is a deliberate correction of an earlier one, and its own comment says why: "hashing development executable bytes would make identical source checkouts miss after unrelated test builds." Moving from executable bytes to a source hash removed spurious misses from non-reproducible binaries. It over-corrected: now every edit anywhere is a certain miss.
Preparation is all-or-nothing. There is one identity for the whole store and one staging directory. Components have no identity of their own, so a change anywhere rebuilds all ten regardless of what it touched.
The shape that is being thrown away
The components already declare a one-directional dependency graph in sdk-components.toml, and publication_order() already topologically sorts it:
Ten components, four levels. That graph is currently used only to order a strictly serial for loop, then discarded.
Giving each component an identity over its own source plus its dependencies' identities makes invalidation follow the graph:
change stdlib-web source → rebuild web alone, since nothing depends on it
change stdlib-core → rebuild everything, which is correct, because everything depends on it
change src/oven/rustc/inspection.rs → rebuild nothing, because no component's inputs changed
This is the same content-addressed reasoning the compiler is adopting for compilation units, applied one level up to component preparation: prove whether an input changed rather than assume it did.
Suggested order
Narrow the compiler-source hash to what can affect a component build — the frontend, IR, emission, and provider paths plus the stdlib source. Exclude tests/ explicitly; test code cannot change a component's output, and excluding it directly serves the original motivation quoted above. Cheapest change and it removes most invalidation in practice.
Give each component its own identity over its source and its dependencies' identities, and reuse per component rather than per store.
Build each dependency level concurrently. The order is already computed; only the loop is serial. Bounded by the critical path core → system → data → web rather than by the component count.
Verification
The failure mode for 1 and 2 is a stale component producing a wrong build, so both need a miss/hit test: edit an excluded file and confirm a hit, edit an included one and confirm a miss, and confirm that changing a leaf component does not rebuild its dependencies while changing core rebuilds everything downstream.
Environment
Compiler built from 0.6.0-dev.4 at 0a8395835
Measured while iterating on compiler fixes for the Incan-authored Oven control plane (feature - RFC 119 native Rust facets and direct-rustc planning #1037). The loop was: edit compiler, build (~2 min), 17 min SDK re-preparation, test. Every compiler edit paid it, including edits to src/oven/ that cannot reach stdlib compilation.
stdlib-web is the heaviest component by a wide margin: its dependency closure is 53 packages against 20 for the default async,json,ordinal set, and it is last on the critical path.
Area
Tooling (CLI/formatter/test runner)
Summary
Preparing the SDK provider cache takes about 17 minutes, and any change to the compiler checkout triggers the whole thing. Two independent causes, both structural.
The cache key hashes the entire compiler source tree.
sdk_provider_store_identityhashes the whole checkout when one is present, excluding only.git,target, and.github. Editing any file invalidates all ten components — including files that cannot affect how a stdlib component compiles, such assrc/oven/,src/lsp/, andtests/.The current design is a deliberate correction of an earlier one, and its own comment says why: "hashing development executable bytes would make identical source checkouts miss after unrelated test builds." Moving from executable bytes to a source hash removed spurious misses from non-reproducible binaries. It over-corrected: now every edit anywhere is a certain miss.
Preparation is all-or-nothing. There is one identity for the whole store and one staging directory. Components have no identity of their own, so a change anywhere rebuilds all ten regardless of what it touched.
The shape that is being thrown away
The components already declare a one-directional dependency graph in
sdk-components.toml, andpublication_order()already topologically sorts it:Ten components, four levels. That graph is currently used only to order a strictly serial
forloop, then discarded.Giving each component an identity over its own source plus its dependencies' identities makes invalidation follow the graph:
stdlib-websource → rebuildwebalone, since nothing depends on itstdlib-core→ rebuild everything, which is correct, because everything depends on itsrc/oven/rustc/inspection.rs→ rebuild nothing, because no component's inputs changedThis is the same content-addressed reasoning the compiler is adopting for compilation units, applied one level up to component preparation: prove whether an input changed rather than assume it did.
Suggested order
tests/explicitly; test code cannot change a component's output, and excluding it directly serves the original motivation quoted above. Cheapest change and it removes most invalidation in practice.core → system → data → webrather than by the component count.Verification
The failure mode for 1 and 2 is a stale component producing a wrong build, so both need a miss/hit test: edit an excluded file and confirm a hit, edit an included one and confirm a miss, and confirm that changing a leaf component does not rebuild its dependencies while changing
corerebuilds everything downstream.Environment
0.6.0-dev.4at0a8395835src/oven/that cannot reach stdlib compilation.stdlib-webis the heaviest component by a wide margin: its dependency closure is 53 packages against 20 for the defaultasync,json,ordinalset, and it is last on the critical path.