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 {...@@ -1498,7 +1498,7 @@ fn configure(graph: *Graph, options: ConfigureOptions) !ScannedConfig {
14981498
1499 if (config_man) |man| for (configuration.path_deps) |path_dep| {1499 if (config_man) |man| for (configuration.path_deps) |path_dep| {
1500 const path = try confPathDepToCachePath(arena, graph, &configuration, path_dep);1500 const path = try confPathDepToCachePath(arena, graph, &configuration, path_dep);
1501 try man.addPathPost(.{1501 try man.addDiscoveredPath(.{
1502 .path = .{ .unresolved = path },1502 .path = .{ .unresolved = path },
1503 .handle = if (path_dep.flags.is_directory) .{ .dir = null } else .{ .file = null },1503 .handle = if (path_dep.flags.is_directory) .{ .dir = null } else .{ .file = null },
1504 .metadata_only = path_dep.flags.metadata_only,1504 .metadata_only = path_dep.flags.metadata_only,
lib/std/Build/Cache.zig+10-10
...@@ -297,7 +297,7 @@ pub const Manifest = struct {...@@ -297,7 +297,7 @@ pub const Manifest = struct {
297 /// concatenated. Total byte size will be less than `max_input_content_len`297 /// concatenated. Total byte size will be less than `max_input_content_len`
298 /// otherwise an error is returned.298 /// otherwise an error is returned.
299 ///299 ///
300 /// Data is invalidated when `addPathPost` is called.300 /// Data is invalidated when `addDiscoveredPath` is called.
301 all_input_content: std.ArrayList(u8) = .empty,301 all_input_content: std.ArrayList(u8) = .empty,
302 max_input_content_len: usize = std.math.maxInt(u32),302 max_input_content_len: usize = std.math.maxInt(u32),
303303
...@@ -542,7 +542,7 @@ pub const Manifest = struct {...@@ -542,7 +542,7 @@ pub const Manifest = struct {
542 /// by the entry separator.542 /// by the entry separator.
543 ///543 ///
544 /// See also:544 /// See also:
545 /// * `addPathPost`545 /// * `addDiscoveredPath`
546 pub fn addInputPath(m: *Manifest, path: Path, options: AddInputPathOptions) Allocator.Error!InputPath.Index {546 pub fn addInputPath(m: *Manifest, path: Path, options: AddInputPathOptions) Allocator.Error!InputPath.Index {
547 const cache = m.cache;547 const cache = m.cache;
548 const gpa = cache.gpa;548 const gpa = cache.gpa;
...@@ -732,16 +732,16 @@ pub const Manifest = struct {...@@ -732,16 +732,16 @@ pub const Manifest = struct {
732732
733 // We're going to construct a second hash. Its input will begin with the digest we've733 // We're going to construct a second hash. Its input will begin with the digest we've
734 // already computed (`bin_digest`), and then it'll have the digests of each input file,734 // 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"
736 // files from the manifest on disk. If this is a miss, we'll learn those from future calls736 // 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 function737 // to `addDiscoveredPath` etc. As such, the state of `man.hash.hasher` after this function
738 // depends on whether this is a hit or a miss.738 // depends on whether this is a hit or a miss.
739 //739 //
740 // If we return `CacheStatus.hit`, then `man.hash.hasher` must already include740 // If we return `CacheStatus.hit`, then `man.hash.hasher` must already include
741 // the digests of the "post" files, so the caller can call `final`. Otherwise, on a cache741 // the digests of the "post" files, so the caller can call `final`. Otherwise, on a cache
742 // miss, `man.hash.hasher` will include the digests of all non-"post" files -- that is,742 // miss, `man.hash.hasher` will include the digests of all non-"post" files -- that is,
743 // the ones we've already been told about. The rest will be discovered through calls to743 // 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 can744 // `addDiscoveredPath` etc, which will update the hasher. After all files are added, the user can
745 // use `final`, and will at some point `writeManifest` the file list to disk.745 // use `final`, and will at some point `writeManifest` the file list to disk.
746746
747 man.hash.hasher = hasher_init;747 man.hash.hasher = hasher_init;
...@@ -1119,7 +1119,7 @@ pub const Manifest = struct {...@@ -1119,7 +1119,7 @@ pub const Manifest = struct {
1119 ///1119 ///
1120 /// See also:1120 /// See also:
1121 /// * `addInputPath`1121 /// * `addInputPath`
1122 pub fn addPathPost(m: *Manifest, options: AddPathPostOptions) !void {1122 pub fn addDiscoveredPath(m: *Manifest, options: AddPathPostOptions) !void {
1123 assert(m.manifest_file != null);1123 assert(m.manifest_file != null);
1124 const cache = m.cache;1124 const cache = m.cache;
1125 const gpa = cache.gpa;1125 const gpa = cache.gpa;
...@@ -1285,13 +1285,13 @@ pub const Manifest = struct {...@@ -1285,13 +1285,13 @@ pub const Manifest = struct {
1285 .target, .target_must_resolve => {},1285 .target, .target_must_resolve => {},
1286 .prereq => |file_path| if (self.manifest_file == null) {1286 .prereq => |file_path| if (self.manifest_file == null) {
1287 _ = try self.addInputPath(.initCwd(file_path), .{});1287 _ = 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) } }),
1289 .prereq_must_resolve => {1289 .prereq_must_resolve => {
1290 resolve_buf.clearRetainingCapacity();1290 resolve_buf.clearRetainingCapacity();
1291 try token.resolve(gpa, &resolve_buf);1291 try token.resolve(gpa, &resolve_buf);
1292 if (self.manifest_file == null) {1292 if (self.manifest_file == null) {
1293 _ = try self.addInputPath(.initCwd(resolve_buf.items), .{});1293 _ = 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) } });
1295 },1295 },
1296 else => |err| {1296 else => |err| {
1297 try err.printError(gpa, &error_buf);1297 try err.printError(gpa, &error_buf);
...@@ -1846,7 +1846,7 @@ test "Manifest with files added after initial hash work" {...@@ -1846,7 +1846,7 @@ test "Manifest with files added after initial hash work" {
1846 // There should be nothing in the cache1846 // There should be nothing in the cache
1847 try testing.expectEqual(false, try ch.hit(.none));1847 try testing.expectEqual(false, try ch.hit(.none));
18481848
1849 _ = try ch.addPathPost(temp_file2);1849 _ = try ch.addDiscoveredPath(temp_file2);
18501850
1851 digest1 = ch.final();1851 digest1 = ch.final();
1852 try ch.writeManifest();1852 try ch.writeManifest();
...@@ -1884,7 +1884,7 @@ test "Manifest with files added after initial hash work" {...@@ -1884,7 +1884,7 @@ test "Manifest with files added after initial hash work" {
1884 // A file that we depend on has been updated, so the cache should not contain an entry for it1884 // A file that we depend on has been updated, so the cache should not contain an entry for it
1885 try testing.expectEqual(false, try ch.hit(.none));1885 try testing.expectEqual(false, try ch.hit(.none));
18861886
1887 _ = try ch.addPathPost(temp_file2);1887 _ = try ch.addDiscoveredPath(temp_file2);
18881888
1889 digest3 = ch.final();1889 digest3 = ch.final();
18901890
lib/std/zig.zig+1-1
...@@ -1838,7 +1838,7 @@ pub fn buildExeSubprocess(...@@ -1838,7 +1838,7 @@ pub fn buildExeSubprocess(
1838 while (it.next()) |prefixed_path| {1838 while (it.next()) |prefixed_path| {
1839 const prefix: Server.Message.PathPrefix = @fromBackingInt(@intCast(prefixed_path[0] - 1));1839 const prefix: Server.Message.PathPrefix = @fromBackingInt(@intCast(prefixed_path[0] - 1));
1840 const sub_path = prefixed_path[1..];1840 const sub_path = prefixed_path[1..];
1841 man.addPathPost(.{1841 man.addDiscoveredPath(.{
1842 .path = .{ .prefixed = .{1842 .path = .{ .prefixed = .{
1843 .prefix = @intCast(@backingInt(prefix)),1843 .prefix = @intCast(@backingInt(prefix)),
1844 .sub_path = sub_path,1844 .sub_path = sub_path,