zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit d45f792c91c9c43cf3dd228429205caab3a6f22d (tree)
parent 1186a10d4e145f553a4b749042fcc02ba6efe18b
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Fri,  8 May 2026 12:33:35 -0700

configurer: serialize Step.Fmt

Diffstat:
Mlib/compiler/configurer.zig | 13++++++++++++-
Mlib/std/Build/Step/Fmt.zig | 3+--
2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/lib/compiler/configurer.zig b/lib/compiler/configurer.zig @@ -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); diff --git a/lib/std/Build/Step/Fmt.zig b/lib/std/Build/Step/Fmt.zig @@ -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(.{