configurer: serialize Step.Fmt

This commit is contained in:
Andrew Kelley
2026-05-08 12:33:35 -07:00
parent 1186a10d4e
commit d45f792c91
2 changed files with 13 additions and 3 deletions
+12 -1
View File
@@ -889,7 +889,18 @@ fn serialize(b: *std.Build, wc: *Configuration.Wip, writer: *Io.Writer) !void {
})));
},
.find_program => @panic("TODO"),
.fmt => @panic("TODO"),
.fmt => e: {
const sf: *Step.Fmt = @fieldParentPtr("step", step);
break :e @enumFromInt(try wc.addExtra(@as(Configuration.Step.Fmt, .{
.flags = .{
.paths = sf.paths.len != 0,
.exclude_paths = sf.exclude_paths.len != 0,
.check = sf.check,
},
.paths = .{ .slice = try s.initLazyPathList(sf.paths) },
.exclude_paths = .{ .slice = try s.initLazyPathList(sf.exclude_paths) },
})));
},
.translate_c => @panic("TODO"),
.write_file => e: {
const wf: *Step.WriteFile = @fieldParentPtr("step", step);
+1 -2
View File
@@ -26,8 +26,7 @@ pub const Options = struct {
pub fn create(owner: *std.Build, options: Options) *Fmt {
const graph = owner.graph;
const arena = graph.arena;
const fmt = arena.create(Fmt) catch @panic("OOM");
const fmt = graph.create(Fmt);
fmt.* = .{
.step = .init(.{