authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-04-26 12:44:32 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-04-26 12:44:32 -07:00
loged5fdbd4cbbc77564e55865fdc54f84d21d9d465
tree916803c7ca26ff31cadc1effef5bcd099c1f74e8
parent046eb90846a97391398a469bad3e0bf37c96c700

fix cachepath to be right when Deps define their own Deps


2 files changed, 3 insertions(+), 3 deletions(-)

src/common.zig+1-1
......@@ -243,7 +243,7 @@ pub fn get_module_from_dep(d: *zigmod.Dep, cachepath: string, options: *CollectO
243243 var dd = collect_deps(cachepath, moddir, d.type, options) catch |e| switch (e) {
244244 error.ManifestNotFound => {
245245 if (d.main.len > 0 or d.c_include_dirs.len > 0 or d.c_source_files.len > 0 or d.keep) {
246 var mod_from = try zigmod.Module.from(options.alloc, d.*, modpath, options);
246 var mod_from = try zigmod.Module.from(options.alloc, d.*, cachepath, options);
247247 if (d.type != .local) mod_from.clean_path = extras.trimPrefix(modpath, cachepath)[1..];
248248 if (mod_from.is_for_this()) return mod_from;
249249 return null;
src/util/module.zig+2-2
......@@ -29,12 +29,12 @@ pub const Module = struct {
2929 min_zig_version: ?std.SemanticVersion,
3030 vcpkg: bool,
3131
32 pub fn from(alloc: std.mem.Allocator, dep: zigmod.Dep, modpath: string, options: *common.CollectOptions) !Module {
32 pub fn from(alloc: std.mem.Allocator, dep: zigmod.Dep, cachepath: string, options: *common.CollectOptions) !Module {
3333 var moddeps = std.ArrayList(Module).init(alloc);
3434 errdefer moddeps.deinit();
3535
3636 for (dep.deps) |*d| {
37 if (try common.get_module_from_dep(d, modpath, options)) |founddep| {
37 if (try common.get_module_from_dep(d, cachepath, options)) |founddep| {
3838 try moddeps.append(founddep);
3939 }
4040 }