Skip to content

Commit 66ccd6a

Browse files
author
Jaden Peterson
committed
Don't absolutize sources outside of the sourceroot in TASTy
With inlining and standard library patching, it's inevitable that, when writing TASTy files, we'll encounter sources outside the sourceroot. However, we shouldn't write those sources as absolute paths because that's non-reproducible and can cause determinism issues. Instead, we should write the paths as-is. While these sorts of paths aren't correct when written relatively, they weren't correct to begin with because they don't actually exist on the filesystem.
1 parent 9056e42 commit 66ccd6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/util/SourceFile.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ object SourceFile {
295295
val path = refPath.relativize(sourcePath)
296296
path.iterator.asScala.mkString("/")
297297
else
298-
sourcePath.toString
298+
jpath.toString
299299
}
300300

301301
/** Return true if file is a script:

0 commit comments

Comments
 (0)