diff options
| author | Mitchell Hashimoto <m@mitchellh.com> | 2025-10-10 08:45:32 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-10 08:45:32 -0700 |
| commit | 029bcf2d39c077af3c1f848fa338ee9e78bbb5a2 (patch) | |
| tree | 015df73a49a6e1ba7edf94fc0a2a763bfed76c24 /pkg | |
| parent | dbe42d9353a578b6425cd7d730b22cdc23869711 (diff) | |
| parent | 82a5c177fed33a5c2f01ee3bc862388c5722a551 (diff) | |
gtk4-layer-shell: version from build.zig.zon, reenable ubsan (#9122)
added version read from build.zig.zon
didn't get any ubsan error locally with zig 0.15.1 (related to
https://github.com/ghostty-org/ghostty/issues/5744#issuecomment-2719313984)
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/gtk4-layer-shell/build.zig | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/pkg/gtk4-layer-shell/build.zig b/pkg/gtk4-layer-shell/build.zig index b9cf78a23..818b48f45 100644 --- a/pkg/gtk4-layer-shell/build.zig +++ b/pkg/gtk4-layer-shell/build.zig @@ -1,7 +1,6 @@ const std = @import("std"); -// TODO: Import this from build.zig.zon when possible -const version: std.SemanticVersion = .{ .major = 1, .minor = 1, .patch = 0 }; +const version = @import("build.zig.zon").version; const dynamic_link_opts: std.Build.Module.LinkSystemLibraryOptions = .{ .preferred_link_mode = .dynamic, @@ -32,6 +31,7 @@ pub fn build(b: *std.Build) !void { } fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Build.Step.Compile { + const lib_version = try std.SemanticVersion.parse(version); const target = options.target; const optimize = options.optimize; @@ -117,19 +117,9 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu .root = upstream.path("src"), .files = srcs, .flags = &.{ - b.fmt("-DGTK_LAYER_SHELL_MAJOR={}", .{version.major}), - b.fmt("-DGTK_LAYER_SHELL_MINOR={}", .{version.minor}), - b.fmt("-DGTK_LAYER_SHELL_MICRO={}", .{version.patch}), - - // Zig 0.14 regression: this is required because building with - // ubsan results in unknown symbols. Bundling the ubsan/compiler - // RT doesn't help. I'm not sure what the root cause is but I - // suspect its related to this: - // https://github.com/ziglang/zig/issues/23052 - // - // We can remove this in the future for Zig updates and see - // if our binaries run in debug on NixOS. - "-fno-sanitize=undefined", + b.fmt("-DGTK_LAYER_SHELL_MAJOR={}", .{lib_version.major}), + b.fmt("-DGTK_LAYER_SHELL_MINOR={}", .{lib_version.minor}), + b.fmt("-DGTK_LAYER_SHELL_MICRO={}", .{lib_version.patch}), }, }); |
