authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-04-29 15:53:30-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-25 18:54:34-07:00
log1e956fda90a9fe6d832c044838a1e6278a775c50
tree242076fcf4dd4b756134164bf5fc668e1b8242c4
parent0f3471eb6643140c67587c205aea6582f415dd06

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


3 files changed, 15 insertions(+), 6 deletions(-)

BRANCH_TODO-1
......@@ -2,7 +2,6 @@
22* make addExtra return Index using reflection
33* remove Cache from configurer
44* implement the build options
5* don't forget to add -listen arg back
65* get zig init template working
76* finish migrating the rest of the build steps
87* make zig-pkg path root configurable in maker (make sure --system still works)
lib/compiler/Maker/Step/Run.zig+7
......@@ -183,6 +183,13 @@ pub fn make(
183183 }
184184 }
185185
186 man.hash.add(conf_run.flags.test_runner_mode);
187 if (conf_run.flags.test_runner_mode) {
188 try argv_list.ensureUnusedCapacity(gpa, 2);
189 argv_list.appendAssumeCapacity(try allocPrint(arena, "--seed=0x{x}", .{graph.random_seed}));
190 argv_list.appendAssumeCapacity("--listen=-");
191 }
192
186193 switch (conf_run.stdin.u) {
187194 .bytes => |bytes| {
188195 man.hash.addBytes(bytes.slice(conf));
lib/std/Build.zig+8-5
......@@ -796,16 +796,19 @@ pub fn addSystemCommand(b: *Build, argv: []const []const u8) *Step.Run {
796796
797797/// Creates a `Step.Run` with an executable built with `addExecutable`.
798798/// Add command line arguments with methods of `Step.Run`.
799///
800/// It doesn't have to target the host. In some cases cross-compiled binaries
801/// can even be executed.
802///
803/// This is declarative; it constructs a build step that may or may not be run
804/// depending on the options provided by the user to the build command.
799805pub fn addRunArtifact(b: *Build, exe: *Step.Compile) *Step.Run {
800 // It doesn't have to be native. We catch that if you actually try to run it.
801 // Consider that this is declarative; the run step may not be run unless a user
802 // option is supplied.
803806
804807 // Avoid the common case of the step name looking like "run test test".
805808 const step_name = if (exe.kind.isTest() and mem.eql(u8, exe.name, "test"))
806 b.fmt("run {s}", .{@tagName(exe.kind)})
809 b.fmt("run {t}", .{exe.kind})
807810 else
808 b.fmt("run {s} {s}", .{ @tagName(exe.kind), exe.name });
811 b.fmt("run {t} {s}", .{ exe.kind, exe.name });
809812
810813 const run_step = Step.Run.create(b, step_name);
811814 run_step.producer = exe;