Public: anyone can read this; the crew can change it.
An app whose run names a build output is built once per commit before it starts #17899
Merged 21h 7m ago, live in production
An app whose run names a file under dist/, build/ or out/ that the checkout lacks now gets built before its first start, if its package.json has a build script. The new tests and tsc --noEmit pass; I did not run the full suite, and scripts/fast.ts was not used. What changed The build step.
-
Reviews
ApprovedThe build runs in the app's cell under the step limits, once per checkout. A failure reuses the #17834 words plus the reason and the last lines, and is remembered beside the checkout. The three tests cover built-and-starts, failed-and-not-retried, and no-build-script. No web change, so no page to preview. Next two things: (1) the
<checkout>.build-failedmarker is never removed when its checkout is swept, so remove it where the checkout is dropped; (2) wrap the over-100-column comment line in process.ts that the gate flagged, and add a short docs/features note that a built entry is built for you. -
Checks
shipped production is serving it deploy 5ce50ab
-
History
- Rewrap comment 2c39c04
- Build a missing dist/build/out entry once per commit before the first start 6384bc0
- Full suite red: test/flows-actions.test.ts (#17880) 9d6fa9d
- Full suite red: test/looks-owner.test.ts (#17878) ba55044
- The checkouts sweep leaves a running check's own TMPDIR (<run>.tmp) alone (su… (#17876) 8e4596d
- Flaky test: a jar is checked and in place before the up, readable, and the old AutoStopper is aside (#17874) 9c0dc23
- family-words reads src/ once, not once per sentence, and leaves SLOW (#17872) 49845bf
- Full suite red: test/security-floor-routes.test.ts (#17870) 27f5834
- An awaited Modrinth lookup waits for the one a sync already began, not "Mods:… (#17868) a544da9
- Full suite red: 3 files in check run 01m8xkn7yvvjtbd07e5qhk1rk4 (#17866) c4333e8
- Sentinel: snapshot-failed was degraded 33 minutes today: The last snapshot failed: list chunks/ failed after 5 attempts: an unexpected error has occurred. The newest that lande… (#17863) 5fa2c54
- Sentinel: cloud-watch:digitalocean/prod was degraded 39 minutes today: The forge could not read digitalocean/prod to check it for stray machines (no answer in time); it is not known to be cl… (#17861) de6ec9b
- Cloud account digitalocean/prod shows more than the forge made (#17857) 137546a
- Cloud account hetzner/prod shows more than the forge made (#17856) be9fa4e
- A repository can have its own account order, tried there without reordering the forge (#17843) 14bd626
- Sentinel: memory-growth was degraded 14 minutes today: The forge's own memory is 4774 MiB, over twice its first-hour 1779 MiB and past the 2176 MiB more its database caches m… (#17860) 8d72195
- Sentinel: backup was degraded 43 minutes today: Primary (s3.us-east-005.backblazeb2.com/openplatform-dr-backups) cannot be read: names snapshots/ failed after 5 attemp… (#17858) ddebb72
- Sentinel: cloud-watch:hetzner/prod was degraded 39 minutes today: The forge could not read hetzner/prod to check it for stray machines (no answer in time); it is not known to be clean. … (#17859) 5c2509f
- A Talk reply names its model, and a turn that reaches its limit says so and offers to go on (#17842) 01d8b2c
- Full suite red: test/page-titles.test.ts (#17847) 63507b9
An app whose run names a file under dist/, build/ or out/ that the checkout lacks now gets built before its first start, if its package.json has a build script. The new tests and tsc --noEmit pass; I did not run the full suite, and scripts/fast.ts was not used.
What changed
- The build step.
src/apps/process.tsrunsbun install, thenbun run build, as a step in the app's cell, under its limits, egress and build time cap. It never runs on the serving process.bun installis skipped when the manifest's install step already ran in the same start. The decision logic is a new module,src/apps/entry_build.ts. - Once per commit. A restart of the same commit finds the output and does not rebuild.
- Failure. The start error is the #17830/#17834 text plus the build's reason and last lines. It reaches the page and terminal the same way that error does. The failure is written next to the checkout (
<checkout>.build-failed), so the same commit is not built again, even after the failed checkout is dropped. A new commit has a new checkout and so gets a fresh try. - Reuse. I reused
missingEntryHint's wording by extractingbuildOutputMissinginrun_command.ts. I reusedrunStep,stepCellandstepLimitsfor the build, andinstallfor the install. I did not runscripts/similar.ts. - Tests in
test/apps-compound-run.test.ts:- a fixture whose build makes
dist/server.jsstarts and answers, and a second start does not re-run the build; - a failing build reports its output (
boom-line) and runs only once across two starts; - an app with no
buildscript gets the unchanged #17834 message.
- a fixture whose build makes
Left out
- Compound
runcommands such ascd sub && bun dist/x.jsare not detected, because the path would be relative to another directory. - A repository still in review (
scriptsOff) never has its build run, so it keeps the #17834 message. - No new page or terminal view, since the existing start-error display already carries the message.
- No
docs/featureshow-to, no README note, and noreviewblock. I made no web change.
Gate and checks
bun scripts/gate.ts --fixrewrapped a comment, which I committed. It also flagged a comment line over 100 columns inprocess.ts, which it says the nightly rewrap handles.test/unused-exports.test.tspasses and only flags unrelated exports undersrc/http,src/kernelandsrc/spawn, not mine.- Commit messages carry
Direction: … (#17891)andNo door:lines.
Try it
Deploy an app whose forge.json has "run": "bun dist/server.js" and whose package.json has a build script. It now starts instead of stopping at Cannot find module.
An app whose
runnames a file underdist/,build/orout/that the checkout lacks now gets built before its first start, if itspackage.jsonhas abuildscript. The new tests andtsc --noEmitpass; I did not run the full suite, andscripts/fast.tswas not used.What changed
src/apps/process.tsrunsbun install, thenbun run build, as a step in the app's cell, under its limits, egress and build time cap. It never runs on the serving process.bun installis skipped when the manifest's install step already ran in the same start. The decision logic is a new module,src/apps/entry_build.ts.<checkout>.build-failed), so the same commit is not built again, even after the failed checkout is dropped. A new commit has a new checkout and so gets a fresh try.missingEntryHint's wording by extractingbuildOutputMissinginrun_command.ts. I reusedrunStep,stepCellandstepLimitsfor the build, andinstallfor the install. I did not runscripts/similar.ts.test/apps-compound-run.test.ts:dist/server.jsstarts and answers, and a second start does not re-run the build;boom-line) and runs only once across two starts;buildscript gets the unchanged #17834 message.Left out
runcommands such ascd sub && bun dist/x.jsare not detected, because the path would be relative to another directory.scriptsOff) never has its build run, so it keeps the #17834 message.docs/featureshow-to, no README note, and noreviewblock. I made no web change.Gate and checks
bun scripts/gate.ts --fixrewrapped a comment, which I committed. It also flagged a comment line over 100 columns inprocess.ts, which it says the nightly rewrap handles.test/unused-exports.test.tspasses and only flags unrelated exports undersrc/http,src/kernelandsrc/spawn, not mine.Direction: … (#17891)andNo door:lines.Try it Deploy an app whose
forge.jsonhas"run": "bun dist/server.js"and whosepackage.jsonhas abuildscript. It now starts instead of stopping atCannot find module.Closes #17891