authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-08 12:33:35-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-25 18:54:35-07:00
logd45f792c91c9c43cf3dd228429205caab3a6f22d
tree4c2f18aeb7124d3caa4e31d7707d229915870f0e
parent1186a10d4e145f553a4b749042fcc02ba6efe18b

configurer: serialize Step.Fmt


2 files changed, 13 insertions(+), 3 deletions(-)

lib/compiler/configurer.zig+12-1
...@@ -889,7 +889,18 @@ fn serialize(b: *std.Build, wc: *Configuration.Wip, writer: *Io.Writer) !void {...@@ -889,7 +889,18 @@ fn serialize(b: *std.Build, wc: *Configuration.Wip, writer: *Io.Writer) !void {
889 })));889 })));
890 },890 },
891 .find_program => @panic("TODO"),891 .find_program => @panic("TODO"),
892 .fmt => @panic("TODO"),892 .fmt => e: {
893 const sf: *Step.Fmt = @fieldParentPtr("step", step);
894 break :e @enumFromInt(try wc.addExtra(@as(Configuration.Step.Fmt, .{
895 .flags = .{
896 .paths = sf.paths.len != 0,
897 .exclude_paths = sf.exclude_paths.len != 0,
898 .check = sf.check,
899 },
900 .paths = .{ .slice = try s.initLazyPathList(sf.paths) },
901 .exclude_paths = .{ .slice = try s.initLazyPathList(sf.exclude_paths) },
902 })));
903 },
893 .translate_c => @panic("TODO"),904 .translate_c => @panic("TODO"),
894 .write_file => e: {905 .write_file => e: {
895 const wf: *Step.WriteFile = @fieldParentPtr("step", step);906 const wf: *Step.WriteFile = @fieldParentPtr("step", step);
lib/std/Build/Step/Fmt.zig+1-2
...@@ -26,8 +26,7 @@ pub const Options = struct {...@@ -26,8 +26,7 @@ pub const Options = struct {
2626
27pub fn create(owner: *std.Build, options: Options) *Fmt {27pub fn create(owner: *std.Build, options: Options) *Fmt {
28 const graph = owner.graph;28 const graph = owner.graph;
29 const arena = graph.arena;29 const fmt = graph.create(Fmt);
30 const fmt = arena.create(Fmt) catch @panic("OOM");
3130
32 fmt.* = .{31 fmt.* = .{
33 .step = .init(.{32 .step = .init(.{