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

`std.Build`: more miscellaneous bits
This commit is contained in:
Matthew Lugg 2025-06-20 10:28:38 +01:00 committed by GitHub
commit 75d0ec9c04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

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

View File

@ -204,6 +204,9 @@
.entry_point = .{ .entry_point = .{
.path = "entry_point", .path = "entry_point",
}, },
.run_cwd = .{
.path = "run_cwd",
},
}, },
.paths = .{ .paths = .{
"build.zig", "build.zig",