Skip to content

Support Zig 0.17 alongside 0.16 - #49

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 msgpack.zig build and test on both Zig 0.16 and 0.17.

  • Zig 0.17 replaced fields/decls in @typeInfo with parallel field_names/field_types/field_attrs/decl_names slices. New internal src/compat.zig presents the 0.16 shape (structFields, unionFields, declNames) on both versions; struct.zig, union.zig and the smoke-test coverage check use it.
  • std.meta.Int → @Int, StaticBitSet.initEmpty() → .empty
  • Tests: replace the removed ** operator with @splat
  • CI matrix on 0.16.0 and 0.17.0; README and CHANGELOG updated

187/187 tests pass locally on both versions.

Note: 0.17's zig fmt rewrites @intFromEnum to @backingInt, which 0.16 doesn't have, so src/enum.zig is only zig fmt clean under 0.16. CI doesn't run zig fmt --check, but ./check.sh should be run with 0.16 until 0.16 support is dropped.

Summary by CodeRabbit

  • New Features
    • Added support for Zig 0.17 alongside Zig 0.16.
  • Documentation
    • Updated installation requirements to list Zig 0.16 or 0.17.

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

Also replace `std.meta.Int` with `@Int`, `StaticBitSet.initEmpty()`
with `.empty`, and the removed `**` operator in tests with `@splat`.
CI now runs on 0.16.0 and 0.17.0.
@coderabbitai

coderabbitai Bot commented Oct 4, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 549f4a2d-586d-4c3c-b345-29c3d052dd2f
📥 Commits

Reviewing files that changed from the base of the PR and between 451da35 and 4c1d361.

📒 Files selected for processing (9)
  • .github/workflows/build.yml
  • CHANGELOG.md
  • README.md
  • src/compat.zig
  • src/float.zig
  • src/msgpack.zig
  • src/skip.zig
  • src/struct.zig
  • src/union.zig
 _________________________________________________
< Keeping your code so clean, you can eat off it. >
 -------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lalinsky
lalinsky merged commit cab2bae into main Oct 4, 2026
4 of 5 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