authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-06-20 10:28:38+01:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-06-20 10:28:38+01:00
log75d0ec9c0476da61c6f32b3d386d8844faaeb1c5
treea70b40d99686b54415ed1aa0c9fa6c6cb827321c
parent9e340b3005975e87563566a223d2f98e070f12cb
parent4a9e8b73aa9042c17d03d3de4d9070a913db2193
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #24227 from mlugg/misc-build-stuff

`std.Build`: more miscellaneous bits

2 files changed, 5 insertions(+), 3 deletions(-)

lib/std/Build/Step/Run.zig+2-3
...@@ -204,11 +204,10 @@ pub fn setName(run: *Run, name: []const u8) void {...@@ -204,11 +204,10 @@ pub fn setName(run: *Run, name: []const u8) void {
204204
205pub fn enableTestRunnerMode(run: *Run) void {205pub fn enableTestRunnerMode(run: *Run) void {
206 const b = run.step.owner;206 const b = run.step.owner;
207 const arena = b.allocator;
208 run.stdio = .zig_test;207 run.stdio = .zig_test;
208 run.addPrefixedDirectoryArg("--cache-dir=", .{ .cwd_relative = b.cache_root.path orelse "." });
209 run.addArgs(&.{209 run.addArgs(&.{
210 std.fmt.allocPrint(arena, "--seed=0x{x}", .{b.graph.random_seed}) catch @panic("OOM"),210 b.fmt("--seed=0x{x}", .{b.graph.random_seed}),
211 std.fmt.allocPrint(arena, "--cache-dir={s}", .{b.cache_root.path orelse ""}) catch @panic("OOM"),
212 "--listen=-",211 "--listen=-",
213 });212 });
214}213}
test/standalone/build.zig.zon+3
...@@ -204,6 +204,9 @@...@@ -204,6 +204,9 @@
204 .entry_point = .{204 .entry_point = .{
205 .path = "entry_point",205 .path = "entry_point",
206 },206 },
207 .run_cwd = .{
208 .path = "run_cwd",
209 },
207 },210 },
208 .paths = .{211 .paths = .{
209 "build.zig",212 "build.zig",