Skip to content

chore: add tasty-core-nonbootstrapped in the new build #23599

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 1 commit into from
Jul 25, 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 @@ -79,3 +79,20 @@ jobs:
- uses: sbt/setup-sbt@v1
- name: Compile `scala3-library-bootstrapped`
run: ./project/scripts/sbt scala3-library-bootstrapped-new/compile

tasty-core-nonbootstrapped:
runs-on: ubuntu-latest
##needs: [scala3-library-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 `tasty-core-nonbootstrapped`
run: ./project/scripts/sbt tasty-core-nonbootstrapped/compile
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ val `scala2-library-tasty` = Build.`scala2-library-tasty`
val `scala2-library-cc` = Build.`scala2-library-cc`
val `scala2-library-cc-tasty` = Build.`scala2-library-cc-tasty`
val `tasty-core` = Build.`tasty-core`
val `tasty-core-nonbootstrapped` = Build.`tasty-core-nonbootstrapped`
val `tasty-core-bootstrapped` = Build.`tasty-core-bootstrapped`
val `tasty-core-scala2` = Build.`tasty-core-scala2`
val scaladoc = Build.scaladoc
Expand Down
48 changes: 48 additions & 0 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1540,6 +1540,54 @@ object Build {
target := target.value / "scala3-library-bootstrapped",
)

// ==============================================================================================
// ===================================== TASTY CORE LIBRARY =====================================
// ==============================================================================================

/* Configuration of the org.scala-lang:tasty-core_3:*.**.**-nonbootstrapped project */
lazy val `tasty-core-nonbootstrapped` = project.in(file("tasty"))
.dependsOn(`scala3-library-nonbootstrapped`)
.settings(
name := "tasty-core-nonbootstrapped",
moduleName := "tasty-core",
version := dottyNonBootstrappedVersion,
versionScheme := Some("semver-spec"),
scalaVersion := referenceVersion, // nonbootstrapped artifacts are compiled with the reference compiler (already officially published)
crossPaths := true, // org.scala-lang:tasty-core has a crosspath
// sbt shouldn't add stdlib automatically, we depend on `scala3-library-nonbootstrapped`
autoScalaLibrary := false,
// Add the source directories for the stdlib (non-boostrapped)
Compile / unmanagedSourceDirectories := Seq(baseDirectory.value / "src"),
Compile / unmanagedSourceDirectories += baseDirectory.value / "src-non-bootstrapped",
// 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),
// 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,
// 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
// 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,
)},
)

def dottyLibrary(implicit mode: Mode): Project = mode match {
case NonBootstrapped => `scala3-library`
case Bootstrapped => `scala3-library-bootstrapped`
Expand Down
Loading