Skip to content

Commit 75d0ec9

Browse files
authored
Merge pull request #24227 from mlugg/misc-build-stuff
`std.Build`: more miscellaneous bits
2 parents 9e340b3 + 4a9e8b7 commit 75d0ec9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-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
}

test/standalone/build.zig.zon

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@
204204
.entry_point = .{
205205
.path = "entry_point",
206206
},
207+
.run_cwd = .{
208+
.path = "run_cwd",
209+
},
207210
},
208211
.paths = .{
209212
"build.zig",

0 commit comments

Comments
 (0)