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

Add Zig language support #8579

Closed
wants to merge 5 commits into from
Closed

Add Zig language support #8579

wants to merge 5 commits into from

Conversation

e820
Copy link
Contributor

@e820 e820 commented Mar 25, 2021

Sigh, hopefully this time around.

I closed the previous iteration (#7984) due to personal time constraints at the time and want to commit
to making this the best I can now. This contains everything the previous iteration had, plus a few
fixes and adjustments to accomodate for changes in Meson.

This will be a draft for now as it's still somewhat of a WIP. I tested a few zig projects from GitHub
and they build nicely. Some things in particular I'd like feedback on:

  • The rpath handling - it appears to be working however I'm not sure this is the correct approach.
    In particular the project test 2 sharedlib is failing during installation, it seems to be a
    install_name_tool related failure that I don't really know how to fix (see the logs below)
[0/1] Installing files.
Installing libhello.1.dylib to /Users/e820/Developer/meson/i _i1gsgsz/usr/lib
Installing zigtest-shared-lib to /Users/e820/Developer/meson/i _i1gsgsz/usr/bin
FAILED: meson-install
/opt/homebrew/opt/[email protected]/bin/python3.9 /Users/e820/Developer/meson/meson.py install --no-rebuild
ninja: build stopped: subcommand failed.


ninja explain: output libhello.1.dylib doesn't exist
ninja explain: libhello.1.dylib is dirty
ninja explain: libhello.1.dylib is dirty
ninja explain: zigtest-shared-lib is dirty

...

Command '['install_name_tool', '/Users/e820/Developer/meson/i _i1gsgsz/usr/bin/zigtest-shared-lib', '-delete_rpath', '/usr/lib']' returned non-zero exit status 1.

@lgtm-com
Copy link

lgtm-com bot commented Mar 25, 2021

This pull request introduces 1 alert when merging ae76a0b into 56c03e1 - view on LGTM.com

new alerts:

  • 1 for Conflicting attributes in base classes

@lgtm-com
Copy link

lgtm-com bot commented Apr 7, 2021

This pull request introduces 1 alert when merging 1e06046 into 0b50c57 - view on LGTM.com

new alerts:

  • 1 for Conflicting attributes in base classes

@RossComputerGuy
Copy link
Contributor

What's the progress on this? I'm looking to be able to convert an existing project which uses Meson to slowly use Zig. However, it'd be a huge undertaking to move to build.zig. Calling the Zig compiler myself is doable but not the best. Having this support would be great.

@eli-schwartz
Copy link
Member

eli-schwartz commented Feb 5, 2025

The original question for feedback can't really be analyzed at the moment -- it's not clear how install_name_tool failed or even with what error message, all these years later :(

@dcbaker had an interest in the original PR #7984 so I wonder what happened later...

@dcbaker
Copy link
Member

dcbaker commented Feb 5, 2025

I have an updated version of this PR. I’ll link it later or open a new PR. The biggest two things I ran into at the time were that zig doesn’t any any kind of API stability in the stdlib, and a lack of depfile support that makes it hard to get reliable rebuilds

@dcbaker
Copy link
Member

dcbaker commented Feb 5, 2025

Closing this in favor of the rebased version

@dcbaker dcbaker closed this Feb 5, 2025
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.

4 participants