viteBuild takes WEBAWESOME_NPM_TOKEN from the Mill daemon, so a daemon started without it breaks dashboard builds in a fresh worktree #544
Labels
No labels
agent-ready
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-human
needs-input
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli#544
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
frontend.viteBuildruns Yarn with the Mill daemon's environment, not the environment of the shell that asked for the build. When the daemon was started withoutWEBAWESOME_NPM_TOKEN, every dashboard build in a fresh worktree fails, and it keeps failing after you fix your shell, until the daemon is shut down.Where
build.mill,frontend.viteBuild:"Inherited" means inherited from the daemon process.
dashboard/frontend/.yarnrc.ymlneeds the token, so Yarn stops with:Reproduction (2026-09-11)
dashboard/frontend/node_modules, no built assembly), the first./millcall came from a shell without the token, so the daemon started without it../iw ./testthen faileddashboard.test,dashboard.itest.testForked,dashboard-dev-gate.bats,dashboard-dev-mode.batsanddispatcher-mill-gate.bats: 17 failing cases, all on the error above. No test assertion failed./proc/<daemon pid>/environhad noWEBAWESOME_NPM_TOKEN../mill shutdownand a rerun from that shell, the new daemon had the token, and all five passed (18/18 BATS cases).The main checkout rarely shows this, because its frontend is already built and cached, so Yarn never runs there.
Why it is costly
The error names a missing environment variable, and the reader checks their shell: the variable is there, exported. The actual cause — a long-lived process that kept the environment it first started with — is invisible. #526 records the same trap with sbtn's server, and #494 is another case of the Mill daemon's environment causing a confusing failure.
Possible fixes
./mill shutdownand retry from a shell that exports it."Type: bug
Found while: running the full gate for branch
wip/zg-index-setupIntake: needs-human
Workflow: diagnostic
Reason: G1 — a CLARIFY marker stands, but review found it spurious (a fake-yarn test under MILL_OUTPUT_DIR needs no licensed token, so no test-skip authorisation is needed); review also failed G7 unsound on a false no-cache-invalidation claim
Analysis: project-management/issues/IW-544/analysis.md on branch IW-544
Intake: needs-input
Workflow: diagnostic
Reason: G7 (2 blocking findings of the analysis review); the G1 marker is settled by the code
Analysis: project-management/issues/IW-544/analysis.md on branch IW-544
yarnfirst onPATH, driving the realfrontend.viteBuild— would cache an emptyout/frontend/viteBuild.dest. The reviewer showed thatMILL_OUTPUT_DIR(supported by the pinned Mill 1.1.5, and read by the repository's own launcher atmill:139) moves the wholeouttree, the daemon included, into a scratch directory, so Option B needs no licensed token, cannot poison the real cache, and needs no authorisation. Second: the analysis says the fix "does not alter task inputs, so no cache is invalidated"; the reviewer showed that a changedviteBuildbody re-runsviteBuild, so every developer's next dashboard build after the fix runsyarn install+yarn buildand needsWEBAWESOME_NPM_TOKEN. What should intake do with the analysis? Options: a) correct both: take Option B underMILL_OUTPUT_DIRas the automated test, and state the one-time rebuild (and its token need) as a cost of the fix, then review the analysis again b) correct the cache claim only, and keep Option A with your authorisation to ship without an automated red-then-green test c) leave the analysis as it is and send the issue to a session Recommended: a)Answer in a comment on this issue; intake reads it on its next iteration.
Drop it now.