authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-09-03 19:21:06-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-09-04 17:42:22-07:00
log9152a4e63a36dfb40ab88e01b5098c8fbf960f48
treed5ad465fd90bb5c91b7ce26a6db5aebd24cbe668
parent1c31826ef78783918c9af9a2608895b786d004a4

std.Build.Cache: rename addPathPost to addDiscoveredPath


3 files changed, 12 insertions(+), 12 deletions(-)

lib/compiler/Maker.zig+1-1
......@@ -1498,7 +1498,7 @@ fn configure(graph: *Graph, options: ConfigureOptions) !ScannedConfig {
14981498
14991499 if (config_man) |man| for (configuration.path_deps) |path_dep| {
15001500 const path = try confPathDepToCachePath(arena, graph, &configuration, path_dep);
1501 try man.addPathPost(.{
1501 try man.addDiscoveredPath(.{
15021502 .path = .{ .unresolved = path },
15031503 .handle = if (path_dep.flags.is_directory) .{ .dir = null } else .{ .file = null },
15041504 .metadata_only = path_dep.flags.metadata_only,
lib/std/Build/Cache.zig+10-10
......@@ -297,7 +297,7 @@ pub const Manifest = struct {
297297 /// concatenated. Total byte size will be less than `max_input_content_len`
298298 /// otherwise an error is returned.
299299 ///
300 /// Data is invalidated when `addPathPost` is called.
300 /// Data is invalidated when `addDiscoveredPath` is called.
301301 all_input_content: std.ArrayList(u8) = .empty,
302302 max_input_content_len: usize = std.math.maxInt(u32),
303303
......@@ -542,7 +542,7 @@ pub const Manifest = struct {
542542 /// by the entry separator.
543543 ///
544544 /// See also:
545 /// * `addPathPost`
545 /// * `addDiscoveredPath`
546546 pub fn addInputPath(m: *Manifest, path: Path, options: AddInputPathOptions) Allocator.Error!InputPath.Index {
547547 const cache = m.cache;
548548 const gpa = cache.gpa;
......@@ -732,16 +732,16 @@ pub const Manifest = struct {
732732
733733 // We're going to construct a second hash. Its input will begin with the digest we've
734734 // already computed (`bin_digest`), and then it'll have the digests of each input file,
735 // including "post" files (see `addPathPost`). If this is a hit, we learn the set of "post"
735 // including "post" files (see `addDiscoveredPath`). If this is a hit, we learn the set of "post"
736736 // files from the manifest on disk. If this is a miss, we'll learn those from future calls
737 // to `addPathPost` etc. As such, the state of `man.hash.hasher` after this function
737 // to `addDiscoveredPath` etc. As such, the state of `man.hash.hasher` after this function
738738 // depends on whether this is a hit or a miss.
739739 //
740740 // If we return `CacheStatus.hit`, then `man.hash.hasher` must already include
741741 // the digests of the "post" files, so the caller can call `final`. Otherwise, on a cache
742742 // miss, `man.hash.hasher` will include the digests of all non-"post" files -- that is,
743743 // the ones we've already been told about. The rest will be discovered through calls to
744 // `addPathPost` etc, which will update the hasher. After all files are added, the user can
744 // `addDiscoveredPath` etc, which will update the hasher. After all files are added, the user can
745745 // use `final`, and will at some point `writeManifest` the file list to disk.
746746
747747 man.hash.hasher = hasher_init;
......@@ -1119,7 +1119,7 @@ pub const Manifest = struct {
11191119 ///
11201120 /// See also:
11211121 /// * `addInputPath`
1122 pub fn addPathPost(m: *Manifest, options: AddPathPostOptions) !void {
1122 pub fn addDiscoveredPath(m: *Manifest, options: AddPathPostOptions) !void {
11231123 assert(m.manifest_file != null);
11241124 const cache = m.cache;
11251125 const gpa = cache.gpa;
......@@ -1285,13 +1285,13 @@ pub const Manifest = struct {
12851285 .target, .target_must_resolve => {},
12861286 .prereq => |file_path| if (self.manifest_file == null) {
12871287 _ = try self.addInputPath(.initCwd(file_path), .{});
1288 } else try self.addPathPost(.{ .path = .{ .unresolved = .initCwd(file_path) } }),
1288 } else try self.addDiscoveredPath(.{ .path = .{ .unresolved = .initCwd(file_path) } }),
12891289 .prereq_must_resolve => {
12901290 resolve_buf.clearRetainingCapacity();
12911291 try token.resolve(gpa, &resolve_buf);
12921292 if (self.manifest_file == null) {
12931293 _ = try self.addInputPath(.initCwd(resolve_buf.items), .{});
1294 } else try self.addPathPost(.{ .path = .{ .unresolved = .initCwd(resolve_buf.items) } });
1294 } else try self.addDiscoveredPath(.{ .path = .{ .unresolved = .initCwd(resolve_buf.items) } });
12951295 },
12961296 else => |err| {
12971297 try err.printError(gpa, &error_buf);
......@@ -1846,7 +1846,7 @@ test "Manifest with files added after initial hash work" {
18461846 // There should be nothing in the cache
18471847 try testing.expectEqual(false, try ch.hit(.none));
18481848
1849 _ = try ch.addPathPost(temp_file2);
1849 _ = try ch.addDiscoveredPath(temp_file2);
18501850
18511851 digest1 = ch.final();
18521852 try ch.writeManifest();
......@@ -1884,7 +1884,7 @@ test "Manifest with files added after initial hash work" {
18841884 // A file that we depend on has been updated, so the cache should not contain an entry for it
18851885 try testing.expectEqual(false, try ch.hit(.none));
18861886
1887 _ = try ch.addPathPost(temp_file2);
1887 _ = try ch.addDiscoveredPath(temp_file2);
18881888
18891889 digest3 = ch.final();
18901890
lib/std/zig.zig+1-1
......@@ -1838,7 +1838,7 @@ pub fn buildExeSubprocess(
18381838 while (it.next()) |prefixed_path| {
18391839 const prefix: Server.Message.PathPrefix = @fromBackingInt(@intCast(prefixed_path[0] - 1));
18401840 const sub_path = prefixed_path[1..];
1841 man.addPathPost(.{
1841 man.addDiscoveredPath(.{
18421842 .path = .{ .prefixed = .{
18431843 .prefix = @intCast(@backingInt(prefix)),
18441844 .sub_path = sub_path,