maker: fix Step.Fmt

This commit is contained in:
Andrew Kelley
2026-05-08 17:26:44 -07:00
parent 42be6c0088
commit a249201aec
6 changed files with 10 additions and 14 deletions
+4 -3
View File
@@ -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,
-1
View File
@@ -106,7 +106,6 @@ pub fn make(
try man.writeManifest();
}
fn render_autoconf_undef(
step: *Step,
contents: []const u8,
+6 -6
View File
@@ -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 => {},
-2
View File
@@ -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(
}),
}
}
-1
View File
@@ -1,4 +1,3 @@
fn make(step: *Step, options: Step.MakeOptions) !void {
const prog_node = options.progress_node;
const b = step.owner;
-1
View File
@@ -1,4 +1,3 @@
fn make(step: *Step, options: Step.MakeOptions) !void {
_ = options;
const b = step.owner;