maker: add the --listen and --seed args back to run

This commit is contained in:
Andrew Kelley
2026-04-29 15:53:30 -07:00
parent f00d4e966a
commit 7fa49fc283
3 changed files with 15 additions and 6 deletions
-1
View File
@@ -2,7 +2,6 @@
* make addExtra return Index using reflection
* remove Cache from configurer
* implement the build options
* don't forget to add -listen arg back
* get zig init template working
* finish migrating the rest of the build steps
* make zig-pkg path root configurable in maker (make sure --system still works)
+7
View File
@@ -183,6 +183,13 @@ pub fn make(
}
}
man.hash.add(conf_run.flags.test_runner_mode);
if (conf_run.flags.test_runner_mode) {
try argv_list.ensureUnusedCapacity(gpa, 2);
argv_list.appendAssumeCapacity(try allocPrint(arena, "--seed=0x{x}", .{graph.random_seed}));
argv_list.appendAssumeCapacity("--listen=-");
}
switch (conf_run.stdin.u) {
.bytes => |bytes| {
man.hash.addBytes(bytes.slice(conf));
+8 -5
View File
@@ -796,16 +796,19 @@ pub fn addSystemCommand(b: *Build, argv: []const []const u8) *Step.Run {
/// Creates a `Step.Run` with an executable built with `addExecutable`.
/// Add command line arguments with methods of `Step.Run`.
///
/// It doesn't have to target the host. In some cases cross-compiled binaries
/// can even be executed.
///
/// This is declarative; it constructs a build step that may or may not be run
/// depending on the options provided by the user to the build command.
pub fn addRunArtifact(b: *Build, exe: *Step.Compile) *Step.Run {
// It doesn't have to be native. We catch that if you actually try to run it.
// Consider that this is declarative; the run step may not be run unless a user
// option is supplied.
// Avoid the common case of the step name looking like "run test test".
const step_name = if (exe.kind.isTest() and mem.eql(u8, exe.name, "test"))
b.fmt("run {s}", .{@tagName(exe.kind)})
b.fmt("run {t}", .{exe.kind})
else
b.fmt("run {s} {s}", .{ @tagName(exe.kind), exe.name });
b.fmt("run {t} {s}", .{ exe.kind, exe.name });
const run_step = Step.Run.create(b, step_name);
run_step.producer = exe;