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 #10483
Pinned toolchain for app builds (Rust first), with a per-app build cache. I can't tell why the earlier check was red: I didn't have its log. The work from the closed pull #10446 was unchanged and fell behind main, so I merged origin/main into the branch and fixed nothing else.
stopped parked by the crew deploy 435f151
3 earlier comments
Pinned toolchain for app builds (Rust first), with a per-app build cache. I can't tell why the earlier check was red: I didn't have its log. The work from the closed pull #10446 was unchanged and fell behind main, so I merged origin/main into the branch and fixed nothing else. After the merge, scripts/gate.ts, tsc --noEmit and scripts/design-lint.ts are clean. test/toolchain.test.ts and test/build-cart.test.ts pass, and so do the other tests that touch app processes, manifests and the studio app page (227 pass, 31 skipped, 0 fail). I did not run the whole suite; the forge's check does that on this push.
- Toolchain:
forge.jsoncan name"toolchain": {"rust": "1.xx"}. An app naming a toolchain the forge doesn't have is refused with one plain line. The code is insrc/apps/toolchain.tsandsrc/apps/manifest.ts, wired into the build and test steps insrc/apps/process.ts. - Build cache: it is kept per app, keyed by lockfiles and pins, and survives deploys. The owner clears it from the app page with a "Clear build cache" button. The code is in
src/apps/build_cache.ts,src/actions/build_cache.tsandsrc/web/studio/build_cache.ts. - Limits: CPU, memory and time are bounded for a build, and the app page names the limit when one is hit.
- Docs:
docs/TOOLCHAINS.mdis linked fromdocs/REFERENCE.md.
Left out:
- Only Rust is supported.
- I did not run a real cargo build in the sandbox, because it cannot download a toolchain. The "Rust hello-world builds and serves" case is covered by
test/toolchain.test.tsonly as far as the sandbox allows.
Try it: put "toolchain": {"rust": "<version>"} in an app's forge.json and push. Then open the app page as an admin and press Clear build cache.
If the check goes red again, send me its log.
Pushed a fix for two of the six failures. Two of the other four pass here but failed in the forge's sharded run. The last two I didn't investigate.
The two I fixed were already failing on main and had nothing to do with the toolchain change:
an allowed module that has become reached leaves the list:scripts/unreached-allow.jsonstill listedsrc/kernel/why_now.ts, which no longer exists. I removed the entry.child quota > room for small but not large is refused only for large: a small forge now holds 2048 MiB (src/spawn/sizes.ts), so the test's 2000 MiB limit fit nothing. I raised the limit to 4096. A small forge now fits and a large one (8192 MiB) still doesn't.
The gate and tsc printed nothing when I ran them before pushing. The rerun of test/unreached.test.ts and test/child-quota.test.ts passes.
Passed here, failed in the sharded check: a signed-out page showing a flash carries no ETag and is never a 304, a signed-out 404 carries no ETag (both in test/etag.test.ts) and the red-main test in test/red-main.test.ts. I think these depend on shard ordering or shared state. Nothing I changed touches them. I haven't confirmed that, and I left them alone.
Not looked at: a real child forge > boots in its own forge:<name> cell…. It needs a real cell, which this sandbox skips. The merge from origin/main pulled in a95789f9f, a change to child-forge shutdown, which may be related.
If the forge's check still fails on those, its log will show it.
Apps can now name a pinned toolchain in their manifest, and the build cache is kept and can be cleared. That is the same change as before. This push only re-merges origin/main, because I think the two failing child-forge tests failed on a stale base.
- Cause I found: the branch lacked a newer
maincommit, the one that lets a child forge's cell reachapi.anthropic.com. That leftsrc/core/capacity.tsandtest/spawn-cell.test.tsbehindmain. I believe the two failures were the child-forge cell tests running on that stale base, but I could not confirm it. - Not run here: the two failing tests are skipped in this sandbox, because they need a real unix-socket cell. I could not reproduce the failures or confirm the fix directly. The forge's check on this push will show whether they pass.
- Run here: the gate script and
tscare clean. The spawn-cell, toolchain, child-quota and unreached tests pass: 39 pass, 3 skipped, 0 fail. - If they fail again: the log should say whether my
src/apps/process.tschanges touch the child boot path, which I did not check.
To try it: the toolchain format is in docs/TOOLCHAINS.md. Clearing the build cache is a POST to /:owner/:name/app/build-cache/clear.
🤖 Generated with Claude Code
Parked by the crew: the check stayed red through 2 automatic tries
Pinned toolchain for app builds (Rust first), with a per-app build cache. I can't tell why the earlier check was red: I didn't have its log. The work from the closed pull #10446 was unchanged and fell behind
main, so I mergedorigin/maininto the branch and fixed nothing else. After the merge,scripts/gate.ts,tsc --noEmitandscripts/design-lint.tsare clean.test/toolchain.test.tsandtest/build-cart.test.tspass, and so do the other tests that touch app processes, manifests and the studio app page (227 pass, 31 skipped, 0 fail). I did not run the whole suite; the forge's check does that on this push.forge.jsoncan name"toolchain": {"rust": "1.xx"}. An app naming a toolchain the forge doesn't have is refused with one plain line. The code is insrc/apps/toolchain.tsandsrc/apps/manifest.ts, wired into the build and test steps insrc/apps/process.ts.src/apps/build_cache.ts,src/actions/build_cache.tsandsrc/web/studio/build_cache.ts.docs/TOOLCHAINS.mdis linked fromdocs/REFERENCE.md.Left out:
test/toolchain.test.tsonly as far as the sandbox allows.Try it: put
"toolchain": {"rust": "<version>"}in an app'sforge.jsonand push. Then open the app page as an admin and press Clear build cache.If the check goes red again, send me its log.
Closes #10426