Repository navigation
Support Zig 0.17.0 - #2
Open
kalpakprod wants to merge 1 commit into
Open
kalpakprod wants to merge 1 commit into
kalpakprod wants to merge 1 commit into
Conversation
Migrate struct reflection to the 0.17 field_names/field_types/field_attrs accessors through one small src/compat.zig helper, spell array repetition with @Splat where 0.17 rejects the old form, replace the removed std.ascii.indexOfIgnoreCase and the moved Fn/StructField attribute types, and format the tree with the 0.17 zig fmt (CI runs zig fmt --check). Bump the minimum Zig version to 0.17.0 in build.zig.zon, README, docs, CONTRIBUTING and the CI workflow.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Makes the library, its test suite and the examples build and pass on the released Zig 0.17.0 (today
zig buildstops at five parser errors, and after those are fixed a further 141 compile diagnostics remain).What changed:
std.builtin.Type.Struct.fieldsno longer exists in 0.17 (field_names/field_types/field_attrsreplace it). All 53 uses indsl/andconnection/go through one small helper,src/compat.zig(compat.fields(info)), which rebuilds the old name/type/default/comptime view. No DSL logic changed. The function-parameter reflection site indsl/table.zigmoved from.paramsto.param_types; twoStructField.Attributesspellings becameStruct.FieldAttributes.[_]u8{0} ** N-style expressions (btree.zig,dsl/keys.zig,dsl/table.zig,storage/wal.zig,vm/vm.zig) plus a few test-only ones are now written with@splat, because 0.17's parser rejects the old form.std.ascii.indexOfIgnoreCase(removed) ->std.ascii.findIgnoreCaseat eight call sites.zig fmt: CI runszig fmt --check src/ build.zig build.zig.zon; the 0.17 formatter also rewrites a few deprecated builtins (@intFromEnum->@backingInt) inbtree/btree.zig,format/page.zigandsql/functions/aggregate.zig, so those files are reformatted to keep that check green. Formatting only.build.zig.zon, README (badge and requirements table),docs/guide/getting-started.md,CONTRIBUTING.mdand.github/workflows/ci.yml(all threesetup-zigversions).This drops support for 0.16 because the helper relies on the 0.17 reflection arrays. If you would rather keep 0.16 working as well, the helper and the three call-site spellings can be made version-conditional with
@hasField/@hasDecl; I am happy to rework the PR that way.Type of Change
Testing
Zig 0.17.0, Linux x86_64, from a clean checkout of
main(1d0cbb7) plus this branch:zig fmt --check src/ build.zig build.zig.zon-> exit 0zig build test --summary all --test-timeout 120s -j1-> exit 0,Build Summary: 3/3 steps succeeded; 605/605 tests passedzig build run-all-examples --summary all -j1-> exit 0,226/226 steps succeededNot run: the Windows/macOS legs of the CI matrix,
zig build docs, thedocs/website build, and the ReleaseFast/cross-targetchecklegs.Checklist
Prepared with Claude Code (AI-assisted); every command above was run by me on this branch and the outputs are the real ones.