dvui icon indicating copy to clipboard operation
dvui copied to clipboard

Fix compilation for zig 0.14.0-dev.1457+7e3180487

Open raddari opened this issue 1 year ago • 5 comments

Compilation succeeds with the command: zig build -fsys=sdl2 sdl-standalone

Only SDL2 backend tested.

Fixes #118.

raddari avatar Sep 07 '24 11:09 raddari

Without passing -fsys=sdl2 I get error: HeaderConfigFailed and a bunch of

error: /home/<>/.cache/zig/p/<hash>/include/SDL_config.h.cmake:35: unable to substitute variable: error: MissingValue

errors which stops compilation. Probably due to another change in 0.14; looking into it.

raddari avatar Sep 07 '24 11:09 raddari

These changes are going to break compiling on zig 0.13 right? I assume the renaming of the @typeInfo is not backwards compatible.

dvui tracks the latest stable zig release, so I'll keep this open until zig 0.14 is released and then we'll update.

Thank you!

david-vanderson avatar Sep 07 '24 16:09 david-vanderson

Yep this will definitely be breaking. I've converted the PR to a draft for now -- sorry I missed the part where you track the latest stable! I'll keep updating my branch on the side so hopefully it's not much effort to upgrade to zig 0.14 when it is released :)

raddari avatar Sep 08 '24 06:09 raddari

Is struct a strong keyword in Zig 0.14.0-dev.1457+7e3180487? i.e. Do you need to @"struct" quote it?

iacore avatar Sep 08 '24 15:09 iacore

Is struct a strong keyword in Zig 0.14.0-dev.1457+7e3180487? i.e. Do you need to @"struct" quote it?

Just checked, definitely needs @""

raddari avatar Sep 09 '24 13:09 raddari

Upstream dependencies for raylib and SDL will need to update their build.zigs to 0.14 before this PR can build.

Regarding the field name changes (which is the bulk of this PR), there is an alternative solution which may be worth looking into: https://ziggit.dev/t/require-specific-zig-version-in-build-script/7135/6

raddari avatar Dec 24 '24 04:12 raddari

Interesting! I'm expecting zig 0.14 to land in early 2025 (January I hope), but will pursue that strategy if needed. Thanks!

david-vanderson avatar Dec 24 '24 14:12 david-vanderson

@raddari Thanks for this - I based https://github.com/david-vanderson/dvui/pull/173 on it, which has now been merged, so I think this PR can be closed too. I just realized my rebase accidentally removed your authorship info from your commit though - I'm sorry about that, no ill will intended! EDIT: I guess that could still be fixed with a force-push - your and @david-vanderson 's call.

rohlem avatar Jan 21 '25 21:01 rohlem

No ill taken at all, cheers for carrying it forward! Don’t worry about the authorship. I’m just happy to see dvui compile for 0.14 :)

raddari avatar Jan 21 '25 21:01 raddari

Thank you!

david-vanderson avatar Jan 21 '25 22:01 david-vanderson