Pin zig version to 0.16 LTS
This commit is contained in:
@@ -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(.{});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user