include builtin & std packages in all defined packages

This commit is contained in:
Dimenus 2021-08-06 12:18:20 -05:00 committed by Andrew Kelley
parent d94252496e
commit ade85471e2

View File

@ -1227,6 +1227,12 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation {
} else main_pkg;
errdefer if (options.is_test) root_pkg.destroy(gpa);
var other_pkg_iter = main_pkg.table.valueIterator();
while (other_pkg_iter.next()) |pkg| {
try pkg.*.add(gpa, "builtin", builtin_pkg);
try pkg.*.add(gpa, "std", std_pkg);
}
try main_pkg.addAndAdopt(gpa, "builtin", builtin_pkg);
try main_pkg.add(gpa, "root", root_pkg);
try main_pkg.addAndAdopt(gpa, "std", std_pkg);