authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-09-13 19:46:08-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-09-16 13:12:47-07:00
log88f3896522fa5314fa4b19b06a2fd3675233ddc3
tree1b59841631c65e2bbe071400a8f2c6a7eeb93be7
parent92439e73d06dfda221043830c23cad836d8232a5

std: update to new Cache API


6 files changed, 13 insertions(+), 13 deletions(-)

lib/compiler/Maker.zig+2-2
......@@ -1400,7 +1400,7 @@ fn configure(graph: *Graph, options: ConfigureOptions) !ScannedConfig {
14001400
14011401 if (config_man) |man| {
14021402 if (.hit == try man.check(compile_prog_node)) {
1403 const digest = man.final();
1403 const digest = man.hitDigestHex();
14041404 const path: Path = .{
14051405 .root_dir = graph.local_cache_root,
14061406 .sub_path = try arena.print("c/{s}", .{&digest}),
......@@ -1512,7 +1512,7 @@ fn configure(graph: *Graph, options: ConfigureOptions) !ScannedConfig {
15121512 break :cp .{ config_tmp_path, null };
15131513 } else {
15141514 const man = config_man.?;
1515 const digest = man.final();
1515 const digest = man.missDigestHex();
15161516 const final_path: Path = .{
15171517 .root_dir = graph.local_cache_root,
15181518 .sub_path = try arena.print("c/{s}", .{&digest}),
lib/compiler/Maker/Step/ConfigHeader.zig+2-2
......@@ -137,7 +137,7 @@ pub fn make(
137137 man.hash.addBytes(output);
138138
139139 if (try step.cacheHit(maker, &man, progress_node)) {
140 const digest = man.final();
140 const digest = man.hitDigestHex();
141141 maker.generatedPath(conf_ch.generated_dir).* = .{
142142 .root_dir = cache_root,
143143 .sub_path = try Io.Dir.path.join(arena, &.{ "o", &digest }),
......@@ -145,7 +145,7 @@ pub fn make(
145145 return;
146146 }
147147
148 const digest = man.final();
148 const digest = man.missDigestHex();
149149
150150 // If output_path has directory parts, deal with them. Example:
151151 // output_dir is zig-cache/o/HASH
lib/compiler/Maker/Step/ObjCopy.zig+2-2
......@@ -48,7 +48,7 @@ pub fn make(
4848
4949 if (try step.cacheHit(maker, &man, progress_node)) {
5050 // Cache hit, skip subprocess execution.
51 const digest = man.final();
51 const digest = man.hitDigestHex();
5252 maker.generatedPath(conf_oc.output_file).* = .{
5353 .root_dir = cache_root,
5454 .sub_path = try Io.Dir.path.join(arena, &.{ "o", &digest, basename }),
......@@ -67,7 +67,7 @@ pub fn make(
6767
6868 // We don't find out more input files while executing objcopy so we can
6969 // already obtain the digest and use it directly as the output path.
70 const digest = man.final();
70 const digest = man.missDigestHex();
7171 const dest_path: Path = .{
7272 .root_dir = cache_root,
7373 .sub_path = try Io.Dir.path.join(arena, &.{ "o", &digest, basename }),
lib/compiler/Maker/Step/Options.zig+2-2
......@@ -54,7 +54,7 @@ pub fn make(
5454 const basename = "options.zig";
5555
5656 if (try step.cacheHitWatched(maker, &man, progress_node)) {
57 const digest = man.final();
57 const digest = man.hitDigestHex();
5858 maker.generatedPath(conf_options.generated_file).* = .{
5959 .root_dir = cache_root,
6060 .sub_path = try Io.Dir.path.join(arena, &.{ "o", &digest, basename }),
......@@ -63,7 +63,7 @@ pub fn make(
6363 return;
6464 }
6565
66 const digest = man.final();
66 const digest = man.missDigestHex();
6767 const out_path: Cache.Path = .{
6868 .root_dir = cache_root,
6969 .sub_path = try Io.Dir.path.join(arena, &.{ "o", &digest, basename }),
lib/compiler/Maker/Step/Run.zig+3-3
......@@ -261,7 +261,7 @@ pub fn make(
261261
262262 if (!has_side_effects and try step.cacheHitWatched(maker, &man, progress_node)) {
263263 // Cache hit; skip running command.
264 const digest = man.final();
264 const digest = man.hitDigestHex();
265265 try populateGeneratedStdIo(maker, &conf_run, cache_root, &digest);
266266 try populateGeneratedPaths(maker, output_placeholders.items, cache_root, &digest);
267267 step.result_cached = true;
......@@ -270,7 +270,7 @@ pub fn make(
270270
271271 if (!any_dep_files) {
272272 // We already know the final output paths; use them directly.
273 const digest = if (has_side_effects) man.hash.final() else man.final();
273 const digest = if (has_side_effects) man.hash.final() else man.missDigestHex();
274274 const output_dir_path = "o" ++ Dir.path.sep_str ++ &digest;
275275 try populateGeneratedStdIo(maker, &conf_run, cache_root, &digest);
276276 try populateGeneratedPathsCreateDirs(arena, run_index, maker, output_dir_path, output_placeholders.items, argv_list.items);
......@@ -308,7 +308,7 @@ pub fn make(
308308 }
309309 }
310310
311 const digest = if (has_side_effects) man.hash.final() else man.final();
311 const digest = if (has_side_effects) man.hash.final() else man.missDigestHex();
312312
313313 const any_output = output_placeholders.items.len > 0 or
314314 conf_run.captured_stdout.value != null or conf_run.captured_stderr.value != null;
lib/compiler/Maker/Step/WriteFile.zig+2-2
......@@ -105,7 +105,7 @@ pub fn make(
105105 }
106106
107107 if (try step.cacheHit(maker, &man, progress_node)) {
108 const digest = man.final();
108 const digest = man.hitDigestHex();
109109 maker.generatedPath(conf_wf.generated_directory).* = .{
110110 .root_dir = cache_root,
111111 .sub_path = try Io.Dir.path.join(arena, &.{ "o", &digest }),
......@@ -114,7 +114,7 @@ pub fn make(
114114 return;
115115 }
116116
117 const digest = man.final();
117 const digest = man.missDigestHex();
118118 const out_path: Path = .{
119119 .root_dir = cache_root,
120120 .sub_path = try Io.Dir.path.join(arena, &.{ "o", &digest }),