From 71a068ac6342718a5abbd675e1adc84aeaf8f2c2 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Wed, 28 May 2025 02:17:20 -0700 Subject: [PATCH] generate: use same cache path everywhere, closes #112 --- deps.zig | 2 +- src/cmd/generate.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deps.zig b/deps.zig index 7dbd3623239860b6a85495b835b629c0f496afc7..b67c59ea9456e7776e5fa2b79bedbedc4175318e 100644 --- a/deps.zig +++ b/deps.zig @@ -26,7 +26,7 @@ pub const GitExactStep = struct { var urlpath = url; urlpath = trimPrefix(u8, urlpath, "https://"); urlpath = trimPrefix(u8, urlpath, "git://"); - const repopath = b.fmt("{s}/zigmod/deps/git/{s}/{s}", .{ b.graph.global_cache_root.path.?, urlpath, commit }); + const repopath = b.fmt("{s}/zigmod/deps/git/{s}/{s}", .{ b.cache_root.path.?, urlpath, commit }); flip(std.fs.cwd().access(repopath, .{})) catch return result; var clonestep = std.Build.Step.Run.create(b, "clone"); diff --git a/src/cmd/generate.zig b/src/cmd/generate.zig index 306b65255818528c207da9743fe675215cc815ca..6a1909dc08b51445ed52123af6b1043d5127a472 100644 --- a/src/cmd/generate.zig +++ b/src/cmd/generate.zig @@ -67,7 +67,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D \\ var urlpath = url; \\ urlpath = trimPrefix(u8, urlpath, "https://"); \\ urlpath = trimPrefix(u8, urlpath, "git://"); - \\ const repopath = b.fmt("{s}/zigmod/deps/git/{s}/{s}", .{ b.graph.global_cache_root.path.?, urlpath, commit }); + \\ const repopath = b.fmt("{s}/zigmod/deps/git/{s}/{s}", .{ b.cache_root.path.?, urlpath, commit }); \\ flip(std.fs.cwd().access(repopath, .{})) catch return result; \\ \\ var clonestep = std.Build.Step.Run.create(b, "clone"); -- 2.54.0