diff --git a/scalalib/worker/src/mill/scalalib/worker/MockedLookup.scala b/scalalib/worker/src/mill/scalalib/worker/MockedLookup.scala index 6990a6738e6..26dffbf1db3 100644 --- a/scalalib/worker/src/mill/scalalib/worker/MockedLookup.scala +++ b/scalalib/worker/src/mill/scalalib/worker/MockedLookup.scala @@ -13,6 +13,9 @@ case class MockedLookup(am: VirtualFile => Optional[CompileAnalysis]) override def analysis(classpathEntry: VirtualFile): Optional[CompileAnalysis] = am(classpathEntry) - override def definesClass(classpathEntry: VirtualFile): DefinesClass = - Locate.definesClass(classpathEntry) + override def definesClass(classpathEntry: VirtualFile): DefinesClass = { + if (classpathEntry.name.toString != "rt.jar") + Locate.definesClass(classpathEntry) + else (_: String) => false + } } diff --git a/scalalib/worker/src/mill/scalalib/worker/ZincWorkerImpl.scala b/scalalib/worker/src/mill/scalalib/worker/ZincWorkerImpl.scala index 4aff9d9a04a..05b5eb9ae77 100644 --- a/scalalib/worker/src/mill/scalalib/worker/ZincWorkerImpl.scala +++ b/scalalib/worker/src/mill/scalalib/worker/ZincWorkerImpl.scala @@ -474,7 +474,8 @@ class ZincWorkerImpl( val store = FileAnalysisStore.binary(zincFile.toIO) - val converter = PlainVirtualFileConverter.converter + // Fix jdk classes marked as binary dependencies, see https://github.com/com-lihaoyi/mill/pull/1904 + val converter = MappedFileConverter.empty val classpath = (compileClasspath.iterator ++ Some(classesDir)) .map(path => converter.toVirtualFile(path.toNIO)) .toArray