authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-09-20 14:48:16-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-09-21 07:50:11+02:00
log6f2109384d277ad8dff50cf7a8df1a87f45a6695
tree4ab19cbb3e9bde11e70d3db88f841c0605a9a9fc
parente519494530089fd932a9819f6136d42cfef891d5

Maker: add build.zig.zon files to configuration cache manifest

closes #36255 follow-up enhancement: only add the root build.zig.zon file as an input to the cache manifest. Do a cache check *before* fetching, that has the ability to skip fetching. If fetching needs to be run, then add the build.zig.zon files as discovered files, keeping the stat and contents around from the fetch process rather than redundantly doing the file system operations.

1 files changed, 7 insertions(+), 3 deletions(-)

lib/compiler/Maker.zig+7-3
......@@ -1354,11 +1354,15 @@ fn configure(graph: *Graph, options: ConfigureOptions) !ScannedConfig {
13541354 f.cli_module = m;
13551355 }
13561356
1357 // Each build.zig module needs access to each of its
1358 // dependencies' build.zig modules by name.
1357 // Each build.zig module needs access to each of its dependencies' build.zig modules by
1358 // name. Also, ensure build.zig.zon files are added to the configuration cache manifest.
13591359 for (fetches) |f| {
1360 const mod = f.cli_module orelse continue;
13611360 if (!f.have_manifest) continue;
1361 if (config_man) |man| {
1362 const manifest_path = try f.package_root.join(arena, Package.Manifest.basename);
1363 _ = try man.addInputPath(manifest_path, .{});
1364 }
1365 const mod = f.cli_module orelse continue;
13621366 const man = &f.manifest;
13631367 const dep_names = man.dependencies.keys();
13641368 try mod.deps.ensureUnusedCapacity(arena, @intCast(dep_names.len));