zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 4a9e8b73aa9042c17d03d3de4d9070a913db2193 (tree)
parent a02a2219eed3eeecad7bf28d8cabdfb053bbf1ce
Author: mlugg <mlugg@mlugg.co.uk>
Date:   Fri, 20 Jun 2025 00:33:44 +0100

std.Build.Step.Run: pass correct relative cache dir to tests

Fixes an additional bug reported in the closed #24216.

Diffstat:
Mlib/std/Build/Step/Run.zig | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/std/Build/Step/Run.zig b/lib/std/Build/Step/Run.zig @@ -204,11 +204,10 @@ pub fn setName(run: *Run, name: []const u8) void { pub fn enableTestRunnerMode(run: *Run) void { const b = run.step.owner; - const arena = b.allocator; run.stdio = .zig_test; + run.addPrefixedDirectoryArg("--cache-dir=", .{ .cwd_relative = b.cache_root.path orelse "." }); run.addArgs(&.{ - std.fmt.allocPrint(arena, "--seed=0x{x}", .{b.graph.random_seed}) catch @panic("OOM"), - std.fmt.allocPrint(arena, "--cache-dir={s}", .{b.cache_root.path orelse ""}) catch @panic("OOM"), + b.fmt("--seed=0x{x}", .{b.graph.random_seed}), "--listen=-", }); }