From 35c2541cf9924cdcccf666afb173320fd610e9ef Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 14 Oct 2026 13:34:03 -0700 Subject: [PATCH] Maker: exempt forked packages from validateFingerprints because they intentionally override multiple packages hashes to have the forked contents. --- lib/compiler/Maker.zig | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/compiler/Maker.zig b/lib/compiler/Maker.zig index 325fa1ff1d5c4aa940c9e668a53615cf367e9ea0..253fd5df095883167e32cb5ebecc135c370732a8 100644 --- a/lib/compiler/Maker.zig +++ b/lib/compiler/Maker.zig @@ -1398,7 +1398,7 @@ fn configure(graph: *Graph, options: ConfigureOptions) !ScannedConfig { process.exit(0); } - try validateFingerprints(gpa, &job_queue); + try validateFingerprints(gpa, &job_queue, &fork_set); // Create the dependencies.zig file for configurer to // obtain via `@import("@dependencies")`. @@ -1749,7 +1749,11 @@ const ValidFingerprintTable = std.array_hash_map.Custom( /// Ensure that the dependency tree did not have any fingerprint matches with the same semantic version but /// differing package hashes. -fn validateFingerprints(gpa: Allocator, job_queue: *const Fetch.JobQueue) !void { +fn validateFingerprints( + gpa: Allocator, + job_queue: *const Fetch.JobQueue, + fork_set: *const Package.Fetch.JobQueue.ForkSet, +) !void { var any_errors = false; var table: ValidFingerprintTable = .empty; @@ -1757,8 +1761,13 @@ fn validateFingerprints(gpa: Allocator, job_queue: *const Fetch.JobQueue) !void for (job_queue.table.keys(), job_queue.table.values()) |pkg_hash, fetch| { if (!fetch.have_manifest) continue; + + // Forked packages are exempt since they overide multiple package hashes to have the forked contents. + const project_id: Package.ProjectId = .init(fetch.manifest.name, fetch.manifest.id); + if (fork_set.containsAdapted(project_id, @as(Fetch.JobQueue.Fork.Adapter, .{}))) continue; + const gop = try table.getOrPut(gpa, .{ - .project_id = .init(fetch.manifest.name, fetch.manifest.id), + .project_id = project_id, .version = fetch.manifest.version, }); if (gop.found_existing) { -- 2.54.0