authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-22 21:51:11-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-25 18:54:36-07:00
loge435299cfa6a6bd446483e6c95a56bf1cdca8cfd
treeeebe78d6bcd4eaa80e8ed04df576a952c82de172
parented1f00582670df44c15875914a1cc8fc0ff6329f

Maker: progress towards ConfigHeader

however... why is this done in the make phase anyway? making a header like this is typically done by the configure phase...

3 files changed, 139 insertions(+), 120 deletions(-)

lib/compiler/Maker/Step.zig+5-18
......@@ -20,6 +20,7 @@ const Maker = @import("../Maker.zig");
2020
2121pub const CheckFile = @import("Step/CheckFile.zig");
2222pub const Compile = @import("Step/Compile.zig");
23pub const ConfigHeader = @import("Step/ConfigHeader.zig");
2324pub const FindProgram = @import("Step/FindProgram.zig");
2425pub const Fmt = @import("Step/Fmt.zig");
2526pub const InstallArtifact = @import("Step/InstallArtifact.zig");
......@@ -78,7 +79,7 @@ comptime {
7879pub const Extended = union(enum) {
7980 check_file: CheckFile,
8081 compile: Compile,
81 config_header: Todo,
82 config_header: ConfigHeader,
8283 fail: Fail,
8384 find_program: FindProgram,
8485 fmt: Fmt,
......@@ -114,21 +115,6 @@ pub const Extended = union(enum) {
114115 };
115116 }
116117
117 pub const Todo = struct {
118 pub fn make(
119 todo: *Todo,
120 step_index: Configuration.Step.Index,
121 maker: *Maker,
122 progress_node: std.Progress.Node,
123 ) Step.ExtendedMakeError!void {
124 _ = todo;
125 _ = progress_node;
126 const conf = &maker.scanned_config.configuration;
127 const conf_step = step_index.ptr(conf);
128 std.debug.panic("TODO implement another step type: {s}", .{conf_step.name.slice(conf)});
129 }
130 };
131
132118 pub const TopLevel = struct {
133119 pub fn make(
134120 top_level: *TopLevel,
......@@ -750,8 +736,9 @@ fn failWithCacheError(
750736/// separately from using the cache system.
751737pub fn writeManifest(s: *Step, maker: *Maker, man: *Cache.Manifest) !void {
752738 if (s.test_results.isSuccess()) {
753 man.writeManifest() catch |err| {
754 try s.addError(maker, "failed writing cache manifest: {t}", .{err});
739 man.writeManifest() catch |err| switch (err) {
740 error.Canceled => |e| return e,
741 else => |e| try s.addError(maker, "failed writing cache manifest: {t}", .{e}),
755742 };
756743 }
757744}
lib/compiler/Maker/Step/ConfigHeader.zig+133-101
......@@ -4,22 +4,35 @@ const std = @import("std");
44const Io = std.Io;
55const Configuration = std.Build.Configuration;
66const Writer = std.Io.Writer;
7const Path = std.Build.Cache.Path;
8const Allocator = std.mem.Allocator;
79
810const Step = @import("../Step.zig");
911const Maker = @import("../../Maker.zig");
1012
13 const header_text = "This file was generated by ConfigHeader using the Zig Build System.";
14 const c_generated_line = "/* " ++ header_text ++ " */\n";
15 const asm_generated_line = "; " ++ header_text ++ "\n";
16
1117pub fn make(
1218 config_header: *ConfigHeader,
1319 step_index: Configuration.Step.Index,
1420 maker: *Maker,
1521 progress_node: std.Progress.Node,
1622) Step.ExtendedMakeError!void {
23 _ = config_header;
24 _ = progress_node;
1725 const graph = maker.graph;
18 const arena = maker.graph.arena; // TODO don't leak into process arena
26 const gpa = maker.gpa;
1927 const step = maker.stepByIndex(step_index);
2028 const io = graph.io;
29 const arena = graph.arena; // TODO don't leak into the process arena
30 const conf = &maker.scanned_config.configuration;
31 const conf_step = step_index.ptr(conf);
32 const conf_ch = conf_step.extended.get(conf.extra).config_header;
33 const cache_root = graph.local_cache_root;
2134
22 if (config_header.style.getPath()) |lp|
35 if (conf_ch.style.getPath()) |lp|
2336 try step.singleUnchangingWatchInput(maker, arena, lp);
2437
2538 var man = graph.cache.obtain();
......@@ -29,45 +42,51 @@ pub fn make(
2942 // random bytes when ConfigHeader implementation is modified in a
3043 // non-backwards-compatible way.
3144 man.hash.add(@as(u32, 0xdef08d23));
32 man.hash.addBytes(config_header.include_path);
33 man.hash.addOptionalBytes(config_header.include_guard_override);
45 man.hash.addBytes(conf_ch.include_path);
46 man.hash.addOptionalBytes(conf_ch.include_guard_override);
3447
3548 var aw: Writer.Allocating = .init(arena);
3649 defer aw.deinit();
37 const bw = &aw.writer;
3850
39 const header_text = "This file was generated by ConfigHeader using the Zig Build System.";
40 const c_generated_line = "/* " ++ header_text ++ " */\n";
41 const asm_generated_line = "; " ++ header_text ++ "\n";
42
43 switch (config_header.style) {
44 .autoconf_undef, .autoconf_at => |file_source| {
45 try bw.writeAll(c_generated_line);
46 const src_path = file_source.getPath2(b, step);
47 const contents = Io.Dir.cwd().readFileAlloc(io, src_path, arena, .limited(config_header.max_bytes)) catch |err| {
51 switch (conf_ch.flags.style) {
52 .autoconf_undef => {
53 const src_path = try maker.resolveLazyPathIndex(arena, conf_ch.template_file.value.?, step_index);
54 const contents = Io.Dir.cwd().readFileAlloc(io, src_path, arena, .limited(conf_ch.max_bytes)) catch |err|
4855 return step.fail("unable to read autoconf input file {s}: {t}", .{ src_path, err });
56 renderAutoConfUndef(step, contents, &aw.writer, &conf_ch.values, src_path) catch |err| switch (err) {
57 error.WriteFailed => return error.OutOfMemory,
58 else => |e| return e,
59 };
60 },
61 .autoconf_at => {
62 const src_path = try maker.resolveLazyPathIndex(arena, conf_ch.template_file.value.?, step_index);
63 const contents = Io.Dir.cwd().readFileAlloc(io, src_path, arena, .limited(conf_ch.max_bytes)) catch |err|
64 return step.fail("unable to read autoconf input file {s}: {t}", .{ src_path, err });
65 renderAutoconfAt(step, contents, &aw, &conf_ch.values, src_path) catch |err| switch (err) {
66 error.WriteFailed => return error.OutOfMemory,
67 else => |e| return e,
4968 };
50 switch (config_header.style) {
51 .autoconf_undef => try render_autoconf_undef(step, contents, bw, &config_header.values, src_path),
52 .autoconf_at => try render_autoconf_at(step, contents, &aw, &config_header.values, src_path),
53 else => unreachable,
54 }
5569 },
56 .cmake => |file_source| {
57 try bw.writeAll(c_generated_line);
58 const src_path = file_source.getPath2(b, step);
59 const contents = Io.Dir.cwd().readFileAlloc(io, src_path, arena, .limited(config_header.max_bytes)) catch |err| {
70 .cmake => {
71 const src_path = try maker.resolveLazyPathIndex(arena, conf_ch.template_file.value.?, step_index);
72 const contents = Io.Dir.cwd().readFileAlloc(io, src_path, arena, .limited(conf_ch.max_bytes)) catch |err|
6073 return step.fail("unable to read cmake input file {s}: {t}", .{ src_path, err });
74 renderCmake(step, contents, &aw.writer, conf_ch.values, src_path) catch |err| switch (err) {
75 error.WriteFailed => return error.OutOfMemory,
76 else => |e| return e,
6177 };
62 try render_cmake(step, contents, bw, config_header.values, src_path);
6378 },
6479 .blank => {
65 try bw.writeAll(c_generated_line);
66 try render_blank(gpa, bw, config_header.values, config_header.include_path, config_header.include_guard_override);
80 renderBlank(gpa, &aw.writer, conf_ch.values, conf_ch.include_path, conf_ch.include_guard_override) catch |err| switch (err) {
81 error.WriteFailed => return error.OutOfMemory,
82 else => |e| return e,
83 };
6784 },
6885 .nasm => {
69 try bw.writeAll(asm_generated_line);
70 try render_nasm(bw, config_header.values);
86 renderNasm(&aw.writer, conf_ch.values) catch |err| switch (err) {
87 error.WriteFailed => return error.OutOfMemory,
88 else => |e| return e,
89 };
7190 },
7291 }
7392
......@@ -76,7 +95,10 @@ pub fn make(
7695
7796 if (try step.cacheHit(&man)) {
7897 const digest = man.final();
79 config_header.generated_dir.path = try b.cache_root.join(arena, &.{ "o", &digest });
98 maker.generatedPath().* = .{
99 .root_dir = cache_root,
100 .sub_path = try Io.Dir.path.join(arena, &.{ "o", &digest }),
101 };
80102 return;
81103 }
82104
......@@ -87,35 +109,38 @@ pub fn make(
87109 // output_path is libavutil/avconfig.h
88110 // We want to open directory zig-cache/o/HASH/libavutil/
89111 // but keep output_dir as zig-cache/o/HASH for -I include
90 const sub_path = b.pathJoin(&.{ "o", &digest, config_header.include_path });
91 const sub_path_dirname = std.fs.path.dirname(sub_path).?;
92
93 b.cache_root.handle.createDirPath(io, sub_path_dirname) catch |err| {
94 return step.fail("unable to make path '{f}{s}': {s}", .{
95 b.cache_root, sub_path_dirname, @errorName(err),
96 });
112 const out_path: Path = .{
113 .root_dir = cache_root,
114 .sub_path = try Io.Dir.path.join(arena, &.{ "o", &digest, conf_ch.include_path.slice(conf) }),
97115 };
116 const out_path_dirname = out_path.dirname().?;
117
118 out_path_dirname.root_dir.handle.createDirPath(io, out_path_dirname.sub_path) catch |err|
119 return step.fail("unable to make path {f}: {t}", .{ out_path_dirname, err });
98120
99 b.cache_root.handle.writeFile(io, .{ .sub_path = sub_path, .data = output }) catch |err| {
100 return step.fail("unable to write file '{f}{s}': {s}", .{
101 b.cache_root, sub_path, @errorName(err),
102 });
121 out_path.root_dir.handle.writeFile(io, .{ .sub_path = out_path.sub_path, .data = output }) catch |err|
122 return step.fail("unable to write file {f}: {t}", .{ out_path, err });
123
124 maker.generatedPath().* = .{
125 .root_dir = cache_root,
126 .sub_path = try Io.Dir.path.join(arena, &.{ "o", &digest }),
103127 };
104128
105 config_header.generated_dir.path = try b.cache_root.join(arena, &.{ "o", &digest });
106 try man.writeManifest();
129 try step.writeManifest(maker, &man);
107130}
108131
109fn render_autoconf_undef(
132fn renderAutoConfUndef(
110133 step: *Step,
111134 contents: []const u8,
112 bw: *Writer,
135 w: *Writer,
113136 values: *const std.array_hash_map.String(Value),
114137 src_path: []const u8,
115138) !void {
116139 const build = step.owner;
117140 const allocator = build.allocator;
118141
142 try w.writeAll(c_generated_line);
143
119144 var is_used: std.bit_set.Dynamic = try .initEmpty(allocator, values.count());
120145 defer is_used.deinit(allocator);
121146
......@@ -124,15 +149,15 @@ fn render_autoconf_undef(
124149 var line_it = std.mem.splitScalar(u8, contents, '\n');
125150 while (line_it.next()) |line| : (line_index += 1) {
126151 if (!std.mem.startsWith(u8, line, "#")) {
127 try bw.writeAll(line);
128 try bw.writeByte('\n');
152 try w.writeAll(line);
153 try w.writeByte('\n');
129154 continue;
130155 }
131156 var it = std.mem.tokenizeAny(u8, line[1..], " \t\r");
132157 const undef = it.next().?;
133158 if (!std.mem.eql(u8, undef, "undef")) {
134 try bw.writeAll(line);
135 try bw.writeByte('\n');
159 try w.writeAll(line);
160 try w.writeByte('\n');
136161 continue;
137162 }
138163 const name = it.next().?;
......@@ -144,7 +169,7 @@ fn render_autoconf_undef(
144169 continue;
145170 };
146171 is_used.set(index);
147 try renderValueC(bw, name, values.values()[index]);
172 try renderValueC(w, name, values.values()[index]);
148173 }
149174
150175 var unused_value_it = is_used.iterator(.{ .kind = .unset });
......@@ -158,7 +183,7 @@ fn render_autoconf_undef(
158183 }
159184}
160185
161fn render_autoconf_at(
186fn renderAutoconfAt(
162187 step: *Step,
163188 contents: []const u8,
164189 aw: *Writer.Allocating,
......@@ -167,7 +192,9 @@ fn render_autoconf_at(
167192) !void {
168193 const build = step.owner;
169194 const allocator = build.allocator;
170 const bw = &aw.writer;
195 const w = &aw.writer;
196
197 try w.writeAll(c_generated_line);
171198
172199 const used = allocator.alloc(bool, values.count()) catch @panic("OOM");
173200 for (used) |*u| u.* = false;
......@@ -180,7 +207,7 @@ fn render_autoconf_at(
180207 const last_line = line_it.index == line_it.buffer.len;
181208
182209 const old_len = aw.written().len;
183 expand_variables_autoconf_at(bw, line, values, used) catch |err| switch (err) {
210 expandVariablesAutoconfAt(w, line, values, used) catch |err| switch (err) {
184211 error.MissingValue => {
185212 const name = aw.written()[old_len..];
186213 defer aw.shrinkRetainingCapacity(old_len);
......@@ -198,7 +225,7 @@ fn render_autoconf_at(
198225 continue;
199226 },
200227 };
201 if (!last_line) try bw.writeByte('\n');
228 if (!last_line) try w.writeByte('\n');
202229 }
203230
204231 for (values.entries.slice().items(.key), used) |name, u| {
......@@ -211,16 +238,18 @@ fn render_autoconf_at(
211238 if (any_errors) return error.MakeFailed;
212239}
213240
214fn render_cmake(
241fn renderCmake(
215242 step: *Step,
216243 contents: []const u8,
217 bw: *Writer,
244 w: *Writer,
218245 values: std.array_hash_map.String(Value),
219246 src_path: []const u8,
220247) !void {
221248 const build = step.owner;
222249 const allocator = build.allocator;
223250
251 try w.writeAll(c_generated_line);
252
224253 var values_copy = try values.clone(allocator);
225254 defer values_copy.deinit(allocator);
226255
......@@ -230,7 +259,7 @@ fn render_cmake(
230259 while (line_it.next()) |raw_line| : (line_index += 1) {
231260 const last_line = line_it.index == line_it.buffer.len;
232261
233 const line = expand_variables_cmake(allocator, raw_line, values) catch |err| switch (err) {
262 const line = expandVariablesCmake(allocator, raw_line, values) catch |err| switch (err) {
234263 error.InvalidCharacter => {
235264 try step.addError("{s}:{d}: error: invalid character in a variable name", .{
236265 src_path, line_index + 1,
......@@ -249,16 +278,16 @@ fn render_cmake(
249278 defer allocator.free(line);
250279
251280 const line_start = std.mem.findNone(u8, line, " \t\r") orelse {
252 try bw.writeAll(line);
253 if (!last_line) try bw.writeByte('\n');
281 try w.writeAll(line);
282 if (!last_line) try w.writeByte('\n');
254283 continue;
255284 };
256285 const whitespace_prefix = line[0..line_start];
257286 const trimmed_line = line[line_start..];
258287
259288 if (!std.mem.startsWith(u8, trimmed_line, "#")) {
260 try bw.writeAll(line);
261 if (!last_line) try bw.writeByte('\n');
289 try w.writeAll(line);
290 if (!last_line) try w.writeByte('\n');
262291 continue;
263292 }
264293
......@@ -267,8 +296,8 @@ fn render_cmake(
267296 if (!std.mem.eql(u8, cmakedefine, "cmakedefine") and
268297 !std.mem.eql(u8, cmakedefine, "cmakedefine01"))
269298 {
270 try bw.writeAll(line);
271 if (!last_line) try bw.writeByte('\n');
299 try w.writeAll(line);
300 if (!last_line) try w.writeByte('\n');
272301 continue;
273302 }
274303
......@@ -339,8 +368,8 @@ fn render_cmake(
339368 value = Value{ .ident = it.rest() };
340369 }
341370
342 try bw.writeAll(whitespace_prefix);
343 try renderValueC(bw, name, value);
371 try w.writeAll(whitespace_prefix);
372 try renderValueC(w, name, value);
344373 }
345374
346375 if (any_errors) {
......@@ -348,13 +377,15 @@ fn render_cmake(
348377 }
349378}
350379
351fn render_blank(
380fn renderBlank(
352381 gpa: std.mem.Allocator,
353 bw: *Writer,
382 w: *Writer,
354383 defines: std.array_hash_map.String(Value),
355384 include_path: []const u8,
356385 include_guard_override: ?[]const u8,
357386) !void {
387 try w.writeAll(c_generated_line);
388
358389 const include_guard_name = include_guard_override orelse blk: {
359390 const name = try gpa.dupe(u8, include_path);
360391 for (name) |*byte| {
......@@ -368,51 +399,52 @@ fn render_blank(
368399 };
369400 defer if (include_guard_override == null) gpa.free(include_guard_name);
370401
371 try bw.print(
402 try w.print(
372403 \\#ifndef {[0]s}
373404 \\#define {[0]s}
374405 \\
375406 , .{include_guard_name});
376407
377408 const values = defines.values();
378 for (defines.keys(), 0..) |name, i| try renderValueC(bw, name, values[i]);
409 for (defines.keys(), 0..) |name, i| try renderValueC(w, name, values[i]);
379410
380 try bw.print(
411 try w.print(
381412 \\#endif /* {s} */
382413 \\
383414 , .{include_guard_name});
384415}
385416
386fn render_nasm(bw: *Writer, defines: std.array_hash_map.String(Value)) !void {
387 for (defines.keys(), defines.values()) |name, value| try renderValueNasm(bw, name, value);
417fn renderNasm(w: *Writer, defines: std.array_hash_map.String(Value)) !void {
418 try w.writeAll(asm_generated_line);
419 for (defines.keys(), defines.values()) |name, value| try renderValueNasm(w, name, value);
388420}
389421
390fn renderValueC(bw: *Writer, name: []const u8, value: Value) !void {
422fn renderValueC(w: *Writer, name: []const u8, value: Value) !void {
391423 switch (value) {
392 .undef => try bw.print("/* #undef {s} */\n", .{name}),
393 .defined => try bw.print("#define {s}\n", .{name}),
394 .boolean => |b| try bw.print("#define {s} {c}\n", .{ name, @as(u8, '0') + @intFromBool(b) }),
395 .int => |i| try bw.print("#define {s} {d}\n", .{ name, i }),
396 .ident => |ident| try bw.print("#define {s} {s}\n", .{ name, ident }),
424 .undef => try w.print("/* #undef {s} */\n", .{name}),
425 .defined => try w.print("#define {s}\n", .{name}),
426 .boolean => |b| try w.print("#define {s} {c}\n", .{ name, @as(u8, '0') + @intFromBool(b) }),
427 .int => |i| try w.print("#define {s} {d}\n", .{ name, i }),
428 .ident => |ident| try w.print("#define {s} {s}\n", .{ name, ident }),
397429 // TODO: use C-specific escaping instead of zig string literals
398 .string => |string| try bw.print("#define {s} \"{f}\"\n", .{ name, std.zig.fmtString(string) }),
430 .string => |string| try w.print("#define {s} \"{f}\"\n", .{ name, std.zig.fmtString(string) }),
399431 }
400432}
401433
402fn renderValueNasm(bw: *Writer, name: []const u8, value: Value) !void {
434fn renderValueNasm(w: *Writer, name: []const u8, value: Value) !void {
403435 switch (value) {
404 .undef => try bw.print("; %undef {s}\n", .{name}),
405 .defined => try bw.print("%define {s}\n", .{name}),
406 .boolean => |b| try bw.print("%define {s} {c}\n", .{ name, @as(u8, '0') + @intFromBool(b) }),
407 .int => |i| try bw.print("%define {s} {d}\n", .{ name, i }),
408 .ident => |ident| try bw.print("%define {s} {s}\n", .{ name, ident }),
436 .undef => try w.print("; %undef {s}\n", .{name}),
437 .defined => try w.print("%define {s}\n", .{name}),
438 .boolean => |b| try w.print("%define {s} {c}\n", .{ name, @as(u8, '0') + @intFromBool(b) }),
439 .int => |i| try w.print("%define {s} {d}\n", .{ name, i }),
440 .ident => |ident| try w.print("%define {s} {s}\n", .{ name, ident }),
409441 // TODO: use nasm-specific escaping instead of zig string literals
410 .string => |string| try bw.print("%define {s} \"{f}\"\n", .{ name, std.zig.fmtString(string) }),
442 .string => |string| try w.print("%define {s} \"{f}\"\n", .{ name, std.zig.fmtString(string) }),
411443 }
412444}
413445
414fn expand_variables_autoconf_at(
415 bw: *Writer,
446fn expandVariablesAutoconfAt(
447 w: *Writer,
416448 contents: []const u8,
417449 values: *const std.array_hash_map.String(Value),
418450 used: []bool,
......@@ -437,17 +469,17 @@ fn expand_variables_autoconf_at(
437469 const key = contents[curr + 1 .. close_pos];
438470 const index = values.getIndex(key) orelse {
439471 // Report the missing key to the caller.
440 try bw.writeAll(key);
472 try w.writeAll(key);
441473 return error.MissingValue;
442474 };
443475 const value = values.entries.slice().items(.value)[index];
444476 used[index] = true;
445 try bw.writeAll(contents[source_offset..curr]);
477 try w.writeAll(contents[source_offset..curr]);
446478 switch (value) {
447479 .undef, .defined => {},
448 .boolean => |b| try bw.writeByte(@as(u8, '0') + @intFromBool(b)),
449 .int => |i| try bw.print("{d}", .{i}),
450 .ident, .string => |s| try bw.writeAll(s),
480 .boolean => |b| try w.writeByte(@as(u8, '0') + @intFromBool(b)),
481 .int => |i| try w.print("{d}", .{i}),
482 .ident, .string => |s| try w.writeAll(s),
451483 }
452484
453485 curr = close_pos;
......@@ -455,10 +487,10 @@ fn expand_variables_autoconf_at(
455487 }
456488 }
457489
458 try bw.writeAll(contents[source_offset..]);
490 try w.writeAll(contents[source_offset..]);
459491}
460492
461fn expand_variables_cmake(
493fn expandVariablesCmake(
462494 allocator: Allocator,
463495 contents: []const u8,
464496 values: std.array_hash_map.String(Value),
......@@ -602,7 +634,7 @@ fn testReplaceVariablesAutoconfAt(
602634 for (used) |*u| u.* = false;
603635 defer allocator.free(used);
604636
605 try expand_variables_autoconf_at(&aw.writer, contents, values, used);
637 try expandVariablesAutoconfAt(&aw.writer, contents, values, used);
606638
607639 for (used) |u| if (!u) return error.UnusedValue;
608640 try std.testing.expectEqualStrings(expected, aw.written());
......@@ -614,13 +646,13 @@ fn testReplaceVariablesCMake(
614646 expected: []const u8,
615647 values: std.array_hash_map.String(Value),
616648) !void {
617 const actual = try expand_variables_cmake(allocator, contents, values);
649 const actual = try expandVariablesCmake(allocator, contents, values);
618650 defer allocator.free(actual);
619651
620652 try std.testing.expectEqualStrings(expected, actual);
621653}
622654
623test "expand_variables_autoconf_at simple cases" {
655test "expandVariablesAutoconfAt simple cases" {
624656 const allocator = std.testing.allocator;
625657 var values: std.array_hash_map.String(Value) = .init(allocator);
626658 defer values.deinit();
......@@ -716,7 +748,7 @@ test "expand_variables_autoconf_at simple cases" {
716748 values.clearRetainingCapacity();
717749}
718750
719test "expand_variables_autoconf_at edge cases" {
751test "expandVariablesAutoconfAt edge cases" {
720752 const allocator = std.testing.allocator;
721753 var values: std.array_hash_map.String(Value) = .init(allocator);
722754 defer values.deinit();
......@@ -732,7 +764,7 @@ test "expand_variables_autoconf_at edge cases" {
732764 values.clearRetainingCapacity();
733765}
734766
735test "expand_variables_cmake simple cases" {
767test "expandVariablesCmake simple cases" {
736768 const allocator = std.testing.allocator;
737769 var values: std.array_hash_map.String(Value) = .init(allocator);
738770 defer values.deinit();
......@@ -820,7 +852,7 @@ test "expand_variables_cmake simple cases" {
820852 try std.testing.expectError(error.MissingValue, testReplaceVariablesCMake(allocator, "${bad}", "", values));
821853}
822854
823test "expand_variables_cmake edge cases" {
855test "expandVariablesCmake edge cases" {
824856 const allocator = std.testing.allocator;
825857 var values: std.array_hash_map.String(Value) = .init(allocator);
826858 defer values.deinit();
......@@ -881,7 +913,7 @@ test "expand_variables_cmake edge cases" {
881913 try std.testing.expectError(error.InvalidCharacter, testReplaceVariablesCMake(allocator, "${str@ing}", "", values));
882914}
883915
884test "expand_variables_cmake escaped characters" {
916test "expandVariablesCmake escaped characters" {
885917 const allocator = std.testing.allocator;
886918 var values: std.array_hash_map.String(Value) = .init(allocator);
887919 defer values.deinit();
lib/compiler/Maker/Step/ObjCopy.zig+1-1
......@@ -166,7 +166,7 @@ pub fn make(
166166
167167 maker.generatedPath(conf_oc.output_file).* = dest_path;
168168
169 man.writeManifest() catch |err| switch (err) {
169 step.writeManifest(maker, &man) catch |err| switch (err) {
170170 error.Canceled => |e| return e,
171171 else => |e| try step.addError(maker, "failed writing cache manifest: {t}", .{e}),
172172 };