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...@@ -243,7 +243,7 @@ pub fn get_module_from_dep(d: *zigmod.Dep, cachepath: string, options: *CollectO
243 var dd = collect_deps(cachepath, moddir, d.type, options) catch |e| switch (e) {243 var dd = collect_deps(cachepath, moddir, d.type, options) catch |e| switch (e) {
244 error.ManifestNotFound => {244 error.ManifestNotFound => {
245 if (d.main.len > 0 or d.c_include_dirs.len > 0 or d.c_source_files.len > 0 or d.keep) {245 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);
247 if (d.type != .local) mod_from.clean_path = extras.trimPrefix(modpath, cachepath)[1..];247 if (d.type != .local) mod_from.clean_path = extras.trimPrefix(modpath, cachepath)[1..];
248 if (mod_from.is_for_this()) return mod_from;248 if (mod_from.is_for_this()) return mod_from;
249 return null;249 return null;
src/util/module.zig+2-2
...@@ -29,12 +29,12 @@ pub const Module = struct {...@@ -29,12 +29,12 @@ pub const Module = struct {
29 min_zig_version: ?std.SemanticVersion,29 min_zig_version: ?std.SemanticVersion,
30 vcpkg: bool,30 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 {
33 var moddeps = std.ArrayList(Module).init(alloc);33 var moddeps = std.ArrayList(Module).init(alloc);
34 errdefer moddeps.deinit();34 errdefer moddeps.deinit();
3535
36 for (dep.deps) |*d| {36 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| {
38 try moddeps.append(founddep);38 try moddeps.append(founddep);
39 }39 }
40 }40 }