From e13fc6b119c5593b4fccd5ae064c6b251bbe50e7 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 16 Apr 2021 19:45:58 -0700 Subject: stage2: make `@import` relative to the current file previously, it was incorrectly relative to the package directory --- src/Compilation.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Compilation.zig') diff --git a/src/Compilation.zig b/src/Compilation.zig index 3f0937c957..7a496ccc45 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1535,7 +1535,8 @@ pub fn update(self: *Compilation) !void { // Make sure std.zig is inside the import_table. We unconditionally need // it for start.zig. - _ = try module.importFile(module.root_pkg, "std"); + const std_pkg = module.root_pkg.table.get("std").?; + _ = try module.importPkg(module.root_pkg, std_pkg); // Put a work item in for every known source file to detect if // it changed, and, if so, re-compute ZIR and then queue the job @@ -2118,6 +2119,7 @@ fn workerAstGenFile( // there is a missing `failed_files` error message. error.OutOfMemory => {}, }; + return; }, }; @@ -2136,7 +2138,7 @@ fn workerAstGenFile( const lock = comp.mutex.acquire(); defer lock.release(); - break :blk mod.importFile(file.pkg, import_path) catch continue; + break :blk mod.importFile(file, import_path) catch continue; }; if (import_result.is_new) { wg.start(); -- cgit v1.2.3