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

Updated support for Zig #14226

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Updated support for Zig #14226

wants to merge 2 commits into from

Conversation

dcbaker
Copy link
Member

@dcbaker dcbaker commented Feb 5, 2025

This is #8579 rebased and updated.

There are still a few TODO items (as noted in the TODO comment).

Additionally, zig itself has a couple of issue that make it difficult to integrate into Meson:

Help with any of these issues is welcome.

e820 and others added 2 commits February 5, 2025 07:41
This adds some basic zig support, with tests. I've made some changes to
this patch from the original by pushing zig compilation through the
normal compilation path. This has some advantage of being able to handle
mixed zig and c-like language targets, as well as being less special
than rust is.

Co-authored-by: Dylan Baker <[email protected]>
@eli-schwartz
Copy link
Member

the stdlib API changes across versions, and zig doesn't have a pre-processor to ease that, which makes writing tests that work across multiple versions of Zig hard.

It sounds like we have no choice but to use versioned sources depending on the return value of get_compiler('zig').version(). Yes, it's grotty, but also, it's doable. We will just need to continually add new versions of the test whenever the image builder tries to update to a new zig release.

@dcbaker
Copy link
Member Author

dcbaker commented Feb 6, 2025

I was thinking about just requiring C and calling c.preprocess(), lol

@eli-schwartz
Copy link
Member

eli-schwartz commented Feb 6, 2025

I assume that the main challenge is having to keep updating, rather than how many files we split the code text across. :D

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.

3 participants