Skip to content

Fix useScala2LibraryTasty on non-bootstrapped #18733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,7 @@ object Build {
packageOptions += ManifestAttributes(("Git-Hash", VersionUtil.gitHash)),

javaOptions ++= {
val log = streams.value.log
val managedSrcDir = {
// Populate the directory
(Compile / managedSources).value
Expand All @@ -641,9 +642,13 @@ object Build {
val externalDeps = externalCompilerClasspathTask.value
val jars = packageAll.value

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

scala2LibraryTasty ++ Seq(
"-Ddotty.tests.dottyCompilerManagedSources=" + managedSrcDir,
Expand Down