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 @@...@@ -2,7 +2,6 @@
2* make addExtra return Index using reflection2* make addExtra return Index using reflection
3* remove Cache from configurer3* remove Cache from configurer
4* implement the build options4* implement the build options
5* don't forget to add -listen arg back
6* get zig init template working5* get zig init template working
7* finish migrating the rest of the build steps6* finish migrating the rest of the build steps
8* make zig-pkg path root configurable in maker (make sure --system still works)7* 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(...@@ -183,6 +183,13 @@ pub fn make(
183 }183 }
184 }184 }
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
186 switch (conf_run.stdin.u) {193 switch (conf_run.stdin.u) {
187 .bytes => |bytes| {194 .bytes => |bytes| {
188 man.hash.addBytes(bytes.slice(conf));195 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 {...@@ -796,16 +796,19 @@ pub fn addSystemCommand(b: *Build, argv: []const []const u8) *Step.Run {
796796
797/// Creates a `Step.Run` with an executable built with `addExecutable`.797/// Creates a `Step.Run` with an executable built with `addExecutable`.
798/// Add command line arguments with methods of `Step.Run`.798/// 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.
799pub fn addRunArtifact(b: *Build, exe: *Step.Compile) *Step.Run {805pub 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
804 // Avoid the common case of the step name looking like "run test test".807 // Avoid the common case of the step name looking like "run test test".
805 const step_name = if (exe.kind.isTest() and mem.eql(u8, exe.name, "test"))808 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})
807 else810 else
808 b.fmt("run {s} {s}", .{ @tagName(exe.kind), exe.name });811 b.fmt("run {t} {s}", .{ exe.kind, exe.name });
809812
810 const run_step = Step.Run.create(b, step_name);813 const run_step = Step.Run.create(b, step_name);
811 run_step.producer = exe;814 run_step.producer = exe;