| ... | @@ -2319,6 +2319,9 @@ fn workerAstGenFile( | ... | @@ -2319,6 +2319,9 @@ fn workerAstGenFile( |
| 2319 | break :blk mod.importFile(file, import_path) catch continue; | 2319 | break :blk mod.importFile(file, import_path) catch continue; |
| 2320 | }; | 2320 | }; |
| 2321 | if (import_result.is_new) { | 2321 | if (import_result.is_new) { |
| | 2322 | log.debug("AstGen of {s} has import '{s}'; queuing AstGen of {s}", .{ |
| | 2323 | file.sub_file_path, import_path, import_result.file.sub_file_path, |
| | 2324 | }); |
| 2322 | wg.start(); | 2325 | wg.start(); |
| 2323 | comp.thread_pool.spawn(workerAstGenFile, .{ | 2326 | comp.thread_pool.spawn(workerAstGenFile, .{ |
| 2324 | comp, import_result.file, prog_node, wg, | 2327 | comp, import_result.file, prog_node, wg, |
| ... | @@ -2540,13 +2543,23 @@ fn reportRetryableAstGenError( | ... | @@ -2540,13 +2543,23 @@ fn reportRetryableAstGenError( |
| 2540 | | 2543 | |
| 2541 | file.status = .retryable_failure; | 2544 | file.status = .retryable_failure; |
| 2542 | | 2545 | |
| 2543 | const err_msg = try Module.ErrorMsg.create(gpa, .{ | 2546 | const src_loc: Module.SrcLoc = .{ |
| 2544 | .file_scope = file, | 2547 | .file_scope = file, |
| 2545 | .parent_decl_node = 0, | 2548 | .parent_decl_node = 0, |
| 2546 | .lazy = .entire_file, | 2549 | .lazy = .entire_file, |
| 2547 | }, "unable to load {s}: {s}", .{ | 2550 | }; |
| 2548 | file.sub_file_path, @errorName(err), | 2551 | |
| 2549 | }); | 2552 | const err_msg = if (file.pkg.root_src_directory.path) |dir_path| |
| | 2553 | try Module.ErrorMsg.create( |
| | 2554 | gpa, |
| | 2555 | src_loc, |
| | 2556 | "unable to load {s}" ++ std.fs.path.sep_str ++ "{s}: {s}", |
| | 2557 | .{ dir_path, file.sub_file_path, @errorName(err) }, |
| | 2558 | ) |
| | 2559 | else |
| | 2560 | try Module.ErrorMsg.create(gpa, src_loc, "unable to load {s}: {s}", .{ |
| | 2561 | file.sub_file_path, @errorName(err), |
| | 2562 | }); |
| 2550 | errdefer err_msg.destroy(gpa); | 2563 | errdefer err_msg.destroy(gpa); |
| 2551 | | 2564 | |
| 2552 | { | 2565 | { |