From 66ccd6a5f6a76e69e4be923458478c468fda8258 Mon Sep 17 00:00:00 2001 From: Jaden Peterson Date: Thu, 20 Nov 2025 09:19:49 -0500 Subject: [PATCH] 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. --- compiler/src/dotty/tools/dotc/util/SourceFile.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/util/SourceFile.scala b/compiler/src/dotty/tools/dotc/util/SourceFile.scala index 8800743c4f1c..da8e74a251c4 100644 --- a/compiler/src/dotty/tools/dotc/util/SourceFile.scala +++ b/compiler/src/dotty/tools/dotc/util/SourceFile.scala @@ -295,7 +295,7 @@ object SourceFile { val path = refPath.relativize(sourcePath) path.iterator.asScala.mkString("/") else - sourcePath.toString + jpath.toString } /** Return true if file is a script: