Skip to content

Add all remaining non-bootstrapped projects #23605

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
merged 3 commits into from
Jul 26, 2025
Merged
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions .github/workflows/stdlib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,20 @@ jobs:
- uses: sbt/setup-sbt@v1
- name: Compile `scala3-compiler-nonbootstrapped`
run: ./project/scripts/sbt scala3-compiler-nonbootstrapped/compile

scala3-sbt-bridge-nonbootstrapped:
runs-on: ubuntu-latest
##needs: [scala3-compiler-nonbootstrapped] Add when we add support for caching here
steps:
- name: Git Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@v1
- name: Compile `scala3-sbt-bridge-nonbootstrapped`
run: ./project/scripts/sbt scala3-sbt-bridge-nonbootstrapped/compile
2 changes: 2 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
val scala3 = Build.scala3
val `scala3-nonbootstrapped` = Build.`scala3-nonbootstrapped`
val `scala3-bootstrapped` = Build.`scala3-bootstrapped`
val `scala3-interfaces` = Build.`scala3-interfaces`
val `scala3-compiler` = Build.`scala3-compiler`
Expand All @@ -12,6 +13,7 @@ val `scala3-library` = Build.`scala3-library`
val `scala3-library-bootstrapped` = Build.`scala3-library-bootstrapped`
val `scala3-library-bootstrappedJS` = Build.`scala3-library-bootstrappedJS`
val `scala3-sbt-bridge` = Build.`scala3-sbt-bridge`
val `scala3-sbt-bridge-nonbootstrapped` = Build.`scala3-sbt-bridge-nonbootstrapped`
val `scala3-sbt-bridge-tests` = Build.`scala3-sbt-bridge-tests`
val `scala3-staging` = Build.`scala3-staging`
val `scala3-tasty-inspector` = Build.`scala3-tasty-inspector`
Expand Down
106 changes: 93 additions & 13 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,73 @@ object Build {
)
)

// ==============================================================================================
// ================================= NON-BOOTSTRAPPED PROJECTS ==================================
// ==============================================================================================

lazy val `scala3-nonbootstrapped` = project
.aggregate(`scala3-interfaces`, `scala3-library-nonbootstrapped` , `scala-library-nonbootstrapped`,
`tasty-core-nonbootstrapped`, `scala3-compiler-nonbootstrapped`, `scala3-sbt-bridge-nonbootstrapped`)
.settings(
name := "scala3-nonbootstrapped",
moduleName := "scala3-nonbootstrapped",
version := dottyNonBootstrappedVersion,
// Nothing to be published by this project, it is only an aggregate
Compile / publishArtifact := false,
Test / publishArtifact := false,
// Nothing to be published by this project
publish / skip := true,
// Project specific target folder. sbt doesn't like having two projects using the same target folder
target := target.value / "scala3-nonbootstrapped",
)

/* Configuration of the org.scala-lang:scala3-sbt-bridge:*.**.**-nonbootstrapped project */
lazy val `scala3-sbt-bridge-nonbootstrapped` = project.in(file("sbt-bridge"))
.dependsOn(`scala3-compiler-nonbootstrapped`) // TODO: Would this actually evict the reference compiler in scala-tool?
.settings(
name := "scala3-sbt-bridge-nonbootstrapped",
moduleName := "scala3-sbt-bridge",
version := dottyNonBootstrappedVersion,
versionScheme := Some("semver-spec"),
scalaVersion := referenceVersion, // nonbootstrapped artifacts are compiled with the reference compiler (already officially published)
crossPaths := false, // org.scala-lang:scala3-sbt-bridge doesn't have a crosspath
autoScalaLibrary := false, // do not add a dependency to stdlib, we depend transitively on the stdlib from `scala3-compiler-nonbootstrapped`
// Add the source directories for the stdlib (non-boostrapped)
Compile / unmanagedSourceDirectories := Seq(baseDirectory.value / "src"),
// NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
Compile / scalacOptions := Seq("-deprecation", "-feature", "-unchecked", "-encoding", "UTF8", "-language:implicitConversions"),
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
// Packaging configuration of the stdlib
Compile / packageBin / publishArtifact := true,
Compile / packageDoc / publishArtifact := false,
Compile / packageSrc / publishArtifact := true,
// Only publish compilation artifacts, no test artifacts
Test / publishArtifact := false,
// non-bootstrapped stdlib is publishable (only locally)
publish / skip := false,
// Project specific target folder. sbt doesn't like having two projects using the same target folder
target := target.value / "scala3-sbt-bridge-nonbootstrapped",
// sbt adds all the projects to scala-tool config which breaks building the scalaInstance
// as a workaround, I build it manually by only adding the compiler
scalaInstance := {
val lm = dependencyResolution.value
val log = streams.value.log
val retrieveDir = streams.value.cacheDirectory / "scala3-compiler" / scalaVersion.value
val comp = lm.retrieve("org.scala-lang" % "scala3-compiler_3" %
scalaVersion.value, scalaModuleInfo = None, retrieveDir, log)
.fold(w => throw w.resolveException, identity)
Defaults.makeScalaInstance(
scalaVersion.value,
Array.empty,
comp.toSeq,
Seq.empty,
state.value,
scalaInstanceTopLoader.value,
)},
)

