Skip to content

Update Zig to 0.16.0#13

Merged
IntegratedQuantum merged 4 commits intoPixelGuys:masterfrom
AfmanS:zig_0.16.0
May 3, 2026
Merged

Update Zig to 0.16.0#13
IntegratedQuantum merged 4 commits intoPixelGuys:masterfrom
AfmanS:zig_0.16.0

Conversation

@AfmanS
Copy link
Copy Markdown
Contributor

@AfmanS AfmanS commented May 1, 2026

Fixes PixelGuys/Cubyz#2931.
I tested it locally and it seems to work. I'm new to Zig and I thought this might be an easy first issue. I mostly copied what was done in PixelGuys/Cubyz@133b472 but I would still appreciate an extra hard look.

Comment thread tools/file_replace.zig Outdated
Comment on lines 15 to 16
pub fn main(args: std.process.Init.Minimal) !void {
var arena_state = std.heap.ArenaAllocator.init(std.heap.page_allocator);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't like the use of args here. I don't know why @IntegratedQuantum used args in the other update. but this should be named init

@Wunka Wunka moved this to Low Priority in PRs to review May 1, 2026
@AfmanS AfmanS requested a review from Wunka May 1, 2026 20:53
Copy link
Copy Markdown

@Wunka Wunka left a comment

Choose a reason for hiding this comment

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

Thanks for doing this!
It doesn't change much but even this work is needed.

I don't see anything that is directly bad. But I also never played with the build system that much around.
So from my side you have the approve.
Now its time to wait on quantum to review

Copy link
Copy Markdown
Member

@IntegratedQuantum IntegratedQuantum left a comment

Choose a reason for hiding this comment

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

Did you also check if the created libraries work in the game?

I'm new to Zig and I thought this might be an easy first issue.

Honestly the only reason I didn't do it myself, is because I didn't see that the glslang repo moved to codeberg so I thought it was abandoned.

Comment thread tools/file_replace.zig Outdated
Comment thread tools/file_replace.zig Outdated
Comment thread tools/file_replace.zig Outdated
@IntegratedQuantum IntegratedQuantum moved this from Low Priority to In review in PRs to review May 2, 2026
AfmanS and others added 2 commits May 2, 2026 19:07
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
@AfmanS
Copy link
Copy Markdown
Contributor Author

AfmanS commented May 2, 2026

Did you also check if the created libraries work in the game?

I thought I did, but only now did I discover you have to pass -Dlocal=true. I tested and it seems to work normally in debug. I tried to build with -Doptimize=ReleaseFast and got a bunch of errors like

compile exe Cubyz ReleaseFast native 18 errors
error: lld-link: undefined symbol: __ubsan_handle_pointer_overflow
    note: referenced by [dir]\Cubyz-Dev\Cubyz-libs\zig-pkg\N-V-__8AAL40TADEbrysYHBl-UIZO4KiG4chP8pLDVDINGH4\src\init.c:155
    note:               cubyz_deps_x86_64-windows-gnu.lib(init.obj):(_glfwEncodeUTF8)

But that happens without my changes, too, so I'm guessing I just missed something in the release build of the libs.

I'd also like to ask: In the 0.16.0 release notes, instead of adding root_module to a bunch of lines they do a single .root_module = b.createModule(.{ and work on a Module instead of a Compile. Is that something that would make sense in this build.zig?

Finally, if there are no objections, I'm gonna try my hand at moving stb_image and stb_image_write to build system dependencies, as well as update the rest of them.

@AfmanS AfmanS requested a review from IntegratedQuantum May 2, 2026 19:16
Copy link
Copy Markdown
Member

@IntegratedQuantum IntegratedQuantum left a comment

Choose a reason for hiding this comment

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

I'd also like to ask: In the 0.16.0 release notes, instead of adding root_module to a bunch of lines they do a single .root_module = b.createModule(.{ and work on a Module instead of a Compile. Is that something that would make sense in this build.zig?

For now I'd say we keep it as is, but if they continue moving more stuff to the module, it might make sense to do it like that.

I just missed something in the release build of the libs.

You can test them with zig build release (though macos will likely fail, as it requires some additional setup currently), release builds are done with ReleaseSmall, since none of these libraries are relevant for performance to reduce download volume.

At some point I would also like to have a CI step to document the exact process PixelGuys/Cubyz#3020

But either way I can confirm that it builds for all operating systems

Finally, if there are no objections, I'm gonna try my hand at moving stb_image and stb_image_write to build system dependencies, as well as update the rest of them.

Yes, I would appreciate that.

@IntegratedQuantum IntegratedQuantum merged commit 3da634c into PixelGuys:master May 3, 2026
1 check passed
@AfmanS AfmanS deleted the zig_0.16.0 branch May 3, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Update Cubyz-libs to Zig 0.16.0

3 participants