build.zig: poison the configure cache appropriately

Until #35473 is implemented we have to re-run configure logic in case of
these things:
* git commit changes
* test-cases on the file system changed
* test-incremental on the file system changed
This commit is contained in:
Andrew Kelley
2026-05-27 13:12:36 -07:00
parent ba634c44ba
commit 7b5280b687
2 changed files with 13 additions and 0 deletions
+5
View File
@@ -259,6 +259,11 @@ pub fn build(b: *std.Build) !void {
std.debug.print("error: version info cannot be retrieved from git. Zig version must be provided using -Dversion-string\n", .{});
std.process.exit(1);
}
// Ensure git version changes get picked up
// https://codeberg.org/ziglang/zig/issues/35473
b.graph.poisonCache();
const version_string = b.fmt("{d}.{d}.{d}", .{ zig_version.major, zig_version.minor, zig_version.patch });
var code: u8 = undefined;
+8
View File
@@ -2901,6 +2901,10 @@ pub fn addCases(
var cases = @import("src/Cases.zig").init(gpa, arena, io);
// Ensure changes to these files get picked up
// https://codeberg.org/ziglang/zig/issues/35473
b.graph.poisonCache();
var dir = try b.root.openDir(io, "test/cases", .{ .iterate = true });
defer dir.close(io);
@@ -2959,6 +2963,10 @@ pub fn addIncrementalTests(b: *std.Build, test_step: *Step, test_filters: []cons
}),
});
// Ensure changes to these files get picked up
// https://codeberg.org/ziglang/zig/issues/35473
b.graph.poisonCache();
var dir = try b.root.openDir(io, "test/incremental", .{ .iterate = true });
defer dir.close(io);