// ==============================================================================================
// =================================== SCALA STANDARD LIBRARY ===================================
// ==============================================================================================
Expand Down Expand Up @@ -1391,11 +1458,14 @@ object Build {
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
// Packaging configuration of the stdlib
Compile / packageBin / publishArtifact := true,
Compile / packageDoc / publishArtifact := false,
Compile / packageSrc / publishArtifact := true,
// Only publish compilation artifacts, no test artifacts
Compile / publishArtifact := true,
Test / publishArtifact := false,
// Do not allow to publish this project for now
publish / skip := true,
// non-bootstrapped stdlib is publishable (only locally)
publish / skip := false,
// Project specific target folder. sbt doesn't like having two projects using the same target folder
target := target.value / "scala-library-nonbootstrapped",
)
Expand Down Expand Up @@ -1426,11 +1496,15 @@ object Build {
Test / compile := (`scala-library-nonbootstrapped` / Test / compile).value,
Test / doc := (`scala-library-nonbootstrapped` / Test / doc).value,
Test / run := (`scala-library-nonbootstrapped` / Test / run).evaluated,
Test / test := (`scala-library-nonbootstrapped` / Test / test).value,
// Packaging configuration of the stdlib
Compile / packageBin / publishArtifact := true,
Compile / packageDoc / publishArtifact := false,
Compile / packageSrc / publishArtifact := true,
// Only publish compilation artifacts, no test artifacts
Compile / publishArtifact := true,
Test / publishArtifact := false,
// Do not allow to publish this project for now
publish / skip := true,
publish / skip := false,
// Project specific target folder. sbt doesn't like having two projects using the same target folder
target := target.value / "scala3-library-nonbootstrapped",
)
Expand All @@ -1443,7 +1517,7 @@ object Build {
moduleName := "scala-library",
version := dottyVersion,
versionScheme := Some("semver-spec"),
// sbt defaults to scala 2.12.x and metals will report issues as it doesn't consider the project a scala 3 project
// sbt defaults to scala 2.12.x and metals will report issues as it doesn't consider the project a scala 3 project
// (not the actual version we use to compile the project)
scalaVersion := referenceVersion,
crossPaths := false, // org.scala-lang:scala-library doesn't have a crosspath
Expand Down Expand Up @@ -1511,7 +1585,7 @@ object Build {
moduleName := "scala3-library",
version := dottyVersion,
versionScheme := Some("semver-spec"),
// sbt defaults to scala 2.12.x and metals will report issues as it doesn't consider the project a scala 3 project
// sbt defaults to scala 2.12.x and metals will report issues as it doesn't consider the project a scala 3 project
// (not the actual version we use to compile the project)
scalaVersion := referenceVersion,
crossPaths := true, // org.scala-lang:scala3-library has a crosspath
Expand Down Expand Up @@ -1562,11 +1636,14 @@ object Build {
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
// Packaging configuration of the stdlib
Compile / packageBin / publishArtifact := true,
Compile / packageDoc / publishArtifact := false,
Compile / packageSrc / publishArtifact := true,
// Only publish compilation artifacts, no test artifacts
Compile / publishArtifact := true,
Test / publishArtifact := false,
// Do not allow to publish this project for now
publish / skip := true,
publish / skip := false,
// Project specific target folder. sbt doesn't like having two projects using the same target folder
target := target.value / "tasty-core-nonbootstrapped",
// sbt adds all the projects to scala-tool config which breaks building the scalaInstance
Expand All @@ -1575,7 +1652,7 @@ object Build {
val lm = dependencyResolution.value
val log = streams.value.log
val retrieveDir = streams.value.cacheDirectory / "scala3-compiler" / scalaVersion.value
val comp = lm.retrieve("org.scala-lang" % "scala3-compiler_3" %
val comp = lm.retrieve("org.scala-lang" % "scala3-compiler_3" %
scalaVersion.value, scalaModuleInfo = None, retrieveDir, log)
.fold(w => throw w.resolveException, identity)
Defaults.makeScalaInstance(
Expand Down Expand Up @@ -1623,11 +1700,14 @@ object Build {
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
// Packaging configuration of the stdlib
Compile / packageBin / publishArtifact := true,
Compile / packageDoc / publishArtifact := false,
Compile / packageSrc / publishArtifact := true,
// Only publish compilation artifacts, no test artifacts
Compile / publishArtifact := true,
Test / publishArtifact := false,
// Do not allow to publish this project for now
publish / skip := true,
publish / skip := false,
// Project specific target folder. sbt doesn't like having two projects using the same target folder
target := target.value / "scala3-compiler-nonbootstrapped",
// Generate compiler.properties, used by sbt
Expand Down Expand Up @@ -1656,7 +1736,7 @@ object Build {
val lm = dependencyResolution.value
val log = streams.value.log
val retrieveDir = streams.value.cacheDirectory / "scala3-compiler" / scalaVersion.value
val comp = lm.retrieve("org.scala-lang" % "scala3-compiler_3" %
val comp = lm.retrieve("org.scala-lang" % "scala3-compiler_3" %
scalaVersion.value, scalaModuleInfo = None, retrieveDir, log)
.fold(w => throw w.resolveException, identity)
Defaults.makeScalaInstance(
Expand Down
Loading