From aaa314f6b2ff9481eba9d0cf72ed845c78f32c36 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 25 Sep 2026 01:56:12 -0700 Subject: [PATCH] Maker.Fuzz: fix computation of rebuilt exe path --- lib/compiler/Maker/Fuzz.zig | 9 +++++++-- lib/compiler/Maker/Step/Compile.zig | 10 ++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/compiler/Maker/Fuzz.zig b/lib/compiler/Maker/Fuzz.zig index 56f773eae9e8c4644e80419d75144419a62be49f..12e4087fa1bcd3b8c8c5d4262a8c27a6683d7dd9 100644 --- a/lib/compiler/Maker/Fuzz.zig +++ b/lib/compiler/Maker/Fuzz.zig @@ -212,7 +212,7 @@ fn rebuildTestsWorkerRunFallible( maker.printErrorMessages(comp_index, .{}, stderr.terminal(), .verbose, .indent) catch {}; } - const rebuilt_bin_path = result catch |err| switch (err) { + const rebuilt_digest = result catch |err| switch (err) { error.MakeFailed => return, else => |other| return other, }; @@ -235,7 +235,12 @@ fn rebuildTestsWorkerRunFallible( }); defer gpa.free(compile_filename); - run.rebuilt_executable = try rebuilt_bin_path.join(gpa, compile_filename); + const o_hex_digest = rebuilt_digest.toHex().?; + + run.rebuilt_executable = .{ + .root_dir = graph.local_cache_root, + .sub_path = try std.fs.path.join(gpa, &.{ "o", &o_hex_digest, compile_filename }), + }; } fn fuzzWorkerRun(fuzz: *Fuzz, run_index: Configuration.Step.Index) void { diff --git a/lib/compiler/Maker/Step/Compile.zig b/lib/compiler/Maker/Step/Compile.zig index d16b1afcdd7be88b7f1fcbff095c53bf204ef94c..b65019ed6e41890671ab9ea232e0df6317e13dec 100644 --- a/lib/compiler/Maker/Step/Compile.zig +++ b/lib/compiler/Maker/Step/Compile.zig @@ -943,9 +943,8 @@ pub fn rebuildInFuzzMode( maker: *Maker, compile_index: Configuration.Step.Index, progress_node: std.Progress.Node, -) !Path { +) !Step.OptCacheDigest { const gpa = maker.gpa; - const graph = maker.graph; const step = maker.stepByIndex(compile_index); var arena_allocator: std.heap.ArenaAllocator = .init(gpa); @@ -964,12 +963,7 @@ pub fn rebuildInFuzzMode( defer argv.deinit(gpa); try lowerZigArgs(arena, compile, compile_index, maker, progress_node, &argv, true); - const opt_cache_digest = try Step.evalZigProcess(compile_index, maker, argv.items, progress_node, false); - const o_hex_digest = opt_cache_digest.toHex().?; - return .{ - .root_dir = graph.local_cache_root, - .sub_path = try Dir.path.join(arena, &.{ "o", &o_hex_digest }), - }; + return Step.evalZigProcess(compile_index, maker, argv.items, progress_node, false); } fn addBool(gpa: Allocator, args: *std.ArrayList([]const u8), arg: []const u8, opt: bool) !void { -- 2.54.0