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

Darwin: kevent64_s not defined anymore #21200

Open
steeve opened this issue Aug 25, 2024 · 5 comments · May be fixed by #21218
Open

Darwin: kevent64_s not defined anymore #21200

steeve opened this issue Aug 25, 2024 · 5 comments · May be fixed by #21218
Labels
bug Observed behavior contradicts documented or intended behavior regression It worked in a previous version of Zig, but stopped working. standard library This issue involves writing Zig code for the standard library.
Milestone

Comments

@steeve
Copy link

steeve commented Aug 25, 2024

Zig Version

0.14.0-dev.1304+7d54c62c8

Steps to Reproduce and Observed Behavior

Trying to update libxev to the latest zig, I'm running into a undefined decl for std.posix.system.kevent64_s at:
https://github.com/mitchellh/libxev/blob/43c7e4b3308f359e5b758db2d824d7c447f4ed3f/src/backend/kqueue.zig#L1672-L1675

The breaking change happened in e8c4e79

It seems it might just be as easy as importing darwin.kevent64_s to c.zig, in which case I'll send a PR.

Also cc @mitchellh for visibility.

Expected Behavior

Should be able to use std.posix.system.kevent64_s on macOS.

@steeve steeve added the bug Observed behavior contradicts documented or intended behavior label Aug 25, 2024
@alexrp
Copy link
Member

alexrp commented Aug 25, 2024

It seems it might just be as easy as importing darwin.kevent64_s to c.zig, in which case I'll send a PR.

Seems that way; please do.

@steeve
Copy link
Author

steeve commented Aug 27, 2024

It seems other symbols are missing too such as MACH_SEND_MSG and MACH_RCV_MSG. Most coming from 8c4a2dc

Should I just go ahead and import them? I'm not sure this is the right solution as it makes me question why there is a darwin.zig in the first place?

Perhaps a solution is to expose const darwin as pub const ?

I'm not sure

@alexrp
Copy link
Member

alexrp commented Aug 27, 2024

The idea is that a symbol should be available in std.c when it's available for the targeted OS/libc. If it's not available for the target, it should be defined to void (for types) or {} (for functions).

Please see: #20679

@steeve
Copy link
Author

steeve commented Aug 27, 2024

Super clear, thank you

@steeve steeve linked a pull request Aug 27, 2024 that will close this issue
@steeve
Copy link
Author

steeve commented Aug 27, 2024

First shot: #21218

@andrewrk andrewrk added this to the 0.14.0 milestone Aug 27, 2024
@andrewrk andrewrk added standard library This issue involves writing Zig code for the standard library. regression It worked in a previous version of Zig, but stopped working. labels Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior regression It worked in a previous version of Zig, but stopped working. standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants