Commit 1956c36
authored
fix(mise): orchestrate elm builds serially to eliminate Windows race (#1281)
* fix(mise): orchestrate elm builds serially to eliminate Windows race
When the elm package cache (~/.elm) or per-project elm-stuff/ is cold,
multiple concurrent `elm make` invocations race on
~/.elm/<package>/artifacts.dat and the shared elm-stuff/ files,
producing the "PROBLEM BUILDING DEPENDENCIES" failure that's been
intermittently breaking the Windows CI build (e.g. PR #1280's
26558683076 and 26559185295 runs). Linux mostly avoids it thanks to
friendlier file-locking semantics but the underlying race is the same.
The previous round of fixes added `//MISE depends=` headers expecting
mise to serialize tasks. mise reads those headers but its scheduler
parallelizes any tasks whose deps are satisfied — both Linux and
Windows CI logs show cli, cli2, dev-server, try-morphir, and treeview
starting within ~1ms of each other after check-elm-docs finishes. The
recent passing runs were the race coming out the other way, not a
real fix.
Changes:
- .mise/tasks/build.ts: drive the elm-touching tasks via an explicit
`mise run --skip-deps <task>` chain (check-elm-docs → cli → cli2 →
dev-server → try-morphir → components → morphir-ts). --skip-deps stops
each subtask from re-running its own declared deps. treeview (webpack
only) runs in parallel alongside the chain.
- .mise/tasks/build/dev-server.ts: serialize its three internal elm
makes — they all target cli/elm.json, so the same race that motivated
the build:cli serialization applies to them.
morphir-ts is in the elm chain because it invokes elm indirectly via
node-elm-compiler in cli/morphir-elm.js (visible as "Compiled in DEV
mode" in its output). Verified locally on Windows with a cold elm-stuff:
full build completes successfully.
* feat(mise): declare sources/outputs for incremental rebuilds
Add `//MISE sources=[...]` / `outputs=[...]` to every build subtask so
mise can skip a task whose inputs haven't changed. The orchestration in
build.ts already invokes each subtask via `mise run --skip-deps`, so the
freshness check kicks in on every step independently.
Cold rebuild from a clean tree still does the full work serially. Warm
rebuild with no source changes finishes in seconds (mise reports
"sources up-to-date, skipping" for each elm task). Touching a single
.elm file rebuilds only the affected tasks — for example, touching
cli/src/Morphir/Web/TryMorphir.elm reruns cli, dev-server, try-morphir,
components, and morphir-ts but leaves check-elm-docs, cli2, and treeview
skipped.
Notes:
- Patterns are deliberately broad (`src/**/*.elm`, `cli/src/**/*.elm`)
rather than module-precise. elm tracks transitive imports itself, so
conservative globs trade a few extra rebuilds for safety.
- build:components has no sources/outputs because its output overlaps
its input (concat insight.js + morphir-insight-element.js → insight.js),
which would make mtime-based freshness ambiguous. It's a fast concat
and always re-runs.
- Removed the Promise.all that ran build:treeview alongside the elm
chain — the speedup was marginal and the fully serial form is easier
to reason about now that each subtask gets independent freshness
caching.1 parent fbdd89f commit 1956c36
8 files changed
Lines changed: 56 additions & 21 deletions
File tree
- .mise/tasks
- build
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
4 | 3 | | |
5 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
6 | 30 | | |
7 | 31 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
27 | 26 | | |
28 | 27 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
0 commit comments