| ... | ... | @@ -297,7 +297,7 @@ pub const Manifest = struct { |
| 297 | 297 | /// concatenated. Total byte size will be less than `max_input_content_len` |
| 298 | 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 | 301 | all_input_content: std.ArrayList(u8) = .empty, |
| 302 | 302 | max_input_content_len: usize = std.math.maxInt(u32), |
| 303 | 303 | |
| ... | ... | @@ -542,7 +542,7 @@ pub const Manifest = struct { |
| 542 | 542 | /// by the entry separator. |
| 543 | 543 | /// |
| 544 | 544 | /// See also: |
| 545 | | /// * `addPathPost` |
| 545 | /// * `addDiscoveredPath` |
| 546 | 546 | pub fn addInputPath(m: *Manifest, path: Path, options: AddInputPathOptions) Allocator.Error!InputPath.Index { |
| 547 | 547 | const cache = m.cache; |
| 548 | 548 | const gpa = cache.gpa; |
| ... | ... | @@ -732,16 +732,16 @@ pub const Manifest = struct { |
| 732 | 732 | |
| 733 | 733 | // We're going to construct a second hash. Its input will begin with the digest we've |
| 734 | 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 | 736 | // 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 |
| 738 | 738 | // depends on whether this is a hit or a miss. |
| 739 | 739 | // |
| 740 | 740 | // If we return `CacheStatus.hit`, then `man.hash.hasher` must already include |
| 741 | 741 | // the digests of the "post" files, so the caller can call `final`. Otherwise, on a cache |
| 742 | 742 | // miss, `man.hash.hasher` will include the digests of all non-"post" files -- that is, |
| 743 | 743 | // 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 |
| 745 | 745 | // use `final`, and will at some point `writeManifest` the file list to disk. |
| 746 | 746 | |
| 747 | 747 | man.hash.hasher = hasher_init; |
| ... | ... | @@ -1119,7 +1119,7 @@ pub const Manifest = struct { |
| 1119 | 1119 | /// |
| 1120 | 1120 | /// See also: |
| 1121 | 1121 | /// * `addInputPath` |
| 1122 | | pub fn addPathPost(m: *Manifest, options: AddPathPostOptions) !void { |
| 1122 | pub fn addDiscoveredPath(m: *Manifest, options: AddPathPostOptions) !void { |
| 1123 | 1123 | assert(m.manifest_file != null); |
| 1124 | 1124 | const cache = m.cache; |
| 1125 | 1125 | const gpa = cache.gpa; |
| ... | ... | @@ -1285,13 +1285,13 @@ pub const Manifest = struct { |
| 1285 | 1285 | .target, .target_must_resolve => {}, |
| 1286 | 1286 | .prereq => |file_path| if (self.manifest_file == null) { |
| 1287 | 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 | 1289 | .prereq_must_resolve => { |
| 1290 | 1290 | resolve_buf.clearRetainingCapacity(); |
| 1291 | 1291 | try token.resolve(gpa, &resolve_buf); |
| 1292 | 1292 | if (self.manifest_file == null) { |
| 1293 | 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 | 1296 | else => |err| { |
| 1297 | 1297 | try err.printError(gpa, &error_buf); |
| ... | ... | @@ -1846,7 +1846,7 @@ test "Manifest with files added after initial hash work" { |
| 1846 | 1846 | // There should be nothing in the cache |
| 1847 | 1847 | try testing.expectEqual(false, try ch.hit(.none)); |
| 1848 | 1848 | |
| 1849 | | _ = try ch.addPathPost(temp_file2); |
| 1849 | _ = try ch.addDiscoveredPath(temp_file2); |
| 1850 | 1850 | |
| 1851 | 1851 | digest1 = ch.final(); |
| 1852 | 1852 | try ch.writeManifest(); |
| ... | ... | @@ -1884,7 +1884,7 @@ test "Manifest with files added after initial hash work" { |
| 1884 | 1884 | // A file that we depend on has been updated, so the cache should not contain an entry for it |
| 1885 | 1885 | try testing.expectEqual(false, try ch.hit(.none)); |
| 1886 | 1886 | |
| 1887 | | _ = try ch.addPathPost(temp_file2); |
| 1887 | _ = try ch.addDiscoveredPath(temp_file2); |
| 1888 | 1888 | |
| 1889 | 1889 | digest3 = ch.final(); |
| 1890 | 1890 | |