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

Parked opened this in answer to
Closed without merging

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.

Notes

stopped parked by the crew deploy 435f151

opened this

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.json can name "toolchain": {"rust": "1.xx"}. An app naming a toolchain the forge doesn't have is refused with one plain line. The code is in src/apps/toolchain.ts and src/apps/manifest.ts, wired into the build and test steps in src/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.ts and src/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.md is linked from docs/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.ts only 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.

Closes #10426

3 earlier comments
commented

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.json can name "toolchain": {"rust": "1.xx"}. An app naming a toolchain the forge doesn't have is refused with one plain line. The code is in src/apps/toolchain.ts and src/apps/manifest.ts, wired into the build and test steps in src/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.ts and src/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.md is linked from docs/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.ts only 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.

commented

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.json still listed src/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.

commented

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 main commit, the one that lets a child forge's cell reach api.anthropic.com. That left src/core/capacity.ts and test/spawn-cell.test.ts behind main. 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 tsc are 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.ts changes 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

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs