Pin zig version to 0.16 LTS

This commit is contained in:
2026-07-03 13:49:47 +01:00
parent 269729f2f2
commit 9a834c91ff
3 changed files with 73 additions and 1 deletions
+18
View File
@@ -1,6 +1,24 @@
const std = @import("std");
const builtin = @import("builtin");
/// danos is developed against Zig 0.16.x. Pre-1.0 Zig makes breaking API changes
/// between minor releases, and the .zon's `minimum_zig_version` only enforces a
/// floor — so reject anything off the 0.16 line to keep the build reproducible.
fn ensureZigVersion() void {
const v = builtin.zig_version;
if (v.major != 0 or v.minor != 16) {
std.debug.print(
"danos requires Zig 0.16.x, but this is {d}.{d}.{d}. " ++
"Zig makes breaking changes between minor releases pre-1.0.\n",
.{ v.major, v.minor, v.patch },
);
std.process.exit(1);
}
}
pub fn build(b: *std.Build) void {
ensureZigVersion();
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});