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");...@@ -19,11 +19,12 @@ const WebServer = @import("WebServer.zig");
19const Maker = @import("../Maker.zig");19const Maker = @import("../Maker.zig");
2020
21pub const Compile = @import("Step/Compile.zig");21pub const Compile = @import("Step/Compile.zig");
22pub const Run = @import("Step/Run.zig");22pub const Fmt = @import("Step/Fmt.zig");
23pub const InstallArtifact = @import("Step/InstallArtifact.zig");23pub const InstallArtifact = @import("Step/InstallArtifact.zig");
24pub const InstallFile = @import("Step/InstallFile.zig");24pub const InstallFile = @import("Step/InstallFile.zig");
25pub const UpdateSourceFiles = @import("Step/UpdateSourceFiles.zig");
26pub const ObjCopy = @import("Step/ObjCopy.zig");25pub const ObjCopy = @import("Step/ObjCopy.zig");
26pub const Run = @import("Step/Run.zig");
27pub const UpdateSourceFiles = @import("Step/UpdateSourceFiles.zig");
2728
28/// Avoid false sharing.29/// Avoid false sharing.
29_: void align(std.atomic.cache_line) = {},30_: void align(std.atomic.cache_line) = {},
...@@ -73,7 +74,7 @@ pub const Extended = union(enum) {...@@ -73,7 +74,7 @@ pub const Extended = union(enum) {
73 config_header: Todo,74 config_header: Todo,
74 fail: Fail,75 fail: Fail,
75 find_program: Todo,76 find_program: Todo,
76 fmt: Todo,77 fmt: Fmt,
77 install_artifact: InstallArtifact,78 install_artifact: InstallArtifact,
78 install_dir: Todo,79 install_dir: Todo,
79 install_file: InstallFile,80 install_file: InstallFile,
lib/compiler/Maker/Step/ConfigHeader.zig-1
...@@ -106,7 +106,6 @@ pub fn make(...@@ -106,7 +106,6 @@ pub fn make(
106 try man.writeManifest();106 try man.writeManifest();
107}107}
108108
109
110fn render_autoconf_undef(109fn render_autoconf_undef(
111 step: *Step,110 step: *Step,
112 contents: []const u8,111 contents: []const u8,
lib/compiler/Maker/Step/Fmt.zig+6-6
...@@ -24,7 +24,7 @@ pub fn make(...@@ -24,7 +24,7 @@ pub fn make(
24 const conf_step = step_index.ptr(conf);24 const conf_step = step_index.ptr(conf);
25 const conf_fmt = conf_step.extended.get(conf.extra).fmt;25 const conf_fmt = conf_step.extended.get(conf.extra).fmt;
26 const paths = conf_fmt.paths.slice;26 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
29 argv.clearRetainingCapacity();29 argv.clearRetainingCapacity();
30 try argv.ensureUnusedCapacity(gpa, 2 + 1 + paths.len + 2 * exclude_paths.len);30 try argv.ensureUnusedCapacity(gpa, 2 + 1 + paths.len + 2 * exclude_paths.len);
...@@ -32,23 +32,23 @@ pub fn make(...@@ -32,23 +32,23 @@ pub fn make(
32 argv.appendAssumeCapacity(graph.zig_exe);32 argv.appendAssumeCapacity(graph.zig_exe);
33 argv.appendAssumeCapacity("fmt");33 argv.appendAssumeCapacity("fmt");
3434
35 if (fmt.check)35 if (conf_fmt.flags.check)
36 argv.appendAssumeCapacity("--check");36 argv.appendAssumeCapacity("--check");
3737
38 for (fmt.paths) |lp|38 for (paths) |lp|
39 argv.appendAssumeCapacity(try maker.resolveLazyPathIndexAbs(arena, lp, step_index));39 argv.appendAssumeCapacity(try maker.resolveLazyPathIndexAbs(arena, lp, step_index));
4040
41 for (fmt.exclude_paths) |lp| {41 for (exclude_paths) |lp| {
42 argv.appendAssumeCapacity("--exclude");42 argv.appendAssumeCapacity("--exclude");
43 argv.appendAssumeCapacity(try maker.resolveLazyPathIndexAbs(arena, lp, step_index));43 argv.appendAssumeCapacity(try maker.resolveLazyPathIndexAbs(arena, lp, step_index));
44 }44 }
4545
46 const run_result = try step.captureChildProcess(maker, progress_node, argv.items);46 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) {
48 .exited => |code| if (code != 0 and run_result.stdout.len != 0) {48 .exited => |code| if (code != 0 and run_result.stdout.len != 0) {
49 var it = std.mem.tokenizeScalar(u8, run_result.stdout, '\n');49 var it = std.mem.tokenizeScalar(u8, run_result.stdout, '\n');
50 while (it.next()) |bad_file_name| {50 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});
52 }52 }
53 },53 },
54 else => {},54 else => {},
lib/compiler/Maker/Step/Options.zig-2
...@@ -6,7 +6,6 @@ const Configuration = std.Build.Configuration;...@@ -6,7 +6,6 @@ const Configuration = std.Build.Configuration;
6const Step = @import("../Step.zig");6const Step = @import("../Step.zig");
7const Maker = @import("../../Maker.zig");7const Maker = @import("../../Maker.zig");
88
9
10pub fn make(9pub fn make(
11 options: *Options,10 options: *Options,
12 step_index: Configuration.Step.Index,11 step_index: Configuration.Step.Index,
...@@ -81,4 +80,3 @@ pub fn make(...@@ -81,4 +80,3 @@ pub fn make(
81 }),80 }),
82 }81 }
83}82}
84
lib/compiler/Maker/Step/TranslateC.zig-1
...@@ -1,4 +1,3 @@...@@ -1,4 +1,3 @@
1
2fn make(step: *Step, options: Step.MakeOptions) !void {1fn make(step: *Step, options: Step.MakeOptions) !void {
3 const prog_node = options.progress_node;2 const prog_node = options.progress_node;
4 const b = step.owner;3 const b = step.owner;
lib/compiler/Maker/Step/WriteFile.zig-1
...@@ -1,4 +1,3 @@...@@ -1,4 +1,3 @@
1
2fn make(step: *Step, options: Step.MakeOptions) !void {1fn make(step: *Step, options: Step.MakeOptions) !void {
3 _ = options;2 _ = options;
4 const b = step.owner;3 const b = step.owner;