From 9152a4e63a36dfb40ab88e01b5098c8fbf960f48 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 3 Sep 2026 19:21:06 -0700 Subject: [PATCH] std.Build.Cache: rename addPathPost to addDiscoveredPath --- lib/compiler/Maker.zig | 2 +- lib/std/Build/Cache.zig | 20 ++++++++++---------- lib/std/zig.zig | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/compiler/Maker.zig b/lib/compiler/Maker.zig index 97760f7d15cd2f4e58858ba2a4494b6f0cd53740..76fb47ac7546d620a2c9c7ba5253ee5c0aa84ff1 100644 --- a/lib/compiler/Maker.zig +++ b/lib/compiler/Maker.zig @@ -1498,7 +1498,7 @@ fn configure(graph: *Graph, options: ConfigureOptions) !ScannedConfig { if (config_man) |man| for (configuration.path_deps) |path_dep| { const path = try confPathDepToCachePath(arena, graph, &configuration, path_dep); - try man.addPathPost(.{ + try man.addDiscoveredPath(.{ .path = .{ .unresolved = path }, .handle = if (path_dep.flags.is_directory) .{ .dir = null } else .{ .file = null }, .metadata_only = path_dep.flags.metadata_only, diff --git a/lib/std/Build/Cache.zig b/lib/std/Build/Cache.zig index 46cb67f21e4c38dbf8bc877b2b9e3ff5ef6f42b7..4930da00e23e6b146b3f2d74ec717a6607eaeebe 100644 --- a/lib/std/Build/Cache.zig +++ b/lib/std/Build/Cache.zig @@ -297,7 +297,7 @@ pub const Manifest = struct { /// concatenated. Total byte size will be less than `max_input_content_len` /// otherwise an error is returned. /// - /// Data is invalidated when `addPathPost` is called. + /// Data is invalidated when `addDiscoveredPath` is called. all_input_content: std.ArrayList(u8) = .empty, max_input_content_len: usize = std.math.maxInt(u32), @@ -542,7 +542,7 @@ pub const Manifest = struct { /// by the entry separator. /// /// See also: - /// * `addPathPost` + /// * `addDiscoveredPath` pub fn addInputPath(m: *Manifest, path: Path, options: AddInputPathOptions) Allocator.Error!InputPath.Index { const cache = m.cache; const gpa = cache.gpa; @@ -732,16 +732,16 @@ pub const Manifest = struct { // We're going to construct a second hash. Its input will begin with the digest we've // already computed (`bin_digest`), and then it'll have the digests of each input file, - // including "post" files (see `addPathPost`). If this is a hit, we learn the set of "post" + // including "post" files (see `addDiscoveredPath`). If this is a hit, we learn the set of "post" // files from the manifest on disk. If this is a miss, we'll learn those from future calls - // to `addPathPost` etc. As such, the state of `man.hash.hasher` after this function + // to `addDiscoveredPath` etc. As such, the state of `man.hash.hasher` after this function // depends on whether this is a hit or a miss. // // If we return `CacheStatus.hit`, then `man.hash.hasher` must already include // the digests of the "post" files, so the caller can call `final`. Otherwise, on a cache // miss, `man.hash.hasher` will include the digests of all non-"post" files -- that is, // the ones we've already been told about. The rest will be discovered through calls to - // `addPathPost` etc, which will update the hasher. After all files are added, the user can + // `addDiscoveredPath` etc, which will update the hasher. After all files are added, the user can // use `final`, and will at some point `writeManifest` the file list to disk. man.hash.hasher = hasher_init; @@ -1119,7 +1119,7 @@ pub const Manifest = struct { /// /// See also: /// * `addInputPath` - pub fn addPathPost(m: *Manifest, options: AddPathPostOptions) !void { + pub fn addDiscoveredPath(m: *Manifest, options: AddPathPostOptions) !void { assert(m.manifest_file != null); const cache = m.cache; const gpa = cache.gpa; @@ -1285,13 +1285,13 @@ pub const Manifest = struct { .target, .target_must_resolve => {}, .prereq => |file_path| if (self.manifest_file == null) { _ = try self.addInputPath(.initCwd(file_path), .{}); - } else try self.addPathPost(.{ .path = .{ .unresolved = .initCwd(file_path) } }), + } else try self.addDiscoveredPath(.{ .path = .{ .unresolved = .initCwd(file_path) } }), .prereq_must_resolve => { resolve_buf.clearRetainingCapacity(); try token.resolve(gpa, &resolve_buf); if (self.manifest_file == null) { _ = try self.addInputPath(.initCwd(resolve_buf.items), .{}); - } else try self.addPathPost(.{ .path = .{ .unresolved = .initCwd(resolve_buf.items) } }); + } else try self.addDiscoveredPath(.{ .path = .{ .unresolved = .initCwd(resolve_buf.items) } }); }, else => |err| { try err.printError(gpa, &error_buf); @@ -1846,7 +1846,7 @@ test "Manifest with files added after initial hash work" { // There should be nothing in the cache try testing.expectEqual(false, try ch.hit(.none)); - _ = try ch.addPathPost(temp_file2); + _ = try ch.addDiscoveredPath(temp_file2); digest1 = ch.final(); try ch.writeManifest(); @@ -1884,7 +1884,7 @@ test "Manifest with files added after initial hash work" { // A file that we depend on has been updated, so the cache should not contain an entry for it try testing.expectEqual(false, try ch.hit(.none)); - _ = try ch.addPathPost(temp_file2); + _ = try ch.addDiscoveredPath(temp_file2); digest3 = ch.final(); diff --git a/lib/std/zig.zig b/lib/std/zig.zig index 8b9cfd7871a55cefb907877ab3d8d8ea5c4c1cc0..b506b458bbd22c34355ac30cdd41178038cf6ab6 100644 --- a/lib/std/zig.zig +++ b/lib/std/zig.zig @@ -1838,7 +1838,7 @@ pub fn buildExeSubprocess( while (it.next()) |prefixed_path| { const prefix: Server.Message.PathPrefix = @fromBackingInt(@intCast(prefixed_path[0] - 1)); const sub_path = prefixed_path[1..]; - man.addPathPost(.{ + man.addDiscoveredPath(.{ .path = .{ .prefixed = .{ .prefix = @intCast(@backingInt(prefix)), .sub_path = sub_path, -- 2.54.0