Skip to content

Commit ba7eabc

Browse files
fix(dagger): preserve container state between build steps
Each withExec creates a new container - must save it to preserve build output (dist/ folders) for subsequent steps. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 6e3aee7 commit ba7eabc

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

.dagger/src/index.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,17 +208,23 @@ export class Monorepo {
208208
// Build web packages in dependency order first
209209
// Bun's --filter runs packages in parallel, which breaks when packages depend on
210210
// each other's dist/ output for type declarations
211-
await container.withExec(["bun", "run", "--filter", "@mux/shared", "build"]).sync();
212-
await container.withExec(["bun", "run", "--filter", "@mux/client", "build"]).sync();
213-
await container.withExec(["bun", "run", "--filter", "@mux/frontend", "build"]).sync();
211+
// IMPORTANT: Must update container after each step to preserve build output
212+
container = container.withExec(["bun", "run", "--filter", "@mux/shared", "build"]);
213+
await container.sync();
214+
container = container.withExec(["bun", "run", "--filter", "@mux/client", "build"]);
215+
await container.sync();
216+
container = container.withExec(["bun", "run", "--filter", "@mux/frontend", "build"]);
217+
await container.sync();
214218

215219
// Now build remaining packages (web packages already built, will be skipped or fast)
216220
// Note: Skip tests here - bun-decompile tests fail in CI (requires `bun build --compile`)
217-
await container.withExec(["bun", "run", "build"]).sync();
221+
container = container.withExec(["bun", "run", "build"]);
222+
await container.sync();
218223
outputs.push("✓ Build");
219224

220225
// Typecheck all packages
221-
await container.withExec(["bun", "run", "typecheck"]).sync();
226+
container = container.withExec(["bun", "run", "typecheck"]);
227+
await container.sync();
222228
outputs.push("✓ Typecheck");
223229

224230
// Birmel CI (typecheck, lint, test in parallel)

0 commit comments

Comments
 (0)