From ccc244b6eb1f962c65a5ff215df819be30f14ec6 Mon Sep 17 00:00:00 2001 From: Jay Petacat Date: Fri, 23 Oct 2026 11:24:00 -0600 Subject: [PATCH 1/2] Fix build for Zig 0.18.0-dev.610+720939f8c Zig 0.18.0-dev uses a new hash format for naked packages (no metadata) when `version` is present. Using `version_` sidesteps that new hash format for now, keeping compatibility with older versions of Zig. This workaround can be reverted when Zig 0.18.0 becomes the minimum supported version. See: https://codeberg.org/ziglang/zig/pulls/37340 --- build.zig | 2 +- build.zig.zon | 20 ++++++++++---------- src/linux.zig | 18 +++++++++--------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/build.zig b/build.zig index 88a608e52..c9cc67b3d 100644 --- a/build.zig +++ b/build.zig @@ -62,7 +62,7 @@ pub fn build(b: *std.Build) !void { // Get the SO version. This is the same as the SDL version, but the major version is elided // since it's baked into the name. This mirrors the official build process. - var sdl_so_version = comptime std.SemanticVersion.parse(build_zon.dependencies.sdl.version) catch unreachable; + var sdl_so_version = comptime std.SemanticVersion.parse(build_zon.dependencies.sdl.version_) catch unreachable; assert(sdl_so_version.major == 3); sdl_so_version.major = 0; diff --git a/build.zig.zon b/build.zig.zon index bcd3eeaea..2dc122f10 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,17 +1,17 @@ .{ .name = .sdl, .fingerprint = 0xec638ccbd103848b, - .version = "1.0.8+3.4.18", + .version = "1.0.9+3.4.18", .minimum_zig_version = "0.16.0", .dependencies = .{ .sdl = .{ .url = "https://github.com/libsdl-org/SDL/archive/refs/tags/release-3.4.18.tar.gz", .hash = "N-V-__8AACpx-AKEJIUZ0-XrP9-96MpSaw17FJ7L6B7LmO42", - .version = "3.4.18", + .version_ = "3.4.18", // `version_` sidesteps Zig 0.18.0-dev's new naked package hash. }, // Linux dependencies .dbus = .{ - .version = "1.16.2", + .version_ = "1.16.2", .url = "https://gitlab.freedesktop.org/dbus/dbus/-/archive/dbus-1.16.2/dbus-dbus-1.16.2.tar.gz", .hash = "N-V-__8AALxqaQCXLK7KmtlbRHzj5quTSajWtJZ86Qy7aBxj", .lazy = true, @@ -22,13 +22,13 @@ .lazy = true, }, .wayland = .{ - .version = "1.26.0", + .version_ = "1.26.0", .url = "git+https://gitlab.freedesktop.org/wayland/wayland?ref=1.26.0#87cc8a8728a923fc57938faa81ba0e74f34ecdc7", .hash = "N-V-__8AAA46JQABKU7sa-6xGUAN44uFsYSUS_w79UVuu7qo", .lazy = true, }, .xkbcommon = .{ - .version = "1.13.2", + .version_ = "1.13.2", .url = "https://github.com/xkbcommon/libxkbcommon/archive/refs/tags/xkbcommon-1.13.2.tar.gz", .hash = "N-V-__8AAGh7bAAD9LH6Hh6HB6br9SDZmRBbRu-_1NNpQ4GL", .lazy = true, @@ -59,7 +59,7 @@ .lazy = true, }, .xcursor = .{ - .version = "1.2.3", + .version_ = "1.2.3", .url = "https://gitlab.freedesktop.org/xorg/lib/libxcursor/-/archive/libXcursor-1.2.3/libxcursor-libXcursor-1.2.3.tar.gz", .hash = "N-V-__8AAKtlAgAAqwksheZkCSajEEPpi2XivNet-_3hZyz2", .lazy = true, @@ -88,13 +88,13 @@ .url = "https://gitlab.freedesktop.org/libdecor/libdecor/-/archive/0.2.5/libdecor-0.2.5.tar.gz", .hash = "N-V-__8AADG6BADZ6vLbOD3OrWhDYa5jrubmgY-ljspuv-4R", .lazy = true, - .version = "0.2.5", + .version_ = "0.2.5", }, .pipewire = .{ .url = "https://gitlab.freedesktop.org/pipewire/pipewire/-/archive/1.6.8/pipewire-1.6.8.tar.gz", .hash = "N-V-__8AAEBm3gCliUlb1HgAJA-3XvTWKC2YfRa5hJMiaEld", .lazy = true, - .version = "1.6.8", + .version_ = "1.6.8", .api_version = "0.3", // From `meson.build`, does not directly track `version`! }, .jack = .{ @@ -111,7 +111,7 @@ // Upstream: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/ .url = "https://github.com/Games-by-Mason/pulseaudio/archive/refs/tags/v16.2.tar.gz", .hash = "N-V-__8AADiK2wBbQBbppKI9s1sR8vTGLV1mhn44OEYxyPD4", - .version = "16.2.0", + .version_ = "16.2.0", .api_version = "12", // From `meson.build`, does not directly track version! .protocol_version = "35", // From `meson.build`, does not directly track version! .lazy = true, @@ -140,7 +140,7 @@ .lazy = true, }, .fribidi = .{ - .version = "1.0.16", + .version_ = "1.0.16", .interface_version = 4, .unicode_version = "16.0.0", .url = "https://github.com/fribidi/fribidi/archive/refs/tags/v1.0.16.tar.gz", diff --git a/src/linux.zig b/src/linux.zig index 0b85c489c..7e4861672 100644 --- a/src/linux.zig +++ b/src/linux.zig @@ -29,7 +29,7 @@ pub fn build( if (root.lazyDependency(&lib.step, "dbus", .{})) |dbus| { lib.root_module.addIncludePath(dbus.path(".")); - const version_string = build_zon.dependencies.dbus.version; + const version_string = build_zon.dependencies.dbus.version_; const version = comptime std.SemanticVersion.parse(version_string) catch unreachable; std.debug.assert(target.cTypeByteSize(.short) == 2); std.debug.assert(target.cTypeByteSize(.int) == 4); @@ -309,7 +309,7 @@ pub fn build( // Provide the Xcursor headers if (root.lazyDependency(&lib.step, "xcursor", .{})) |xcursor| { - const version_string = build_zon.dependencies.xcursor.version; + const version_string = build_zon.dependencies.xcursor.version_; const version = comptime std.SemanticVersion.parse(version_string) catch unreachable; const config = b.addConfigHeader(.{ .style = .{ .autoconf_undef = xcursor.path("include/X11/Xcursor/Xcursor.h.in") }, @@ -341,7 +341,7 @@ pub fn build( }); _ = generated.addCopyFile(compat_h.getOutputFile(), compat_h.include_path); - const version_string = build_zon.dependencies.decor.version; + const version_string = build_zon.dependencies.decor.version_; const version = comptime std.SemanticVersion.parse(version_string) catch unreachable; const version_h = b.addConfigHeader(.{ .style = .{ .autoconf_undef = b.path("deps/liburing/io_uring_version.h.in") }, @@ -357,7 +357,7 @@ pub fn build( if (root.lazyDependency(&lib.step, "pipewire", .{})) |pipewire| { lib.root_module.addIncludePath(pipewire.path("spa/include")); lib.root_module.addIncludePath(pipewire.path("src")); - const version_string = build_zon.dependencies.pipewire.version; + const version_string = build_zon.dependencies.pipewire.version_; const api_version_string = build_zon.dependencies.pipewire.api_version; const version = comptime std.SemanticVersion.parse(version_string) catch unreachable; const config_h = b.addConfigHeader(.{ @@ -377,7 +377,7 @@ pub fn build( @setEvalBranchQuota(2000); if (root.lazyDependency(&lib.step, pulseaudio_name, .{})) |pulseaudio| { lib.root_module.addIncludePath(pulseaudio.path("src")); - const version_string = build_zon.dependencies.pulseaudio.version; + const version_string = build_zon.dependencies.pulseaudio.version_; const version = comptime std.SemanticVersion.parse(version_string) catch unreachable; const api_version_string = build_zon.dependencies.pulseaudio.api_version; const api_version = comptime std.fmt.parseInt(u32, api_version_string, 10) catch unreachable; @@ -403,7 +403,7 @@ pub fn build( lib.root_module.addIncludePath(wayland.path("egl")); // Provide the config header - const version_string = build_zon.dependencies.wayland.version; + const version_string = build_zon.dependencies.wayland.version_; const version = comptime std.SemanticVersion.parse(version_string) catch unreachable; const version_h = b.addConfigHeader(.{ .style = .{ .cmake = wayland.path("src/wayland-version.h.in") }, @@ -436,7 +436,7 @@ pub fn build( // Provide the Fribidi headers if (root.lazyDependency(&lib.step, "fribidi", .{})) |fribidi| { const interface_version = build_zon.dependencies.fribidi.interface_version; - const version_string = build_zon.dependencies.fribidi.version; + const version_string = build_zon.dependencies.fribidi.version_; const version = comptime std.SemanticVersion.parse(version_string) catch unreachable; const unicode_version_string = build_zon.dependencies.fribidi.unicode_version; @@ -525,9 +525,9 @@ pub fn build( // // Dynamic library versions are from Steam Linux Runtime 3.0 Sniper unless otherwise noted: // https://gitlab.steamos.cloud/steamrt/steamrt/-/tree/steamrt/sniper - const libdecor_version_string = build_zon.dependencies.decor.version; + const libdecor_version_string = build_zon.dependencies.decor.version_; const libdecor_version = comptime std.SemanticVersion.parse(libdecor_version_string) catch unreachable; - const xkbcommon_version_string = build_zon.dependencies.xkbcommon.version; + const xkbcommon_version_string = build_zon.dependencies.xkbcommon.version_; const xkbcommon_version = comptime std.SemanticVersion.parse(xkbcommon_version_string) catch unreachable; const have_sigtimedwait: i64 = if (target.os.tag == .openbsd) 0 else 1; build_config_h.addValues(.{ From b5ff128efe12447dc71f90538d5f8c7fe8ce6f0f Mon Sep 17 00:00:00 2001 From: Mason Remaley Date: Mon, 26 Oct 2026 14:50:47 -0700 Subject: [PATCH 2/2] Minor style change - `version_` -> `upstream_version` - replaced comment with link to issue tracking reverting this workaround --- build.zig | 2 +- build.zig.zon | 18 +++++++++--------- src/linux.zig | 18 +++++++++--------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/build.zig b/build.zig index c9cc67b3d..8cba812b2 100644 --- a/build.zig +++ b/build.zig @@ -62,7 +62,7 @@ pub fn build(b: *std.Build) !void { // Get the SO version. This is the same as the SDL version, but the major version is elided // since it's baked into the name. This mirrors the official build process. - var sdl_so_version = comptime std.SemanticVersion.parse(build_zon.dependencies.sdl.version_) catch unreachable; + var sdl_so_version = comptime std.SemanticVersion.parse(build_zon.dependencies.sdl.upstream_version) catch unreachable; assert(sdl_so_version.major == 3); sdl_so_version.major = 0; diff --git a/build.zig.zon b/build.zig.zon index 2dc122f10..305ad9e88 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -7,11 +7,11 @@ .sdl = .{ .url = "https://github.com/libsdl-org/SDL/archive/refs/tags/release-3.4.18.tar.gz", .hash = "N-V-__8AACpx-AKEJIUZ0-XrP9-96MpSaw17FJ7L6B7LmO42", - .version_ = "3.4.18", // `version_` sidesteps Zig 0.18.0-dev's new naked package hash. + .upstream_version = "3.4.18", // https://github.com/allyourcodebase/SDL/issues/44 }, // Linux dependencies .dbus = .{ - .version_ = "1.16.2", + .upstream_version = "1.16.2", .url = "https://gitlab.freedesktop.org/dbus/dbus/-/archive/dbus-1.16.2/dbus-dbus-1.16.2.tar.gz", .hash = "N-V-__8AALxqaQCXLK7KmtlbRHzj5quTSajWtJZ86Qy7aBxj", .lazy = true, @@ -22,13 +22,13 @@ .lazy = true, }, .wayland = .{ - .version_ = "1.26.0", + .upstream_version = "1.26.0", .url = "git+https://gitlab.freedesktop.org/wayland/wayland?ref=1.26.0#87cc8a8728a923fc57938faa81ba0e74f34ecdc7", .hash = "N-V-__8AAA46JQABKU7sa-6xGUAN44uFsYSUS_w79UVuu7qo", .lazy = true, }, .xkbcommon = .{ - .version_ = "1.13.2", + .upstream_version = "1.13.2", .url = "https://github.com/xkbcommon/libxkbcommon/archive/refs/tags/xkbcommon-1.13.2.tar.gz", .hash = "N-V-__8AAGh7bAAD9LH6Hh6HB6br9SDZmRBbRu-_1NNpQ4GL", .lazy = true, @@ -59,7 +59,7 @@ .lazy = true, }, .xcursor = .{ - .version_ = "1.2.3", + .upstream_version = "1.2.3", .url = "https://gitlab.freedesktop.org/xorg/lib/libxcursor/-/archive/libXcursor-1.2.3/libxcursor-libXcursor-1.2.3.tar.gz", .hash = "N-V-__8AAKtlAgAAqwksheZkCSajEEPpi2XivNet-_3hZyz2", .lazy = true, @@ -88,13 +88,13 @@ .url = "https://gitlab.freedesktop.org/libdecor/libdecor/-/archive/0.2.5/libdecor-0.2.5.tar.gz", .hash = "N-V-__8AADG6BADZ6vLbOD3OrWhDYa5jrubmgY-ljspuv-4R", .lazy = true, - .version_ = "0.2.5", + .upstream_version = "0.2.5", }, .pipewire = .{ .url = "https://gitlab.freedesktop.org/pipewire/pipewire/-/archive/1.6.8/pipewire-1.6.8.tar.gz", .hash = "N-V-__8AAEBm3gCliUlb1HgAJA-3XvTWKC2YfRa5hJMiaEld", .lazy = true, - .version_ = "1.6.8", + .upstream_version = "1.6.8", .api_version = "0.3", // From `meson.build`, does not directly track `version`! }, .jack = .{ @@ -111,7 +111,7 @@ // Upstream: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/ .url = "https://github.com/Games-by-Mason/pulseaudio/archive/refs/tags/v16.2.tar.gz", .hash = "N-V-__8AADiK2wBbQBbppKI9s1sR8vTGLV1mhn44OEYxyPD4", - .version_ = "16.2.0", + .upstream_version = "16.2.0", .api_version = "12", // From `meson.build`, does not directly track version! .protocol_version = "35", // From `meson.build`, does not directly track version! .lazy = true, @@ -140,7 +140,7 @@ .lazy = true, }, .fribidi = .{ - .version_ = "1.0.16", + .upstream_version = "1.0.16", .interface_version = 4, .unicode_version = "16.0.0", .url = "https://github.com/fribidi/fribidi/archive/refs/tags/v1.0.16.tar.gz", diff --git a/src/linux.zig b/src/linux.zig index 7e4861672..7616e7590 100644 --- a/src/linux.zig +++ b/src/linux.zig @@ -29,7 +29,7 @@ pub fn build( if (root.lazyDependency(&lib.step, "dbus", .{})) |dbus| { lib.root_module.addIncludePath(dbus.path(".")); - const version_string = build_zon.dependencies.dbus.version_; + const version_string = build_zon.dependencies.dbus.upstream_version; const version = comptime std.SemanticVersion.parse(version_string) catch unreachable; std.debug.assert(target.cTypeByteSize(.short) == 2); std.debug.assert(target.cTypeByteSize(.int) == 4); @@ -309,7 +309,7 @@ pub fn build( // Provide the Xcursor headers if (root.lazyDependency(&lib.step, "xcursor", .{})) |xcursor| { - const version_string = build_zon.dependencies.xcursor.version_; + const version_string = build_zon.dependencies.xcursor.upstream_version; const version = comptime std.SemanticVersion.parse(version_string) catch unreachable; const config = b.addConfigHeader(.{ .style = .{ .autoconf_undef = xcursor.path("include/X11/Xcursor/Xcursor.h.in") }, @@ -341,7 +341,7 @@ pub fn build( }); _ = generated.addCopyFile(compat_h.getOutputFile(), compat_h.include_path); - const version_string = build_zon.dependencies.decor.version_; + const version_string = build_zon.dependencies.decor.upstream_version; const version = comptime std.SemanticVersion.parse(version_string) catch unreachable; const version_h = b.addConfigHeader(.{ .style = .{ .autoconf_undef = b.path("deps/liburing/io_uring_version.h.in") }, @@ -357,7 +357,7 @@ pub fn build( if (root.lazyDependency(&lib.step, "pipewire", .{})) |pipewire| { lib.root_module.addIncludePath(pipewire.path("spa/include")); lib.root_module.addIncludePath(pipewire.path("src")); - const version_string = build_zon.dependencies.pipewire.version_; + const version_string = build_zon.dependencies.pipewire.upstream_version; const api_version_string = build_zon.dependencies.pipewire.api_version; const version = comptime std.SemanticVersion.parse(version_string) catch unreachable; const config_h = b.addConfigHeader(.{ @@ -377,7 +377,7 @@ pub fn build( @setEvalBranchQuota(2000); if (root.lazyDependency(&lib.step, pulseaudio_name, .{})) |pulseaudio| { lib.root_module.addIncludePath(pulseaudio.path("src")); - const version_string = build_zon.dependencies.pulseaudio.version_; + const version_string = build_zon.dependencies.pulseaudio.upstream_version; const version = comptime std.SemanticVersion.parse(version_string) catch unreachable; const api_version_string = build_zon.dependencies.pulseaudio.api_version; const api_version = comptime std.fmt.parseInt(u32, api_version_string, 10) catch unreachable; @@ -403,7 +403,7 @@ pub fn build( lib.root_module.addIncludePath(wayland.path("egl")); // Provide the config header - const version_string = build_zon.dependencies.wayland.version_; + const version_string = build_zon.dependencies.wayland.upstream_version; const version = comptime std.SemanticVersion.parse(version_string) catch unreachable; const version_h = b.addConfigHeader(.{ .style = .{ .cmake = wayland.path("src/wayland-version.h.in") }, @@ -436,7 +436,7 @@ pub fn build( // Provide the Fribidi headers if (root.lazyDependency(&lib.step, "fribidi", .{})) |fribidi| { const interface_version = build_zon.dependencies.fribidi.interface_version; - const version_string = build_zon.dependencies.fribidi.version_; + const version_string = build_zon.dependencies.fribidi.upstream_version; const version = comptime std.SemanticVersion.parse(version_string) catch unreachable; const unicode_version_string = build_zon.dependencies.fribidi.unicode_version; @@ -525,9 +525,9 @@ pub fn build( // // Dynamic library versions are from Steam Linux Runtime 3.0 Sniper unless otherwise noted: // https://gitlab.steamos.cloud/steamrt/steamrt/-/tree/steamrt/sniper - const libdecor_version_string = build_zon.dependencies.decor.version_; + const libdecor_version_string = build_zon.dependencies.decor.upstream_version; const libdecor_version = comptime std.SemanticVersion.parse(libdecor_version_string) catch unreachable; - const xkbcommon_version_string = build_zon.dependencies.xkbcommon.version_; + const xkbcommon_version_string = build_zon.dependencies.xkbcommon.upstream_version; const xkbcommon_version = comptime std.SemanticVersion.parse(xkbcommon_version_string) catch unreachable; const have_sigtimedwait: i64 = if (target.os.tag == .openbsd) 0 else 1; build_config_h.addValues(.{