Watch
1
0
Fork
You've already forked want2
0
Want Build System: Version 2 [WIP]
  • Zig 92.5%
  • SourcePawn 4.7%
  • C 1.6%
  • JavaScript 0.5%
  • CSS 0.3%
  • Other 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Brendon Carroll 28e2c8029a jsonout: canonical mycelium bytes; arena-load replay trees
Review follow-ups:

- Mycelium values are embedded in their canonical packed form, never
  decomposed into JSON objects: a job_done outcome value is the 68-byte
  myc.asBytes(myc.AnyValue) encoding (no struct padding), a spawned
  event's input is the same AnyValue encoding, and `task` is the
  canonical packed sys.Task bytes (op followed by the input, 100 bytes:
  std.mem.asBytes' padded 112-byte layout would leak trailing padding
  into the stream).
- Replay trees are loaded into the sweep's arena: System.loadJob and
  Job.initDone now take the allocator that owns the restored tree, and
  Job.deinit returns children storage through it. The reporter passes
  the sweep arena, so every producer tree loaded while emitting a sweep
  is reclaimed in one arena deinit after its events went out to stdout;
  Job.deinit still closes the restored scratch dirs on the way.
- Event payloads stay stack references (task/input/result slices alias
  locals in the emit functions); only the dedup maps outlive a sweep.

cmd: add --json to build/build-git, replaying cached job trees

`want build --json` and `want build-git --json` replace the tty job tree
with JSON Lines on stdout: one jsonout.Event per line
(job_spawned/job_queued/job_running/job_done), tagged unions written as a
single field naming the variant, with a reference client (readEvent)
that rejects invalid unions. Events are derived from the timestamps the
job system records and the reporter's final sweep emits every transition
the polls missed, so a build that finished before the first poll still
produces the full sequence.

A job whose result came from the task cache links its producer
(job_done.outcome.ok.cached_from: the producer's fqid and transition
times) and the reporter replays the producer's recorded subtree from the
state dir, so a warm build that changed nothing still emits the complete
event tree of the run that did the work. Spawned events carry the job's
parent relation (parent fqid plus the child's handle).

Supporting sys changes:

- Jobs persist a `done` record (transition times, limits, outcome) into
  their scratch dir at finish; Job.initDone loads it and System.loadJob
  restores any job's recorded tree for the replay.
- The parent's on-disk `children` file is now the handle table: Job.spawn
  writes the child's record at handle*record_size in the same critical
  section as the in-memory append, and initDone restores handles from the
  record offsets, so a skipped child cannot shift its siblings' handles.
  _spawn no longer read-modify-writes the file (also dropping its
  256-child cap) and no longer blocks on the parent dir under system.lock.

Under --json, stdout stays parseable JSONL: importer progress, std.log,
and a failed build's log dump go to stderr.
2026-10-20 11:03:30 -04:00
build stdlib: move cloudflare and github under com 2026-10-19 14:43:15 -04:00
doc stdlib: move cloudflare and github under com 2026-10-19 14:43:15 -04:00
etc etc/zed: bump pinned commit 2026-10-14 14:34:55 -04:00
example stdlib: move cloudflare and github under com 2026-10-19 14:43:15 -04:00
src jsonout: canonical mycelium bytes; arena-load replay trees 2026-10-20 11:03:30 -04:00
stdlib stdlib: move cloudflare and github under com 2026-10-19 14:43:15 -04:00
tool stdlib: move cloudflare and github under com 2026-10-19 14:43:15 -04:00
vendor build: per-executor exec-* test steps 2026-09-29 22:11:07 -04:00
www build/www.want: set project_name 2026-10-16 15:04:21 -04:00
.gitignore want: overhaul core build system 2026-09-28 22:54:14 -04:00
.wantignore want: fix build 2026-09-23 15:44:03 -04:00
build.zig sys,exec: shield container scratch cleanup from cancellation 2026-10-18 16:30:41 -04:00
build.zig.zon sys,exec: shield container scratch cleanup from cancellation 2026-10-18 16:30:41 -04:00
DESIGN.md want: module deps, WANT preamble, bare lambda bodies, want init 2026-09-30 19:44:18 -04:00
DEV.md tests: keep test diagnostics off the harness stderr 2026-10-13 14:06:46 -04:00
SKILL.md jsonout: canonical mycelium bytes; arena-load replay trees 2026-10-20 11:03:30 -04:00
WANT www: add the wantbuild.io examples site 2026-10-16 13:08:43 -04:00
want.sh want: overhaul core build system 2026-09-28 22:54:14 -04:00
WoW.md WoW 2026-09-28 16:50:27 -04:00