Skip to content

Commit e9634de

Browse files
committed
Fix crash when recording dependency information
1 parent 9ff6f09 commit e9634de

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,14 @@ class ExtractDependencies extends Phase {
127127
// We can recover the fully qualified name of a classfile from
128128
// its path
129129
val classSegments = pf.givenPath.segments.takeRight(packages + 1)
130-
binaryDependency(pf.file, binaryClassName(classSegments))
130+
// FIXME: pf.file is null for classfiles coming from the modulepath
131+
// (handled by JrtClassPath) because they cannot be represented as
132+
// java.io.File, since the `binaryDependency` callback must take a
133+
// java.io.File, this means that we cannot record dependencies coming
134+
// from the modulepath. For now this isn't a big deal since we only
135+
// support having the standard Java library on the modulepath.
136+
if (pf.file != null)
137+
binaryDependency(pf.file, binaryClassName(classSegments))
131138

132139
case _ =>
133140
ctx.warning(s"sbt-deps: Ignoring dependency $depFile of class ${depFile.getClass}}")

0 commit comments

Comments
 (0)