| ... | @@ -4478,9 +4478,17 @@ pub fn semaFile(mod: *Module, file: *File) SemaError!void { | ... | @@ -4478,9 +4478,17 @@ pub fn semaFile(mod: *Module, file: *File) SemaError!void { |
| 4478 | try reportRetryableFileError(mod, file, "unable to load source: {s}", .{@errorName(err)}); | 4478 | try reportRetryableFileError(mod, file, "unable to load source: {s}", .{@errorName(err)}); |
| 4479 | return error.AnalysisFail; | 4479 | return error.AnalysisFail; |
| 4480 | }; | 4480 | }; |
| 4481 | const resolved_path = try file.pkg.root_src_directory.join(gpa, &.{ | 4481 | |
| 4482 | file.sub_file_path, | 4482 | const resolved_path = std.fs.path.resolve( |
| 4483 | }); | 4483 | gpa, |
| | 4484 | if (file.pkg.root_src_directory.path) |pkg_path| |
| | 4485 | &[_][]const u8{ pkg_path, file.sub_file_path } |
| | 4486 | else |
| | 4487 | &[_][]const u8{file.sub_file_path}, |
| | 4488 | ) catch |err| { |
| | 4489 | try reportRetryableFileError(mod, file, "unable to resolve path: {s}", .{@errorName(err)}); |
| | 4490 | return error.AnalysisFail; |
| | 4491 | }; |
| 4484 | errdefer gpa.free(resolved_path); | 4492 | errdefer gpa.free(resolved_path); |
| 4485 | | 4493 | |
| 4486 | try man.addFilePostContents(resolved_path, source.bytes, source.stat); | 4494 | try man.addFilePostContents(resolved_path, source.bytes, source.stat); |