Skip to content

Fix #11076: Use bootstrapped scalaInstance for community build #11082

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

Closed
wants to merge 1 commit into from
Closed
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
27 changes: 27 additions & 0 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,33 @@ object Build {
dependsOn(dottyLibrary(Bootstrapped)).
settings(commonBootstrappedSettings).
settings(
scalaInstance := {
val externalBootstrappedDeps = externalDependencyClasspath.in(`scala3-doc-bootstrapped`, Compile).value
val scalaLibrary = findArtifact(externalBootstrappedDeps, "scala-library")

// IMPORTANT: We need to use actual jars to form the ScalaInstance and not
// just directories containing classfiles because sbt maintains a cache of
// compiler instances. This cache is invalidated based on timestamps
// however this is only implemented on jars, directories are never
// invalidated.
val tastyCore = packageBin.in(`tasty-core-bootstrapped`, Compile).value
val dottyLibrary = packageBin.in(`scala3-library-bootstrapped`, Compile).value
val dottyInterfaces = packageBin.in(`scala3-interfaces`, Compile).value
val dottyCompiler = packageBin.in(`scala3-compiler-bootstrapped`, Compile).value
val dottyDoc = packageBin.in(`scala3-doc-bootstrapped`, Compile).value

val allJars = Seq(tastyCore, dottyLibrary, dottyInterfaces, dottyCompiler, dottyDoc) ++ externalBootstrappedDeps.map(_.data)

makeScalaInstance(
state.value,
scalaVersion.value,
scalaLibrary,
dottyLibrary,
dottyCompiler,
allJars,
appConfiguration.value
)
},
prepareCommunityBuild := {
(publishLocal in `scala3-sbt-bridge`).value
(publishLocal in `scala3-interfaces`).value
Expand Down