Skip to content

Conversation

@mdm5995
Copy link

@mdm5995 mdm5995 commented Jan 11, 2026

I'm not sure if this will break existing 0.15.2 builds. I'm not familiar enough with zig's build system to know if there is a way to get information about the zig compiler version to branch off of. If so, then this could easily be patched to support both 0.16 and 0.15.2. As is, it's likely going to break and shouldn't be merged until 0.16 is released.

Maybe a temporary dev branch for zig16 would be useful?

@jayschwa
Copy link

It needs to continue working for 0.15.2 since that is still the latest tagged release. You can try something like if (@hasDecl(std.fs, "openDirAbsolute")) { // 0.15.2 code path } else { // 0.16.0-dev code path }. The existing, more specific shim for the open options can be absorbed into that.

@mdm5995
Copy link
Author

mdm5995 commented Jan 11, 2026

I pegged it to the location of Dir because that seemed the most specific thing to actually look for (and OpenOptions were also moved)

build.zig Outdated
Comment on lines 82 to 86
// TODO: Remove compatibility shim when Zig 0.16.0 is the minimum required version.
const open_dir_opts: std.fs.Dir.OpenOptions = if (@hasField(std.fs.Dir.OpenOptions, "follow_symlinks"))
.{ .access_sub_paths = true, .follow_symlinks = false }
else
.{ .access_sub_paths = true, .no_follow = true };

Choose a reason for hiding this comment

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

This shim is no longer necessary.

Copy link
Author

Choose a reason for hiding this comment

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

Removed

@mdm5995 mdm5995 requested a review from jayschwa January 12, 2026 22:01
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