Skip to content

chore: add the testing suite for scala3-sbt-bridge and tasty-core #23617

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 29, 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
72 changes: 72 additions & 0 deletions .github/workflows/stdlib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,75 @@ jobs:
- uses: sbt/setup-sbt@v1
- name: Compile `scala3-sbt-bridge-bootstrapped`
run: ./project/scripts/sbt scala3-sbt-bridge-bootstrapped/compile

#################################################################################################
########################################### TEST JOBS ###########################################
#################################################################################################

test-scala3-sbt-bridge-nonbootstrapped:
runs-on: ubuntu-latest
##needs: [scala3-sbt-bridge-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: Test `scala3-sbt-bridge-nonbootstrapped`
run: ./project/scripts/sbt scala3-sbt-bridge-nonbootstrapped/test

test-scala3-sbt-bridge-bootstrapped:
runs-on: ubuntu-latest
##needs: [scala3-sbt-bridge-bootstrapped] 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: Test `scala3-sbt-bridge-bootstrapped`
run: ./project/scripts/sbt scala3-sbt-bridge-bootstrapped/test

test-tasty-core-nonbootstrapped:
runs-on: ubuntu-latest
##needs: [tasty-core-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: Test `tasty-core-nonbootstrapped`
run: ./project/scripts/sbt tasty-core-nonbootstrapped/test

