authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-09-25 01:56:12-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-09-25 01:56:12-07:00
logaaa314f6b2ff9481eba9d0cf72ed845c78f32c36
treeef4ea41d9afe67cf8f61637ca076fbbe0312f338
parent3d2207fc7917d5a2e05cbce22ba4d94cf2cbdac4

Maker.Fuzz: fix computation of rebuilt exe path


2 files changed, 9 insertions(+), 10 deletions(-)

lib/compiler/Maker/Fuzz.zig+7-2
...@@ -212,7 +212,7 @@ fn rebuildTestsWorkerRunFallible(...@@ -212,7 +212,7 @@ fn rebuildTestsWorkerRunFallible(
212 maker.printErrorMessages(comp_index, .{}, stderr.terminal(), .verbose, .indent) catch {};212 maker.printErrorMessages(comp_index, .{}, stderr.terminal(), .verbose, .indent) catch {};
213 }213 }
214214
215 const rebuilt_bin_path = result catch |err| switch (err) {215 const rebuilt_digest = result catch |err| switch (err) {
216 error.MakeFailed => return,216 error.MakeFailed => return,
217 else => |other| return other,217 else => |other| return other,
218 };218 };
...@@ -235,7 +235,12 @@ fn rebuildTestsWorkerRunFallible(...@@ -235,7 +235,12 @@ fn rebuildTestsWorkerRunFallible(
235 });235 });
236 defer gpa.free(compile_filename);236 defer gpa.free(compile_filename);
237237
238 run.rebuilt_executable = try rebuilt_bin_path.join(gpa, compile_filename);238 const o_hex_digest = rebuilt_digest.toHex().?;
239
240 run.rebuilt_executable = .{
241 .root_dir = graph.local_cache_root,
242 .sub_path = try std.fs.path.join(gpa, &.{ "o", &o_hex_digest, compile_filename }),
243 };
239}244}
240245
241fn fuzzWorkerRun(fuzz: *Fuzz, run_index: Configuration.Step.Index) void {246fn fuzzWorkerRun(fuzz: *Fuzz, run_index: Configuration.Step.Index) void {
lib/compiler/Maker/Step/Compile.zig+2-8
...@@ -943,9 +943,8 @@ pub fn rebuildInFuzzMode(...@@ -943,9 +943,8 @@ pub fn rebuildInFuzzMode(
943 maker: *Maker,943 maker: *Maker,
944 compile_index: Configuration.Step.Index,944 compile_index: Configuration.Step.Index,
945 progress_node: std.Progress.Node,945 progress_node: std.Progress.Node,
946) !Path {946) !Step.OptCacheDigest {
947 const gpa = maker.gpa;947 const gpa = maker.gpa;
948 const graph = maker.graph;
949 const step = maker.stepByIndex(compile_index);948 const step = maker.stepByIndex(compile_index);
950949
951 var arena_allocator: std.heap.ArenaAllocator = .init(gpa);950 var arena_allocator: std.heap.ArenaAllocator = .init(gpa);
...@@ -964,12 +963,7 @@ pub fn rebuildInFuzzMode(...@@ -964,12 +963,7 @@ pub fn rebuildInFuzzMode(
964 defer argv.deinit(gpa);963 defer argv.deinit(gpa);
965964
966 try lowerZigArgs(arena, compile, compile_index, maker, progress_node, &argv, true);965 try lowerZigArgs(arena, compile, compile_index, maker, progress_node, &argv, true);
967 const opt_cache_digest = try Step.evalZigProcess(compile_index, maker, argv.items, progress_node, false);966 return Step.evalZigProcess(compile_index, maker, argv.items, progress_node, false);
968 const o_hex_digest = opt_cache_digest.toHex().?;
969 return .{
970 .root_dir = graph.local_cache_root,
971 .sub_path = try Dir.path.join(arena, &.{ "o", &o_hex_digest }),
972 };
973}967}
974968
975fn addBool(gpa: Allocator, args: *std.ArrayList([]const u8), arg: []const u8, opt: bool) !void {969fn addBool(gpa: Allocator, args: *std.ArrayList([]const u8), arg: []const u8, opt: bool) !void {