Skip to content

feat: add support for Zig 0.16#61

Merged
ianprime0509 merged 4 commits into
ianprime0509:mainfrom
carlmontanari:chore/zig-0.16.0-dev-support
Jun 20, 2026
Merged

feat: add support for Zig 0.16#61
ianprime0509 merged 4 commits into
ianprime0509:mainfrom
carlmontanari:chore/zig-0.16.0-dev-support

Conversation

@carlmontanari

@carlmontanari carlmontanari commented Nov 9, 2025

Copy link
Copy Markdown
Contributor

was messing about w/ the 0.16.x stuff so figured id share this. will try to keep it updated if any more changes in zig break things! just opening now in case this is helpful for anyone and/or we want to merge it when 0.16.x is released!

edit: tested using 0.16.0-dev.1246+4b593a6c2

Comment thread xmlconf/src/xmlconf.zig Outdated
const output = output: {
const index = reader.attributeIndex("OUTPUT") orelse break :output null;
defer gpa.free(input.parent);
const output: struct { parent: ?[]u8, data: ?[]u8 } = output: {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feels v janky but was having an invalid free because (I think?) the readFile returned a view into the greater buf slice and then when we freed that we freed only the view not the full slice. im sure theres a better way but this works/tests ran/no allocator complaints

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like there's a TODO to move readFileAlloc to std.Io.Dir: https://github.com/ziglang/zig/blob/bdbfc7de3fd3a05f338ec8beaa29894547a9df4c/lib/std/fs/Dir.zig#L1425-L1426 So, hopefully, this workaround will be unnecessary in the long run. (If it doesn't get moved for some reason, I would probably end up just copying the core logic of readFileAlloc)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy that, will keep an eye and update if/when stuff changes or do as you suggested!

@ianprime0509

Copy link
Copy Markdown
Owner

Thank you! I actually made the changes for Reader not too long ago in #59, since those are backwards compatible with 0.15. Currently, the core library works with both 0.15 and master, but the examples, benchmarks, and xmlconf tests don't because of IO usage. Since the core library doesn't actually use any IO functionality, I'm hoping I can maintain compatibility there with both versions, unless there are other language changes that prevent that.

I'll be happy to merge this once 0.16 comes out 😃

@carlmontanari
carlmontanari force-pushed the chore/zig-0.16.0-dev-support branch from cd6703a to 3a521fa Compare March 13, 2026 01:30
@ianprime0509 ianprime0509 changed the title chore: first pass support for io interface (zig 0.16.x) feat: add support for Zig 0.16 Jun 20, 2026
@ianprime0509
ianprime0509 marked this pull request as ready for review June 20, 2026 18:11
@ianprime0509
ianprime0509 merged commit 65403e5 into ianprime0509:main Jun 20, 2026
4 of 5 checks passed
@ianprime0509

Copy link
Copy Markdown
Owner

Thank you, and sorry for the delay! I just added some other changes and merged it in.

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.

2 participants