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
3636 if (m.root_files.len > 0) {
3737 try moduledeps.append(try add_files_package(options.alloc, cachepath, "root", mdir, m.root_files));
3838 }
39 try moduledeps.append(try collect_deps(cachepath, mdir, options));
39 try moduledeps.append(try collect_deps(cachepath, mdir, .local, options));
4040 for (m.rootdeps) |*d| {
4141 if (try get_module_from_dep(d, cachepath, options)) |founddep| {
4242 try moduledeps.append(founddep);
......@@ -61,7 +61,7 @@ pub fn collect_deps_deep(cachepath: string, mdir: std.fs.Dir, options: *CollectO
6161 };
6262}
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 {
6565 try std.fs.cwd().makePath(cachepath);
6666
6767 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
7676 }
7777 }
7878 return zigmod.Module{
79 .type = .local,
79 .type = dtype,
8080 .id = m.id,
8181 .name = m.name,
8282 .main = m.main,
......@@ -243,7 +243,7 @@ pub fn get_module_from_dep(d: *zigmod.Dep, cachepath: string, options: *CollectO
243243 };
244244 },
245245 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) {
247247 error.ManifestNotFound => {
248248 if (d.main.len > 0 or d.c_include_dirs.len > 0 or d.c_source_files.len > 0 or d.keep) {
249249 var mod_from = try zigmod.Module.from(options.alloc, d.*, modpath, options);