| ... | ... | @@ -898,10 +898,11 @@ pub const Object = struct { |
| 898 | 898 | // very location dependent. |
| 899 | 899 | // TODO: the only concern I have with this is WASI as either host or target, should |
| 900 | 900 | // we leave the paths as relative then? |
| 901 | | var buf: [std.fs.MAX_PATH_BYTES]u8 = undefined; |
| 902 | 901 | const compile_unit_dir_z = blk: { |
| 903 | | if (options.module) |mod| { |
| 902 | var buf: [std.fs.MAX_PATH_BYTES]u8 = undefined; |
| 903 | if (options.module) |mod| m: { |
| 904 | 904 | const d = try mod.root_mod.root.joinStringZ(builder.gpa, ""); |
| 905 | if (d.len == 0) break :m; |
| 905 | 906 | if (std.fs.path.isAbsolute(d)) break :blk d; |
| 906 | 907 | const abs = std.fs.realpath(d, &buf) catch break :blk d; |
| 907 | 908 | builder.gpa.free(d); |
| ... | ... | @@ -1840,7 +1841,8 @@ pub const Object = struct { |
| 1840 | 1841 | const dir_path = try file.mod.root.joinStringZ(gpa, sub_path); |
| 1841 | 1842 | if (std.fs.path.isAbsolute(dir_path)) break :d dir_path; |
| 1842 | 1843 | const abs = std.fs.realpath(dir_path, &buffer) catch break :d dir_path; |
| 1843 | | break :d try std.fs.path.joinZ(gpa, &.{ abs, sub_path }); |
| 1844 | gpa.free(dir_path); |
| 1845 | break :d try gpa.dupeZ(u8, abs); |
| 1844 | 1846 | }; |
| 1845 | 1847 | defer gpa.free(dir_path_z); |
| 1846 | 1848 | const sub_file_path_z = try gpa.dupeZ(u8, std.fs.path.basename(file.sub_file_path)); |