From 7b5280b687039faebfcb4d670507d0826f3ecba3 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 27 May 2026 13:12:36 -0700 Subject: [PATCH] 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 --- build.zig | 5 +++++ test/tests.zig | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/build.zig b/build.zig index 2f00911197..4f5ea5a0cc 100644 --- a/build.zig +++ b/build.zig @@ -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; diff --git a/test/tests.zig b/test/tests.zig index 276dc21b4b..dfc651cec4 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -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);