authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-08 17:26:44-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-25 18:54:35-07:00
loga249201aecdb0a342ba871ce7adc86926297dcee
treef004106fdd251bfc182eab55302659f7c636dce1
parent42be6c0088ece7f3df2a30cfbaee0d77151f762a

maker: fix Step.Fmt


6 files changed, 10 insertions(+), 14 deletions(-)

lib/compiler/Maker/Step.zig+4-3
......@@ -19,11 +19,12 @@ const WebServer = @import("WebServer.zig");
1919const Maker = @import("../Maker.zig");
2020
2121pub const Compile = @import("Step/Compile.zig");
22pub const Run = @import("Step/Run.zig");
22pub const Fmt = @import("Step/Fmt.zig");
2323pub const InstallArtifact = @import("Step/InstallArtifact.zig");
2424pub const InstallFile = @import("Step/InstallFile.zig");
25pub const UpdateSourceFiles = @import("Step/UpdateSourceFiles.zig");
2625pub const ObjCopy = @import("Step/ObjCopy.zig");
26pub const Run = @import("Step/Run.zig");
27pub const UpdateSourceFiles = @import("Step/UpdateSourceFiles.zig");
2728
2829/// Avoid false sharing.
2930_: void align(std.atomic.cache_line) = {},
......@@ -73,7 +74,7 @@ pub const Extended = union(enum) {
7374 config_header: Todo,
7475 fail: Fail,
7576 find_program: Todo,
76 fmt: Todo,
77 fmt: Fmt,
7778 install_artifact: InstallArtifact,
7879 install_dir: Todo,
7980 install_file: InstallFile,
lib/compiler/Maker/Step/ConfigHeader.zig-1
......@@ -106,7 +106,6 @@ pub fn make(
106106 try man.writeManifest();
107107}
108108
109
110109fn render_autoconf_undef(
111110 step: *Step,
112111 contents: []const u8,
lib/compiler/Maker/Step/Fmt.zig+6-6
......@@ -24,7 +24,7 @@ pub fn make(
2424 const conf_step = step_index.ptr(conf);
2525 const conf_fmt = conf_step.extended.get(conf.extra).fmt;
2626 const paths = conf_fmt.paths.slice;
27 const exclude_paths = conf_fmt.paths.exclude_paths;
27 const exclude_paths = conf_fmt.exclude_paths.slice;
2828
2929 argv.clearRetainingCapacity();
3030 try argv.ensureUnusedCapacity(gpa, 2 + 1 + paths.len + 2 * exclude_paths.len);
......@@ -32,23 +32,23 @@ pub fn make(
3232 argv.appendAssumeCapacity(graph.zig_exe);
3333 argv.appendAssumeCapacity("fmt");
3434
35 if (fmt.check)
35 if (conf_fmt.flags.check)
3636 argv.appendAssumeCapacity("--check");
3737
38 for (fmt.paths) |lp|
38 for (paths) |lp|
3939 argv.appendAssumeCapacity(try maker.resolveLazyPathIndexAbs(arena, lp, step_index));
4040
41 for (fmt.exclude_paths) |lp| {
41 for (exclude_paths) |lp| {
4242 argv.appendAssumeCapacity("--exclude");
4343 argv.appendAssumeCapacity(try maker.resolveLazyPathIndexAbs(arena, lp, step_index));
4444 }
4545
4646 const run_result = try step.captureChildProcess(maker, progress_node, argv.items);
47 if (fmt.check) switch (run_result.term) {
47 if (conf_fmt.flags.check) switch (run_result.term) {
4848 .exited => |code| if (code != 0 and run_result.stdout.len != 0) {
4949 var it = std.mem.tokenizeScalar(u8, run_result.stdout, '\n');
5050 while (it.next()) |bad_file_name| {
51 try step.addError("{s}: non-conforming formatting", .{bad_file_name});
51 try step.addError(maker, "{s}: non-conforming formatting", .{bad_file_name});
5252 }
5353 },
5454 else => {},
lib/compiler/Maker/Step/Options.zig-2
......@@ -6,7 +6,6 @@ const Configuration = std.Build.Configuration;
66const Step = @import("../Step.zig");
77const Maker = @import("../../Maker.zig");
88
9
109pub fn make(
1110 options: *Options,
1211 step_index: Configuration.Step.Index,
......@@ -81,4 +80,3 @@ pub fn make(
8180 }),
8281 }
8382}
84
lib/compiler/Maker/Step/TranslateC.zig-1
......@@ -1,4 +1,3 @@
1
21fn make(step: *Step, options: Step.MakeOptions) !void {
32 const prog_node = options.progress_node;
43 const b = step.owner;
lib/compiler/Maker/Step/WriteFile.zig-1
......@@ -1,4 +1,3 @@
1
21fn make(step: *Step, options: Step.MakeOptions) !void {
32 _ = options;
43 const b = step.owner;