mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-05-04 00:32:40 +03:00
maker: add the --listen and --seed args back to run
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user