Skip to content

Support Zig 0.17 alongside 0.16 - #2

Merged
lalinsky merged 1 commit into
mainfrom
zig-0.17-compat
Oct 4, 2026
Merged

lalinsky merged 1 commit into
mainfrom
zig-0.17-compat

Conversation

@lalinsky

@lalinsky lalinsky commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Makes json.zig build and test on both Zig 0.16 and 0.17.

  • Zig 0.17 replaced fields in @typeInfo with parallel field_names/field_types/field_attrs slices. New internal src/compat.zig presents the 0.16 shape (structFields, unionFields) on both versions; enums use std.meta.fieldNames.
  • build.zig: forward run args with addPassthruArgs (0.17) or b.args (0.16); pass the conformance suite with addOptionPathDirectory when available, since 0.17's addOptionPath expects a file
  • StaticBitSet.initEmpty() → .empty
  • Tests: replace the removed ** operator with @splat
  • CI matrix on 0.16.0 and 0.17.0; README and CHANGELOG updated

Locally on both versions: 57/57 tests pass, zig fmt --check is clean, and zig build conformance output is identical.

Zig 0.17 replaced the `fields` slice in `@typeInfo` with parallel
`field_names`/`field_types`/`field_attrs` slices. Add an internal compat
module that presents the 0.16 shape on both versions and route struct
and union reflection through it; enums use `std.meta.fieldNames`.

In build.zig, forward run arguments with `addPassthruArgs` and pass the
conformance suite with `addOptionPathDirectory` when available. Also
replace `StaticBitSet.initEmpty()` with `.empty` and the removed `**`
operator in tests with `@splat`. CI now runs on 0.16.0 and 0.17.0.
@lalinsky
lalinsky merged commit 0813fe1 into main Oct 4, 2026
4 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