authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-09-17 13:14:54 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-09-17 13:14:54 -07:00
log16bef4f149538712b90ead827bce5e358ea7adf9
treef948d8ce726a8c640de9f20c1af524e1a52b101a
parentc19c852be7662588df137d5eace2ee2408f27863

ensure dep.type is propogated properly through to collect_deps


1 files changed, 4 insertions(+), 4 deletions(-)

src/common.zig+4-4
...@@ -36,7 +36,7 @@ pub fn collect_deps_deep(cachepath: string, mdir: std.fs.Dir, options: *CollectO...@@ -36,7 +36,7 @@ pub fn collect_deps_deep(cachepath: string, mdir: std.fs.Dir, options: *CollectO
36 if (m.root_files.len > 0) {36 if (m.root_files.len > 0) {
37 try moduledeps.append(try add_files_package(options.alloc, cachepath, "root", mdir, m.root_files));37 try moduledeps.append(try add_files_package(options.alloc, cachepath, "root", mdir, m.root_files));
38 }38 }
39 try moduledeps.append(try collect_deps(cachepath, mdir, options));39 try moduledeps.append(try collect_deps(cachepath, mdir, .local, options));
40 for (m.rootdeps) |*d| {40 for (m.rootdeps) |*d| {
41 if (try get_module_from_dep(d, cachepath, options)) |founddep| {41 if (try get_module_from_dep(d, cachepath, options)) |founddep| {
42 try moduledeps.append(founddep);42 try moduledeps.append(founddep);
...@@ -61,7 +61,7 @@ pub fn collect_deps_deep(cachepath: string, mdir: std.fs.Dir, options: *CollectO...@@ -61,7 +61,7 @@ pub fn collect_deps_deep(cachepath: string, mdir: std.fs.Dir, options: *CollectO
61 };61 };
62}62}
6363
64pub fn collect_deps(cachepath: string, mdir: std.fs.Dir, options: *CollectOptions) anyerror!zigmod.Module {64pub fn collect_deps(cachepath: string, mdir: std.fs.Dir, dtype: zigmod.Dep.Type, options: *CollectOptions) anyerror!zigmod.Module {
65 try std.fs.cwd().makePath(cachepath);65 try std.fs.cwd().makePath(cachepath);
6666
67 const m = try zigmod.ModFile.from_dir(options.alloc, mdir);67 const m = try zigmod.ModFile.from_dir(options.alloc, mdir);
...@@ -76,7 +76,7 @@ pub fn collect_deps(cachepath: string, mdir: std.fs.Dir, options: *CollectOption...@@ -76,7 +76,7 @@ pub fn collect_deps(cachepath: string, mdir: std.fs.Dir, options: *CollectOption
76 }76 }
77 }77 }
78 return zigmod.Module{78 return zigmod.Module{
79 .type = .local,79 .type = dtype,
80 .id = m.id,80 .id = m.id,
81 .name = m.name,81 .name = m.name,
82 .main = m.main,82 .main = m.main,
...@@ -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 };243 };
244 },244 },
245 else => {245 else => {
246 var dd = try collect_deps(cachepath, moddir, options) catch |e| switch (e) {246 var dd = try collect_deps(cachepath, moddir, d.type, options) catch |e| switch (e) {
247 error.ManifestNotFound => {247 error.ManifestNotFound => {
248 if (d.main.len > 0 or d.c_include_dirs.len > 0 or d.c_source_files.len > 0 or d.keep) {248 if (d.main.len > 0 or d.c_include_dirs.len > 0 or d.c_source_files.len > 0 or d.keep) {
249 var mod_from = try zigmod.Module.from(options.alloc, d.*, modpath, options);249 var mod_from = try zigmod.Module.from(options.alloc, d.*, modpath, options);