authorgravatar for 845767657@qq.comtaoqy <845767657@qq.com> 2026-06-08 17:23:06+08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-08-05 01:50:16+02:00
log9243d1d975c93f68c9c73a6d7a235784e04b3087
tree9fa076a327f0092ea9c01676303ae6b9f6fceb88
parent5b18caf2603066e5d29fc6f6b1fac931d85d1010

zig build: update print-configuration


1 files changed, 42 insertions(+), 4 deletions(-)

lib/compiler/Maker/ScannedConfig.zig+42-4
......@@ -12,10 +12,6 @@ top_level_steps: std.array_hash_map.String(Configuration.Step.Index),
1212path: std.Build.Cache.Path,
1313
1414pub fn print(sc: *const ScannedConfig, w: *Writer) Writer.Error!void {
15 std.log.err("TODO also print paths", .{});
16 std.log.err("TODO also print unlazy deps", .{});
17 std.log.err("TODO also print system integrations", .{});
18 std.log.err("TODO also print available options", .{});
1915 const c = &sc.configuration;
2016 var serializer: Serializer = .{ .writer = w };
2117 var s = try serializer.beginStruct(.{});
......@@ -45,6 +41,48 @@ pub fn print(sc: *const ScannedConfig, w: *Writer) Writer.Error!void {
4541 try tf.end();
4642 }
4743
44 {
45 var tf = try s.beginTupleField("path_deps", .{});
46 for (c.path_deps_base, c.path_deps_sub) |base, sub| {
47 var sf = try tf.beginStructField(.{});
48 try sf.field("base", @tagName(base), .{});
49 try sf.field("sub", sub.slice(c), .{});
50 try sf.end();
51 }
52 try tf.end();
53 }
54
55 {
56 var tf = try s.beginTupleField("unlazy_deps", .{});
57 for (c.unlazy_deps) |dep| {
58 try tf.field(dep.slice(c), .{});
59 }
60 try tf.end();
61 }
62
63 {
64 var tf = try s.beginTupleField("system_integrations", .{});
65 for (c.system_integrations) |opt| {
66 var sf = try tf.beginStructField(.{});
67 try sf.field("name", opt.name.slice(c), .{});
68 try sf.field("status", opt.status, .{});
69 try sf.end();
70 }
71 try tf.end();
72 }
73
74 {
75 var tf = try s.beginTupleField("available_options", .{});
76 for (c.available_options) |opt| {
77 var sf = try tf.beginStructField(.{});
78 try sf.field("name", opt.name.slice(c), .{});
79 try sf.field("description", opt.description.slice(c), .{});
80 try sf.field("type", @tagName(opt.type), .{});
81 try sf.end();
82 }
83 try tf.end();
84 }
85
4886 try s.end();
4987}
5088