test-tasty-core-bootstrapped:
runs-on: ubuntu-latest
##needs: [tasty-core-bootstrapped] 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: Test `tasty-core-bootstrapped`
run: ./project/scripts/sbt tasty-core-bootstrapped-new/test
3 changes: 3 additions & 0 deletions library/src/scala/collection/immutable/List.scala
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,9 @@ final case class :: [+A](override val head: A, private[scala] var next: List[A @
releaseFence()
override def headOption: Some[A] = Some(head)
override def tail: List[A] = next

def next$access$1 = next

Comment on lines +661 to +663
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dotc doesn't generate this method yet and running the bootstrapped test we add in this PR and the Open Community Build both complains about it missing. I'm adding it here manually so we can make progress but we will have to add the mechanism to generate it. I'm curious about why MiMa never flagged this issue...

}

case object Nil extends List[Nothing] {
Expand Down
58 changes: 52 additions & 6 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1396,14 +1396,25 @@ object Build {
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)
// Add the source directories for the sbt-bridge (non-boostrapped)
Compile / unmanagedSourceDirectories := Seq(baseDirectory.value / "src"),
Test / unmanagedSourceDirectories := Seq(baseDirectory.value / "test"),
Compile / resourceDirectory := baseDirectory.value / "resources",
// 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),
// Add all the project's external dependencies
libraryDependencies ++= Seq(
("org.scala-sbt" %% "zinc-apiinfo" % "1.8.0" % Test).cross(CrossVersion.for3Use2_13),
"com.github.sbt" % "junit-interface" % "0.13.3" % Test,
),
// Exclude the transitive dependencies from `zinc-apiinfo` that causes issues at the moment
excludeDependencies ++= Seq(
"org.scala-lang" % "scala-reflect",
"org.scala-lang" % "scala-compiler",
),
// Packaging configuration of the stdlib
Compile / packageBin / publishArtifact := true,
Compile / packageDoc / publishArtifact := false,
Expand Down Expand Up @@ -1455,7 +1466,7 @@ object Build {

/* Configuration of the org.scala-lang:scala3-sbt-bridge:*.**.**-bootstrapped project */
lazy val `scala3-sbt-bridge-bootstrapped` = project.in(file("sbt-bridge"))
.dependsOn(`scala3-compiler-bootstrapped`) // TODO: Would this actually evict the reference compiler in scala-tool?
.dependsOn(`scala3-compiler-bootstrapped-new`) // TODO: Would this actually evict the reference compiler in scala-tool?
.settings(
name := "scala3-sbt-bridge-bootstrapped",
moduleName := "scala3-sbt-bridge",
Expand All @@ -1464,15 +1475,27 @@ object Build {
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)
// Add the source directories for the sbt-bridge (boostrapped)
Compile / unmanagedSourceDirectories := Seq(baseDirectory.value / "src"),
Test / unmanagedSourceDirectories := Seq(baseDirectory.value / "test"),
Compile / resourceDirectory := baseDirectory.value / "resources",
// 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
// Add all the project's external dependencies
libraryDependencies ++= Seq(
("org.scala-sbt" %% "zinc-apiinfo" % "1.8.0" % Test).cross(CrossVersion.for3Use2_13),
"com.github.sbt" % "junit-interface" % "0.13.3" % Test,
),
// Exclude the transitive dependencies from `zinc-apiinfo` that causes issues at the moment
excludeDependencies ++= Seq(
"org.scala-lang" % "scala-reflect",
"org.scala-lang" % "scala-compiler",
),
//
// Packaging configuration of `scala3-sbt-bridge`
Compile / packageBin / publishArtifact := true,
Compile / packageDoc / publishArtifact := false,
Compile / packageSrc / publishArtifact := true,
Expand Down Expand Up @@ -1714,10 +1737,17 @@ object Build {
autoScalaLibrary := false,
// Add the source directories for the stdlib (non-boostrapped)
Compile / unmanagedSourceDirectories := Seq(baseDirectory.value / "src"),
Test / unmanagedSourceDirectories := Seq(baseDirectory.value / "test"),
Compile / unmanagedSourceDirectories += baseDirectory.value / "src-non-bootstrapped",
// 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),
// Add all the project's external dependencies
libraryDependencies ++= Seq(
"com.github.sbt" % "junit-interface" % "0.13.3" % Test,
),
// Packaging configuration of the stdlib
Compile / packageBin / publishArtifact := true,
Compile / packageDoc / publishArtifact := false,
Expand Down Expand Up @@ -1745,11 +1775,16 @@ object Build {
state.value,
scalaInstanceTopLoader.value,
)},
// Add configuration of the test
Test / envVars ++= Map(
"EXPECTED_TASTY_VERSION" -> expectedTastyVersion,
),

)

/* Configuration of the org.scala-lang:tasty-core_3:*.**.**-bootstrapped project */
lazy val `tasty-core-bootstrapped-new` = project.in(file("tasty"))
.dependsOn(`scala3-library-bootstrapped`)
.dependsOn(`scala3-library-bootstrapped-new`)
.settings(
name := "tasty-core-bootstrapped",
moduleName := "tasty-core",
Expand All @@ -1761,10 +1796,17 @@ object Build {
autoScalaLibrary := false,
// Add the source directories for the stdlib (non-boostrapped)
Compile / unmanagedSourceDirectories := Seq(baseDirectory.value / "src"),
Test / unmanagedSourceDirectories := Seq(baseDirectory.value / "test"),
Compile / unmanagedSourceDirectories += baseDirectory.value / "src-bootstrapped",
// 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),
// Add all the project's external dependencies
libraryDependencies ++= Seq(
"com.github.sbt" % "junit-interface" % "0.13.3" % Test,
),
// Packaging configuration of the stdlib
Compile / packageBin / publishArtifact := true,
Compile / packageDoc / publishArtifact := false,
Expand Down Expand Up @@ -1801,6 +1843,10 @@ object Build {
scalaCompilerBridgeBinaryJar := {
Some((`scala3-sbt-bridge-nonbootstrapped` / Compile / packageBin).value)
},
// Add configuration of the test
Test / envVars ++= Map(
"EXPECTED_TASTY_VERSION" -> expectedTastyVersion,
),
)

// ==============================================================================================
Expand Down Expand Up @@ -1930,7 +1976,7 @@ object Build {

/* Configuration of the org.scala-lang:scala3-compiler_3:*.**.**-bootstrapped project */
lazy val `scala3-compiler-bootstrapped-new` = project.in(file("compiler"))
.dependsOn(`scala3-interfaces`, `tasty-core-bootstrapped`, `scala3-library-bootstrapped`)
.dependsOn(`scala3-interfaces`, `tasty-core-bootstrapped-new`, `scala3-library-bootstrapped-new`)
.settings(
name := "scala3-compiler-bootstrapped",
moduleName := "scala3-compiler",
Expand Down
Loading