Add Zig 0.15 support; require Zig 0.15.0 as minimum version#32
Open
trodemaster wants to merge 1 commit intojackielii:mainfrom
Open
Add Zig 0.15 support; require Zig 0.15.0 as minimum version#32trodemaster wants to merge 1 commit intojackielii:mainfrom
trodemaster wants to merge 1 commit intojackielii:mainfrom
Conversation
Breaking: Zig 0.14 and earlier are no longer supported. Build system: - build.zig.zon: minimum_zig_version = "0.15.0" - build.zig: addExecutable/addTest use root_module + createModule() (root_source_file at the step level removed in 0.15) - Benchmark step disabled: zbench is not yet compatible with Zig 0.15 C import: - c.zig: pub usingnamespace @cImport(...) -> pub const c_impl = @cImport(...) (re-exporting usingnamespace is no longer allowed) - All callers updated to use @import("c.zig").c_impl; NSApplicationLoad accessed via @import("c.zig").NSApplicationLoad() Stdlib / language: - std.ArrayList -> std.array_list.Managed - std.time.sleep -> std.Thread.sleep - stderr.reader() / .writer() -> .deprecatedReader() / .deprecatedWriter() - std.posix.empty_sigset -> std.posix.sigemptyset() - callconv(.C) -> callconv(.c) Format protocol: - Custom format methods updated to: format(self, writer: anytype) !void (comptime fmt and FormatOptions parameters removed in 0.15) - Call sites that invoke the format method use {f} specifier - Mappings.format and Mode.format rewritten without allocation to match the error{WriteFailed}!void error set required by {f} CI: - Both jobs updated from Zig 0.14.0 to 0.15.2
Author
|
Hi, thanks for reviving skhd in zig! I have been using skhd for many years. My eventual goal here with updating skhd.zig to zig 0.15.x is so I can create a macports port for skhd.zig. I have been using skhd.zig built with this branch for a week or so and it's working well for me. I did use cursor/claude to make this PR with manual testing for validation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Zig 0.15 introduces several breaking API changes that prevent this project from building. This PR addresses all of them.
Breaking: Zig 0.14 and earlier are no longer supported.
Build system
build.zig.zon: setminimum_zig_version = "0.15.0"build.zig:addExecutable/addTestnow useroot_module+b.createModule()— the top-levelroot_source_filefield was removed in 0.15C import
c.zig:pub usingnamespace @cImport(...)→pub const c_impl = @cImport(...)— re-exportingusingnamespaceis no longer allowed@import("c.zig").c_impl;NSApplicationLoadaccessed via@import("c.zig").NSApplicationLoad()Stdlib / language
std.ArrayList→std.array_list.Managedstd.time.sleep→std.Thread.sleepstderr.reader()/.writer()→.deprecatedReader()/.deprecatedWriter()std.posix.empty_sigset→std.posix.sigemptyset()callconv(.C)→callconv(.c)Format protocol
formatmethods updated to:format(self, writer: anytype) !void—comptime fmtandFormatOptionsparameters removed in 0.15{f}specifierMappings.formatandMode.formatrewritten without allocation to match theerror{WriteFailed}!voiderror set required by{f}CI
0.14.0to0.15.2Testing
Tested on macOS 26.3.1 (arm64) with Zig 0.15.2:
zig build test— all tests passzig build -Doptimize=ReleaseFast— succeeds./zig-out/bin/skhd --version— binary runs correctlyskhddaemon with an existing.skhdrc— hotkeys work