From c035b13e98764f412198bb37944239f7cef4cc92 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Sun, 18 Jun 2023 22:47:54 -0700 Subject: [PATCH] cmd/fetch: include the hash of build.zig in the root_files zig file name this solved a problem in a monorepo of mine where multiple apps were sourcing from the same .zigmod directory --- src/common.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common.zig b/src/common.zig index a54fe077ecd295fb3fa3b4d0b07664acd4840a3d..693c46228b4eefd6c354cfae2475c774bb46621a 100644 --- a/src/common.zig +++ b/src/common.zig @@ -31,7 +31,8 @@ pub fn collect_deps_deep(cachepath: string, mdir: std.fs.Dir, options: *CollectO var moduledeps = std.ArrayList(zigmod.Module).init(options.alloc); errdefer moduledeps.deinit(); if (m.root_files.len > 0) { - try moduledeps.append(try add_files_package(options.alloc, cachepath, "root", mdir, m.root_files)); + const builddotzig = try extras.hashFile(mdir, "build.zig", std.crypto.hash.Sha1); + try moduledeps.append(try add_files_package(options.alloc, cachepath, "root_" ++ &builddotzig, mdir, m.root_files)); } try moduledeps.append(try collect_deps(cachepath, mdir, .local, options)); for (m.rootdeps) |*d| { -- 2.54.0