Skip to content

chore: dedupe build.zig (-79 lines)#90

Merged
MatteoMer merged 1 commit into
mainfrom
chore/build-zig-dedup
May 4, 2026
Merged

chore: dedupe build.zig (-79 lines)#90
MatteoMer merged 1 commit into
mainfrom
chore/build-zig-dedup

Conversation

@MatteoMer

Copy link
Copy Markdown
Owner

Summary

Three duplications in build.zig collapsed into one shape each, no behavior change:

  • 14 example/bench scaffolding blocks → single addZoltExe helper. Each block was 13 lines of addExecutable + addRunArtifact + b.step + dependOn; now ~9 lines of named-options.
  • WASM export symbol list was duplicated across the atomics and non-atomics branches. Now expressed as base ++ TLS-extras so the shared 15 symbols live in one place.
  • zig fmt path list appeared in both the fmt step and the ci step's fmt_check. Lifted into a top-level fmt_paths constant.

Net: 646 → 567 lines (-79).

Test plan

  • zig build passes
  • zig build example-field builds and runs successfully
  • zig fmt --check build.zig clean
  • zig build --help still lists all 14 example/bench steps

🤖 Generated with Claude Code

Three duplications collapsed into one shape each:

- 14 nearly-identical example/bench scaffolding blocks now go through a
  single addZoltExe helper (executable + run step + step alias).
- WASM export symbol list was duplicated between the atomics and
  non-atomics branches; now expressed as base ++ TLS-extras.
- The zig fmt path list lived in two places (fmt step and ci step's
  fmt_check); lifted into a shared fmt_paths constant.

No behavior change. zig build, zig build example-field, and
zig fmt --check build.zig all pass; all 14 example/bench steps still
appear in zig build --help.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MatteoMer MatteoMer merged commit 34fa61c into main May 4, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant