authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-10-14 13:34:03-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-10-14 17:42:15-07:00
log35c2541cf9924cdcccf666afb173320fd610e9ef
tree143a8b191abc2b8bb321f58bb8e69ba43ec38a36
parent4a0cadf85b3dd751908158bd3703ea50456d7d8a

Maker: exempt forked packages from validateFingerprints

because they intentionally override multiple packages hashes to have the forked contents.

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

lib/compiler/Maker.zig+12-3
...@@ -1398,7 +1398,7 @@ fn configure(graph: *Graph, options: ConfigureOptions) !ScannedConfig {...@@ -1398,7 +1398,7 @@ fn configure(graph: *Graph, options: ConfigureOptions) !ScannedConfig {
1398 process.exit(0);1398 process.exit(0);
1399 }1399 }
14001400
1401 try validateFingerprints(gpa, &job_queue);1401 try validateFingerprints(gpa, &job_queue, &fork_set);
14021402
1403 // Create the dependencies.zig file for configurer to1403 // Create the dependencies.zig file for configurer to
1404 // obtain via `@import("@dependencies")`.1404 // obtain via `@import("@dependencies")`.
...@@ -1749,7 +1749,11 @@ const ValidFingerprintTable = std.array_hash_map.Custom(...@@ -1749,7 +1749,11 @@ const ValidFingerprintTable = std.array_hash_map.Custom(
17491749
1750/// Ensure that the dependency tree did not have any fingerprint matches with the same semantic version but1750/// Ensure that the dependency tree did not have any fingerprint matches with the same semantic version but
1751/// differing package hashes.1751/// differing package hashes.
1752fn validateFingerprints(gpa: Allocator, job_queue: *const Fetch.JobQueue) !void {1752fn validateFingerprints(
1753 gpa: Allocator,
1754 job_queue: *const Fetch.JobQueue,
1755 fork_set: *const Package.Fetch.JobQueue.ForkSet,
1756) !void {
1753 var any_errors = false;1757 var any_errors = false;
17541758
1755 var table: ValidFingerprintTable = .empty;1759 var table: ValidFingerprintTable = .empty;
...@@ -1757,8 +1761,13 @@ fn validateFingerprints(gpa: Allocator, job_queue: *const Fetch.JobQueue) !void...@@ -1757,8 +1761,13 @@ fn validateFingerprints(gpa: Allocator, job_queue: *const Fetch.JobQueue) !void
17571761
1758 for (job_queue.table.keys(), job_queue.table.values()) |pkg_hash, fetch| {1762 for (job_queue.table.keys(), job_queue.table.values()) |pkg_hash, fetch| {
1759 if (!fetch.have_manifest) continue;1763 if (!fetch.have_manifest) continue;
1764
1765 // Forked packages are exempt since they overide multiple package hashes to have the forked contents.
1766 const project_id: Package.ProjectId = .init(fetch.manifest.name, fetch.manifest.id);
1767 if (fork_set.containsAdapted(project_id, @as(Fetch.JobQueue.Fork.Adapter, .{}))) continue;
1768
1760 const gop = try table.getOrPut(gpa, .{1769 const gop = try table.getOrPut(gpa, .{
1761 .project_id = .init(fetch.manifest.name, fetch.manifest.id),1770 .project_id = project_id,
1762 .version = fetch.manifest.version,1771 .version = fetch.manifest.version,
1763 });1772 });
1764 if (gop.found_existing) {1773 if (gop.found_existing) {