@@ -21,7 +21,7 @@ static std::optional<fs::path> rewriteOutputFileMap(const fs::path& scratchDir,
2121 const fs::path& outputFileMapPath,
2222 const std::vector<fs::path>& inputs,
2323 PathRemapping& remapping) {
24- auto newMapPath = scratchDir / outputFileMapPath;
24+ auto newMapPath = scratchDir / outputFileMapPath. relative_path () ;
2525
2626 // TODO: do not assume absolute path for the second parameter
2727 auto outputMapOrError = swift::OutputFileMap::loadFromPath (outputFileMapPath.c_str (), " " );
@@ -41,8 +41,8 @@ static std::optional<fs::path> rewriteOutputFileMap(const fs::path& scratchDir,
4141 auto & newMap = newOutputMap.getOrCreateOutputMapForInput (key.c_str ());
4242 newMap.copyFrom (*oldMap);
4343 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 () ;
4646 entry.getSecond () = newPath;
4747 remapping[oldPath] = newPath;
4848 }
@@ -91,7 +91,7 @@ PathRemapping rewriteOutputsInPlace(const fs::path& scratchDir, std::vector<std:
9191 for (size_t i = 0 ; i < CLIArgs.size (); i++) {
9292 if (pathRewriteOptions.count (CLIArgs[i])) {
9393 fs::path oldPath = CLIArgs[i + 1 ];
94- auto newPath = scratchDir / oldPath;
94+ auto newPath = scratchDir / oldPath. relative_path () ;
9595 CLIArgs[++i] = newPath.string ();
9696 newLocations.push_back (newPath);
9797
0 commit comments