Skip to content

Commit 4a9e8b7

Browse files
committed
std.Build.Step.Run: pass correct relative cache dir to tests
Fixes an additional bug reported in the closed #24216.
1 parent a02a221 commit 4a9e8b7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/std/Build/Step/Run.zig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,10 @@ pub fn setName(run: *Run, name: []const u8) void {
204204

205205
pub fn enableTestRunnerMode(run: *Run) void {
206206
const b = run.step.owner;
207-
const arena = b.allocator;
208207
run.stdio = .zig_test;
208+
run.addPrefixedDirectoryArg("--cache-dir=", .{ .cwd_relative = b.cache_root.path orelse "." });
209209
run.addArgs(&.{
210-
std.fmt.allocPrint(arena, "--seed=0x{x}", .{b.graph.random_seed}) catch @panic("OOM"),
211-
std.fmt.allocPrint(arena, "--cache-dir={s}", .{b.cache_root.path orelse ""}) catch @panic("OOM"),
210+
b.fmt("--seed=0x{x}", .{b.graph.random_seed}),
212211
"--listen=-",
213212
});
214213
}

0 commit comments

Comments
 (0)