| author | |
| committer | |
| log | 7819e4dea7d1bd75ee1bbb8d76bb8a8ee7672962 |
| tree | 9748e4bd39ba4b3eaf05e1ca4afc95a80d90ac8b |
| parent | 8f224bc3f0065aaf971126de65b5d56d2d6d522d |
finally, a good name6 files changed, 15 insertions(+), 13 deletions(-)
BRANCH_TODO+1-1| ... | ... | @@ -40,5 +40,5 @@ if (b.args) |args| { |
| 40 | 40 | ⬇️ |
| 41 | 41 | |
| 42 | 42 | ```zig |
| 43 | run_cmd.addCliExtras(); | |
| 43 | run_cmd.addPassthruArgs(); | |
| 44 | 44 | ``` |
lib/compiler/Maker/Step/Run.zig+2-2| ... | ... | @@ -177,7 +177,7 @@ pub fn make( |
| 177 | 177 | }); |
| 178 | 178 | argv_list.items.len += 1; |
| 179 | 179 | }, |
| 180 | .cli_extras => { | |
| 180 | .passthru => { | |
| 181 | 181 | any_cli_positionals = true; |
| 182 | 182 | if (maker.run_args) |run_args| { |
| 183 | 183 | try argv_list.appendSlice(gpa, run_args); |
| ... | ... | @@ -1599,7 +1599,7 @@ pub fn rerunInFuzzMode( |
| 1599 | 1599 | }, |
| 1600 | 1600 | .output_file => unreachable, |
| 1601 | 1601 | .output_directory => unreachable, |
| 1602 | .cli_extras => unreachable, | |
| 1602 | .passthru => unreachable, | |
| 1603 | 1603 | } |
| 1604 | 1604 | } |
| 1605 | 1605 |
lib/compiler/configurer.zig+2-2| ... | ... | @@ -492,9 +492,9 @@ const Serialize = struct { |
| 492 | 492 | .producer = .{ .value = null }, |
| 493 | 493 | .generated = .{ .value = a.generated_file }, |
| 494 | 494 | }, |
| 495 | .cli_extras => .{ | |
| 495 | .passthru => .{ | |
| 496 | 496 | .flags = .{ |
| 497 | .tag = .cli_extras, | |
| 497 | .tag = .passthru, | |
| 498 | 498 | .prefix = false, |
| 499 | 499 | .suffix = false, |
| 500 | 500 | .basename = false, |
lib/init/build.zig+1-1| ... | ... | @@ -111,7 +111,7 @@ pub fn build(b: *std.Build) void { |
| 111 | 111 | |
| 112 | 112 | // This allows the user to pass arguments to the application in the build |
| 113 | 113 | // command itself, like this: `zig build run -- arg1 arg2 etc` |
| 114 | run_cmd.addCliExtras(); | |
| 114 | run_cmd.addPassthruArgs(); | |
| 115 | 115 | |
| 116 | 116 | // Creates an executable that will run `test` blocks from the provided module. |
| 117 | 117 | // Here `mod` needs to define a target, which is why earlier we made sure to |
lib/std/Build/Configuration.zig+1-1| ... | ... | @@ -567,7 +567,7 @@ pub const Step = extern struct { |
| 567 | 567 | file_content, |
| 568 | 568 | output_file, |
| 569 | 569 | output_directory, |
| 570 | cli_extras, | |
| 570 | passthru, | |
| 571 | 571 | }; |
| 572 | 572 | |
| 573 | 573 | pub const Index = IndexType(@This()); |
lib/std/Build/Step/Run.zig+8-6| ... | ... | @@ -142,7 +142,7 @@ pub const Arg = union(enum) { |
| 142 | 142 | output_file_dep: *Output, |
| 143 | 143 | output_directory: *Output, |
| 144 | 144 | /// The arguments passed after "--" on the "zig build" CLI. |
| 145 | cli_extras, | |
| 145 | passthru, | |
| 146 | 146 | }; |
| 147 | 147 | |
| 148 | 148 | pub const PrefixedArtifact = struct { |
| ... | ... | @@ -517,16 +517,18 @@ pub fn addArgs(run: *Run, args: []const []const u8) void { |
| 517 | 517 | for (args) |arg| run.addArg(arg); |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | /// Any extra positional args are provided to the `zig build` command, they are | |
| 521 | /// appended here. This causes the step to be considered to have side effects, | |
| 522 | /// disabling caching. | |
| 520 | /// Appends the extra arguments provided to `zig build` to the command line | |
| 521 | /// that will be passed to the process being run. | |
| 522 | /// | |
| 523 | /// This causes the step to be considered to have side effects, disabling | |
| 524 | /// caching. | |
| 523 | 525 | /// |
| 524 | 526 | /// In the example command `zig build run -- arg1 arg2`, "arg1" and "arg2" will |
| 525 | 527 | /// be passed to the process being run. |
| 526 | pub fn addCliExtras(run: *Run) void { | |
| 528 | pub fn addPassthruArgs(run: *Run) void { | |
| 527 | 529 | const graph = run.step.owner.graph; |
| 528 | 530 | const arena = graph.arena; |
| 529 | run.argv.append(arena, .cli_extras) catch @panic("OOM"); | |
| 531 | run.argv.append(arena, .passthru) catch @panic("OOM"); | |
| 530 | 532 | } |
| 531 | 533 | |
| 532 | 534 | pub fn setStdIn(run: *Run, stdin: StdIn) void { |