Skip to content

Commit dfe1130

Browse files
committed
fix(mise): serialize elm builds to prevent ~/.elm cache race on Windows
Concurrent elm make processes on a cold ~/.elm package cache cause non-deterministic failures on Windows — elm's package store is not concurrent-write-safe. Fix: - build:cli runs CLI.elm then DevCLI.elm sequentially (same elm.json, would otherwise race on cold cache packages like elm/bytes, elm/file) - build:cli2, build:dev-server, build:try-morphir now depend on build:cli, so the cli/ package cache is fully warm before they start
1 parent 98d37fb commit dfe1130

4 files changed

Lines changed: 12 additions & 14 deletions

File tree

.mise/tasks/build/cli.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@ import { elmMake, log, PATHS } from "../_lib.ts";
66

77
log("build:cli", "Compiling CLI Elm modules...");
88

9-
// Build both CLI and DevCLI in parallel
10-
await Promise.all([
11-
elmMake(["src/Morphir/Elm/CLI.elm"], {
12-
cwd: PATHS.cli,
13-
output: "Morphir.Elm.CLI.js",
14-
}),
15-
elmMake(["src/Morphir/Elm/DevCLI.elm"], {
16-
cwd: PATHS.cli,
17-
output: "Morphir.Elm.DevCLI.js",
18-
}),
19-
]);
9+
// Sequential: concurrent elm make on a cold ~/.elm cache causes race conditions on Windows
10+
await elmMake(["src/Morphir/Elm/CLI.elm"], {
11+
cwd: PATHS.cli,
12+
output: "Morphir.Elm.CLI.js",
13+
});
14+
await elmMake(["src/Morphir/Elm/DevCLI.elm"], {
15+
cwd: PATHS.cli,
16+
output: "Morphir.Elm.DevCLI.js",
17+
});
2018

2119
log("build:cli", "Done");

.mise/tasks/build/cli2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bun
22
//MISE description="Build CLI2 (TypeScript + Elm in parallel)"
3-
//MISE depends=["build:check-elm-docs"]
3+
//MISE depends=["build:cli"]
44

55
import { elmMake, log, PATHS, join } from "../_lib.ts";
66
import { mkdir, rm } from "fs/promises";

.mise/tasks/build/dev-server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bun
22
//MISE description="Build development server Elm components"
3-
//MISE depends=["build:check-elm-docs"]
3+
//MISE depends=["build:cli"]
44

55
import { elmMake, log, PATHS } from "../_lib.ts";
66

.mise/tasks/build/try-morphir.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bun
22
//MISE description="Build Try Morphir web app"
3-
//MISE depends=["build:check-elm-docs"]
3+
//MISE depends=["build:cli"]
44

55
import { elmMake, log, PATHS } from "../_lib.ts";
66

0 commit comments

Comments
 (0)