@@ -21,7 +21,7 @@ static std::optional<fs::path> rewriteOutputFileMap(const fs::path& scratchDir,
21
21
const fs::path& outputFileMapPath,
22
22
const std::vector<fs::path>& inputs,
23
23
PathRemapping& remapping) {
24
- auto newMapPath = scratchDir / outputFileMapPath;
24
+ auto newMapPath = scratchDir / outputFileMapPath. relative_path () ;
25
25
26
26
// TODO: do not assume absolute path for the second parameter
27
27
auto outputMapOrError = swift::OutputFileMap::loadFromPath (outputFileMapPath.c_str (), " " );
@@ -41,8 +41,8 @@ static std::optional<fs::path> rewriteOutputFileMap(const fs::path& scratchDir,
41
41
auto & newMap = newOutputMap.getOrCreateOutputMapForInput (key.c_str ());
42
42
newMap.copyFrom (*oldMap);
43
43
for (auto & entry : newMap) {
44
- auto oldPath = entry.getSecond ();
45
- auto newPath = scratchDir / oldPath;
44
+ fs::path oldPath = entry.getSecond ();
45
+ auto newPath = scratchDir / oldPath. relative_path () ;
46
46
entry.getSecond () = newPath;
47
47
remapping[oldPath] = newPath;
48
48
}
@@ -91,7 +91,7 @@ PathRemapping rewriteOutputsInPlace(const fs::path& scratchDir, std::vector<std:
91
91
for (size_t i = 0 ; i < CLIArgs.size (); i++) {
92
92
if (pathRewriteOptions.count (CLIArgs[i])) {
93
93
fs::path oldPath = CLIArgs[i + 1 ];
94
- auto newPath = scratchDir / oldPath;
94
+ auto newPath = scratchDir / oldPath. relative_path () ;
95
95
CLIArgs[++i] = newPath.string ();
96
96
newLocations.push_back (newPath);
97
97
0 commit comments