finish hooking up new dependency tree logic

* add Module instances for each package's build.zig and attach it to the
  dependencies.zig module with the hash digest hex string as the name.
* fix incorrectly skipping the wrong packages for creating
  dependencies.zig
* a couple more renaming of "package" to "module"
This commit is contained in:
Andrew Kelley
2023-10-07 22:34:45 -07:00
parent 35d81c99c0
commit e5c2a7dbca
6 changed files with 77 additions and 39 deletions

View File

@@ -4074,7 +4074,7 @@ pub fn importFile(
return mod.importPkg(pkg);
}
if (!mem.endsWith(u8, import_string, ".zig")) {
return error.PackageNotFound;
return error.ModuleNotFound;
}
const gpa = mod.gpa;
@@ -4120,7 +4120,7 @@ pub fn importFile(
{
break :p try gpa.dupe(u8, resolved_path);
}
return error.ImportOutsidePkgPath;
return error.ImportOutsideModulePath;
};
errdefer gpa.free(sub_file_path);
@@ -4206,7 +4206,7 @@ pub fn embedFile(mod: *Module, cur_file: *File, import_string: []const u8) !*Emb
{
break :p try gpa.dupe(u8, resolved_path);
}
return error.ImportOutsidePkgPath;
return error.ImportOutsideModulePath;
};
errdefer gpa.free(sub_file_path);