Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation for zig 0.14 #119

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

raddari
Copy link

@raddari raddari commented Sep 7, 2024

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

Only SDL2 backend tested.

Fixes #118.

@raddari
Copy link
Author

raddari commented Sep 7, 2024

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.

@david-vanderson
Copy link
Owner

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!

@raddari raddari marked this pull request as draft September 8, 2024 05:49
@raddari
Copy link
Author

raddari commented Sep 8, 2024

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 :)

@iacore
Copy link
Collaborator

iacore commented Sep 8, 2024

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

@raddari
Copy link
Author

raddari commented Sep 9, 2024

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 raddari force-pushed the fix-zig-0.14-compilation branch from 0ad0655 to a135892 Compare December 24, 2024 03:48
@raddari raddari changed the title Fix compilation for zig 0.14.0-dev.1457+7e3180487 Fix compilation for zig 0.14 Dec 24, 2024
@raddari raddari force-pushed the fix-zig-0.14-compilation branch from a135892 to 1601392 Compare December 24, 2024 03:57
@raddari raddari force-pushed the fix-zig-0.14-compilation branch from 1601392 to 26fa637 Compare December 24, 2024 04:08
@raddari
Copy link
Author

raddari commented Dec 24, 2024

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

@david-vanderson
Copy link
Owner

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

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.

Tab character causes SDLBackend compile error
3 participants