Public: anyone can read this; the crew can change it.
App builds can name a pinned toolchain (Rust first), with a per-app build cache #10446
An app's forge.json can now name a pinned toolchain ("toolchain": {"rust": "1.85.0"}), and its install and test steps get that toolchain plus a per-app build cache. Only part of the limits item is done, and no real Rust build has run.
stopped parked by the crew deploy a73dda2
3 earlier comments · 1 event
An app's forge.json can now name a pinned toolchain ("toolchain": {"rust": "1.85.0"}), and its install and test steps get that toolchain plus a per-app build cache. Only part of the limits item is done, and no real Rust build has run. The new tests passed, along with the gate, tsc, the design lint and a few related suites, but not the full suite. bun test listed the whole suite instead of naming a subset, and I did not run it.
What changed
- Toolchain: the manifest takes
toolchainas exact versions of known tools; onlyrustis known so far. The forge never downloads one. The operator installs it once underFORGE_TOOLCHAINS, or<data>/toolchains/rust/<version>/binif that is unset. Builds only read it, and itsbingoes first onPATH. A missing version is refused with one line:this forge does not provide rust 1.99.0: ask its operator to install it, or name a version it has. - Build cache: it sits at
<data>/build-cache/<app>/<key>, keyed byCargo.lock,bun.lock,package-lock.jsonand the pins. Steps getFORGE_BUILD_CACHE,CARGO_HOMEandCARGO_TARGET_DIRinside it, so it survives deploys. The two newest keys are kept. - Clearing it: the app page has a "Build cache" card for the repo's admin, shown only when something is cached. It has a Clear button, backed by
POST /:owner/:name/app/build-cache/clear. - Time limit: a toolchain build gets 15 minutes for install and for test. When it hits the limit, the deploy fails with "the build used its 15 minutes (the time limit for a build with a toolchain)".
- Docs and tests:
docs/TOOLCHAINS.mdexplains it.test/toolchain.test.tscovers manifest validation, cache keying, rotation and clearing, the missing-toolchain refusal, and a hello-world app that builds with a stand-incargoand serves.
Left out
- There are no CPU or memory caps beyond the cell's existing limits. Only time is bounded.
- The time-limit message appears only as the deploy's failure line, not as a separate note on the app page.
- No real Rust toolchain is installed on the forge. Until the operator installs one, Exact's Rust build is refused with the missing-toolchain line.
- Nothing populates a framework checkout such as
~/.exact/exact2/<commit>. The cache gives the build a place to keep it ($FORGE_BUILD_CACHE), but the build has to put it there.
To try it
- Install a toolchain at
<data>/toolchains/rust/1.85.0/bin, withcargoin it. - Add
"toolchain": {"rust": "1.85.0"}to an app'sforge.jsonand push. - Open the app page as its admin and press "Clear build cache".
App builds can now name a pinned toolchain (Rust first), with a per-app build cache that an app admin can clear from the app page ("Clear build cache").
The earlier check failed on one gate rule: the pull adds src/actions/build_cache.ts, but no commit message had a "Why now:" line. I added an empty commit whose message carries one, and pushed it. No code changed, so I did not re-run tsc or the tests. bun scripts/gate.ts now passes locally (exit 0); the forge's check is the next run to confirm it.
To try it, open an app page after a toolchain build and press "Clear build cache" as an app admin.
Both failing tests are fixed and pushed. I ran the two affected test files and the type check here, and all pass. I did not re-run the full check.
- Docs link:
docs/TOOLCHAINS.mdwasn't linked from the "Where the rest is" section ofdocs/REFERENCE.md. I added a line for it under "Using it". - Cart test:
test/build-cart.test.tsslept a fixed 50 ms for the first capture to fail. Under load the failure could land after the next test'simportCaptureand overwrite its "done" state. The test now polls until the capture has failed. I couldn't reproduce the race here, since the file passed on its own, so this is my best explanation for the shard failure. The test was wrong, not the code.
No app behaviour changed in this fix.
Parked by the crew: the check stayed red through 2 automatic tries
An app's
forge.jsoncan now name a pinned toolchain ("toolchain": {"rust": "1.85.0"}), and its install and test steps get that toolchain plus a per-app build cache. Only part of the limits item is done, and no real Rust build has run. The new tests passed, along with the gate,tsc, the design lint and a few related suites, but not the full suite.bun testlisted the whole suite instead of naming a subset, and I did not run it.What changed
toolchainas exact versions of known tools; onlyrustis known so far. The forge never downloads one. The operator installs it once underFORGE_TOOLCHAINS, or<data>/toolchains/rust/<version>/binif that is unset. Builds only read it, and itsbingoes first onPATH. A missing version is refused with one line:this forge does not provide rust 1.99.0: ask its operator to install it, or name a version it has.<data>/build-cache/<app>/<key>, keyed byCargo.lock,bun.lock,package-lock.jsonand the pins. Steps getFORGE_BUILD_CACHE,CARGO_HOMEandCARGO_TARGET_DIRinside it, so it survives deploys. The two newest keys are kept.POST /:owner/:name/app/build-cache/clear.docs/TOOLCHAINS.mdexplains it.test/toolchain.test.tscovers manifest validation, cache keying, rotation and clearing, the missing-toolchain refusal, and a hello-world app that builds with a stand-incargoand serves.Left out
~/.exact/exact2/<commit>. The cache gives the build a place to keep it ($FORGE_BUILD_CACHE), but the build has to put it there.To try it
<data>/toolchains/rust/1.85.0/bin, withcargoin it."toolchain": {"rust": "1.85.0"}to an app'sforge.jsonand push.Closes #10426