Skip to content

Commit 06a1fa2

Browse files
Fix useScala2LibraryTasty on non-bootstrapped (#18733)
If the value of `useScala2LibraryTasty` is `true`, it does not imply that we have a jar for `scala2-library-tasty`. Bug introduced in #18730.
2 parents b2cd869 + 80bdc90 commit 06a1fa2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

project/Build.scala

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,7 @@ object Build {
632632
packageOptions += ManifestAttributes(("Git-Hash", VersionUtil.gitHash)),
633633

634634
javaOptions ++= {
635+
val log = streams.value.log
635636
val managedSrcDir = {
636637
// Populate the directory
637638
(Compile / managedSources).value
@@ -641,9 +642,13 @@ object Build {
641642
val externalDeps = externalCompilerClasspathTask.value
642643
val jars = packageAll.value
643644

644-
val scala2LibraryTasty =
645-
if (useScala2LibraryTasty.value) Seq("-Ddotty.tests.tasties.scalaLibrary=" + jars("scala2-library-tasty"))
646-
else Seq.empty
645+
val scala2LibraryTasty = jars.get("scala2-library-tasty") match {
646+
case Some(scala2LibraryTastyJar) if useScala2LibraryTasty.value =>
647+
Seq("-Ddotty.tests.tasties.scalaLibrary=" + scala2LibraryTastyJar)
648+
case _ =>
649+
if (useScala2LibraryTasty.value) log.warn("useScala2LibraryTasty is ignored on non-bootstrapped compiler")
650+
Seq.empty
651+
}
647652

648653
scala2LibraryTasty ++ Seq(
649654
"-Ddotty.tests.dottyCompilerManagedSources=" + managedSrcDir,

0 commit comments

Comments
 (0)