From b9f95fc512b7638408c854936edcb4288f363f38 Mon Sep 17 00:00:00 2001 From: Ryan Liptak Date: Fri, 23 Oct 2026 16:31:25 -0700 Subject: [PATCH 1/2] Maker: Add generated dependencies.zig as an input to the config cache manifest Without this, Maker could enter an infinite loop when a step required some lazy dependencies that were unavailable, and then after the fetch that made them available, the config would get a cache hit so the step would still be configured as needing lazy dependencies, and so on. Now, any change to the generated dependencies.zig file will cause the configuration phase to be re-run. --- lib/compiler/Maker.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/compiler/Maker.zig b/lib/compiler/Maker.zig index e0ce8142628ad4aac0466293869eaa9f7bab225d..04448eb5ac31e519270f0cbb749c418c8458e19b 100644 --- a/lib/compiler/Maker.zig +++ b/lib/compiler/Maker.zig @@ -1485,6 +1485,10 @@ fn configure(graph: *Graph, options: ConfigureOptions) ConfigureError!ScannedCon fatal("replacing {f}: {t}", .{ dependencies_zig_path, err }); deps_mod.root_path = try dependencies_zig_path.toString(arena); + + if (config_man) |man| { + man.hash.addBytes(&hex_digest); + } } { -- 2.54.0 From be69013825f95293e0916a8a89a1fdcdba65b5d7 Mon Sep 17 00:00:00 2001 From: Ryan Liptak Date: Fri, 23 Oct 2026 16:33:55 -0700 Subject: [PATCH 2/2] Build.declareDependency{Step}: only populate unlazy_deps when the package is not available The logic in Maker expects unlazy_deps to only be populated for deps that need to be fetched. Without this check, declareDependency/declareDependencyStep could lead to an infinite fetch-and-retry loop. --- lib/std/Build.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/std/Build.zig b/lib/std/Build.zig index a3c38262f3ea0da7317776fa73bb45d548c06eed..172b39bfe5302585151c39427f6c45a31e4cf822 100644 --- a/lib/std/Build.zig +++ b/lib/std/Build.zig @@ -1959,6 +1959,8 @@ pub fn lazyDependency(b: *Build, name: []const u8, args: anytype) ?*Dependency { /// * `dependencyStep` pub fn declareDependency(b: *Build, name: []const u8) void { const pkg_hash = findPkgHashOrFatal(b, name); + const entry = package_map.get(pkg_hash).?; + if (entry.available) return; markNeededLazyDep(b, pkg_hash); } @@ -1972,6 +1974,8 @@ pub fn declareDependency(b: *Build, name: []const u8) void { pub fn declareDependencyStep(b: *Build, s: *Step, name: []const u8) void { const graph = b.graph; const pkg_hash = findPkgHashOrFatal(b, name); + const entry = package_map.get(pkg_hash).?; + if (entry.available) return; const interned_hash = graph.wip_configuration.addString(pkg_hash) catch @panic("OOM"); s.unlazy_deps.put(graph.arena, interned_hash, {}) catch @panic("OOM"); } -- 2.54.0