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

update to zig 0.14.0-dev.2952+8fa47bb90 #139

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

leroycep
Copy link

I also did a major refactor of the build.zig, let me know if you don't want those changes in this pull request 😅

Also, I've only tested this on linux, so I have no idea if the other backends need updating, I just made sure zig build and zig build test worked.

Links to relevant changes upstream (not including std.Build):

Relevant changes

- [remove @Fence()][#21585]
- `tv_` prefix removed from `linux.timespec` in [std.c reorganization][2]
- `linux.timerfd_create` now accepts clockid_t enum in [std.c reorganization][3]
- `linux.clockid_t` is now a non-exhaustive enum in [std.c reorganization][4]

[#21585]: ziglang/zig#21585
[2]: ziglang/zig@e8c4e79#diff-37593602824d84b26d4345c606faf7be68c398f3bd74016afdaa6ba5dc6acaafL6224-L6233
[3]: ziglang/zig@e8c4e79#diff-37593602824d84b26d4345c606faf7be68c398f3bd74016afdaa6ba5dc6acaafL1965-R1974
[4]: ziglang/zig@e8c4e79#diff-37593602824d84b26d4345c606faf7be68c398f3bd74016afdaa6ba5dc6acaafL4032-R4056
@Zorgatone
Copy link

@leroycep do you think this is the source of the error I have while trying to build libxev as a dependency here? #140

@Zorgatone
Copy link

Zorgatone commented Feb 4, 2025

I still get an error here, I can try to see if I'm able to fix it:

zig:99:18: error: expected 2 argument(s), found 1
        if (posix.clock_gettime(posix.CLOCK.MONOTONIC)) |new_time| {
            ~~~~~^~~~~~~~~~~~~~
/home/zorgatone/.zvm/master/lib/std/posix.zig:5628:5: note: function declared here
pub fn clock_gettime(clock_id: clockid_t, tp: *timespec) ClockGetTimeError!void {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
    init: /home/zorgatone/.cache/zig/p/1220cec72f20b6a6c382c56bc76c27a1720845fd1217f1169e2894913913f743c188/src/backend/io_uring.zig:47:26
    main: src/main.zig:4:33
    5 reference(s) hidden; use '-freference-trace=7' to see all references

@Zorgatone
Copy link

Zorgatone commented Feb 4, 2025

I still get an error here, I can try to see if I'm able to fix it:

zig:99:18: error: expected 2 argument(s), found 1
        if (posix.clock_gettime(posix.CLOCK.MONOTONIC)) |new_time| {
            ~~~~~^~~~~~~~~~~~~~
/home/zorgatone/.zvm/master/lib/std/posix.zig:5628:5: note: function declared here
pub fn clock_gettime(clock_id: clockid_t, tp: *timespec) ClockGetTimeError!void {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
    init: /home/zorgatone/.cache/zig/p/1220cec72f20b6a6c382c56bc76c27a1720845fd1217f1169e2894913913f743c188/src/backend/io_uring.zig:47:26
    main: src/main.zig:4:33
    5 reference(s) hidden; use '-freference-trace=7' to see all references

Actually, updating from Zig 0.14.0-dev.2989+bf6ee7cb3 to Zig 0.14.0-dev.3036+7ac110ac2 fixed the error for me

@leroycep
Copy link
Author

leroycep commented Feb 4, 2025

Yeah I updated it to latest master, unfortunately that made it incompatible with earlier versions. If you want to use an earlier version of Zig you can pin to the earlier commit.

While I'm here, relevant upstream changes:

@dadadani
Copy link

dadadani commented Feb 10, 2025

Just to be aware, this doesn't work on MacOS since the kqueue backend hasn't been changed. There is also a smaller issue that most of the darwin namespace is not published.

If it helps, I have already patched libxev in my fork to make it work with Zig 0.14.x even on MacOS. I haven't really made a pull request yet since Zig 0.14 hasn't been tagged yet

@leroycep
Copy link
Author

I might pull in your changes if that's all right. And I hope your pull request to fix the darwin namespace get's merged, otherwise libxev might have to copy paste the darwin definitions.

My philosophy for this pull request is more "put it out there so other's can find it". I figure mitchell can ignore it until then 😄

@gwenzek gwenzek mentioned this pull request Feb 13, 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.

3 participants