From a249201aecdb0a342ba871ce7adc86926297dcee Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 8 May 2026 17:26:44 -0700 Subject: [PATCH] maker: fix Step.Fmt --- lib/compiler/Maker/Step.zig | 7 ++++--- lib/compiler/Maker/Step/ConfigHeader.zig | 1 - lib/compiler/Maker/Step/Fmt.zig | 12 ++++++------ lib/compiler/Maker/Step/Options.zig | 2 -- lib/compiler/Maker/Step/TranslateC.zig | 1 - lib/compiler/Maker/Step/WriteFile.zig | 1 - 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/lib/compiler/Maker/Step.zig b/lib/compiler/Maker/Step.zig index 9681c99814..cc04acf566 100644 --- a/lib/compiler/Maker/Step.zig +++ b/lib/compiler/Maker/Step.zig @@ -19,11 +19,12 @@ const WebServer = @import("WebServer.zig"); const Maker = @import("../Maker.zig"); pub const Compile = @import("Step/Compile.zig"); -pub const Run = @import("Step/Run.zig"); +pub const Fmt = @import("Step/Fmt.zig"); pub const InstallArtifact = @import("Step/InstallArtifact.zig"); pub const InstallFile = @import("Step/InstallFile.zig"); -pub const UpdateSourceFiles = @import("Step/UpdateSourceFiles.zig"); pub const ObjCopy = @import("Step/ObjCopy.zig"); +pub const Run = @import("Step/Run.zig"); +pub const UpdateSourceFiles = @import("Step/UpdateSourceFiles.zig"); /// Avoid false sharing. _: void align(std.atomic.cache_line) = {}, @@ -73,7 +74,7 @@ pub const Extended = union(enum) { config_header: Todo, fail: Fail, find_program: Todo, - fmt: Todo, + fmt: Fmt, install_artifact: InstallArtifact, install_dir: Todo, install_file: InstallFile, diff --git a/lib/compiler/Maker/Step/ConfigHeader.zig b/lib/compiler/Maker/Step/ConfigHeader.zig index 89c8134400..f823d53468 100644 --- a/lib/compiler/Maker/Step/ConfigHeader.zig +++ b/lib/compiler/Maker/Step/ConfigHeader.zig @@ -106,7 +106,6 @@ pub fn make( try man.writeManifest(); } - fn render_autoconf_undef( step: *Step, contents: []const u8, diff --git a/lib/compiler/Maker/Step/Fmt.zig b/lib/compiler/Maker/Step/Fmt.zig index 292a172ac1..addd39a969 100644 --- a/lib/compiler/Maker/Step/Fmt.zig +++ b/lib/compiler/Maker/Step/Fmt.zig @@ -24,7 +24,7 @@ pub fn make( const conf_step = step_index.ptr(conf); const conf_fmt = conf_step.extended.get(conf.extra).fmt; const paths = conf_fmt.paths.slice; - const exclude_paths = conf_fmt.paths.exclude_paths; + const exclude_paths = conf_fmt.exclude_paths.slice; argv.clearRetainingCapacity(); try argv.ensureUnusedCapacity(gpa, 2 + 1 + paths.len + 2 * exclude_paths.len); @@ -32,23 +32,23 @@ pub fn make( argv.appendAssumeCapacity(graph.zig_exe); argv.appendAssumeCapacity("fmt"); - if (fmt.check) + if (conf_fmt.flags.check) argv.appendAssumeCapacity("--check"); - for (fmt.paths) |lp| + for (paths) |lp| argv.appendAssumeCapacity(try maker.resolveLazyPathIndexAbs(arena, lp, step_index)); - for (fmt.exclude_paths) |lp| { + for (exclude_paths) |lp| { argv.appendAssumeCapacity("--exclude"); argv.appendAssumeCapacity(try maker.resolveLazyPathIndexAbs(arena, lp, step_index)); } const run_result = try step.captureChildProcess(maker, progress_node, argv.items); - if (fmt.check) switch (run_result.term) { + if (conf_fmt.flags.check) switch (run_result.term) { .exited => |code| if (code != 0 and run_result.stdout.len != 0) { var it = std.mem.tokenizeScalar(u8, run_result.stdout, '\n'); while (it.next()) |bad_file_name| { - try step.addError("{s}: non-conforming formatting", .{bad_file_name}); + try step.addError(maker, "{s}: non-conforming formatting", .{bad_file_name}); } }, else => {}, diff --git a/lib/compiler/Maker/Step/Options.zig b/lib/compiler/Maker/Step/Options.zig index f6f3d532c2..7cca163c0d 100644 --- a/lib/compiler/Maker/Step/Options.zig +++ b/lib/compiler/Maker/Step/Options.zig @@ -6,7 +6,6 @@ const Configuration = std.Build.Configuration; const Step = @import("../Step.zig"); const Maker = @import("../../Maker.zig"); - pub fn make( options: *Options, step_index: Configuration.Step.Index, @@ -81,4 +80,3 @@ pub fn make( }), } } - diff --git a/lib/compiler/Maker/Step/TranslateC.zig b/lib/compiler/Maker/Step/TranslateC.zig index 1d29ba0703..37063cb22a 100644 --- a/lib/compiler/Maker/Step/TranslateC.zig +++ b/lib/compiler/Maker/Step/TranslateC.zig @@ -1,4 +1,3 @@ - fn make(step: *Step, options: Step.MakeOptions) !void { const prog_node = options.progress_node; const b = step.owner; diff --git a/lib/compiler/Maker/Step/WriteFile.zig b/lib/compiler/Maker/Step/WriteFile.zig index d594f8983f..e392a56b01 100644 --- a/lib/compiler/Maker/Step/WriteFile.zig +++ b/lib/compiler/Maker/Step/WriteFile.zig @@ -1,4 +1,3 @@ - fn make(step: *Step, options: Step.MakeOptions) !void { _ = options; const b = step.owner;