Skip to content

Commit 8214533

Browse files
committed
chore: make scala3-library-bootstrapped-new actually compile with the non-bootstrapped compiler
1 parent 61cb228 commit 8214533

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

.github/workflows/stdlib.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747

4848
scala-library-bootstrapped:
4949
runs-on: ubuntu-latest
50+
needs : [scala3-compiler-nonbootstrapped, scala3-sbt-bridge-nonbootstrapped, scala-library-nonbootstrapped, scala3-library-nonbootstrapped]
5051
steps:
5152
- name: Git Checkout
5253
uses: actions/checkout@v4

project/Build.scala

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,7 @@ object Build {
15201520
versionScheme := Some("semver-spec"),
15211521
// sbt defaults to scala 2.12.x and metals will report issues as it doesn't consider the project a scala 3 project
15221522
// (not the actual version we use to compile the project)
1523-
scalaVersion := referenceVersion,
1523+
scalaVersion := dottyNonBootstrappedVersion,
15241524
crossPaths := false, // org.scala-lang:scala-library doesn't have a crosspath
15251525
// Add the source directories for the stdlib (non-boostrapped)
15261526
Compile / unmanagedSourceDirectories := Seq(baseDirectory.value / "src"),
@@ -1548,33 +1548,29 @@ object Build {
15481548
managedScalaInstance := true,
15491549
// Configure the nonbootstrapped compiler
15501550
scalaInstance := {
1551-
val externalLibraryDeps = (`scala3-library` / Compile / externalDependencyClasspath).value.map(_.data).toSet
1552-
val externalCompilerDeps = (`scala3-compiler` / Compile / externalDependencyClasspath).value.map(_.data).toSet
1551+
val externalCompilerDeps = (`scala3-compiler-nonbootstrapped` / Compile / externalDependencyClasspath).value.map(_.data).toSet
15531552

15541553
// IMPORTANT: We need to use actual jars to form the ScalaInstance and not
15551554
// just directories containing classfiles because sbt maintains a cache of
15561555
// compiler instances. This cache is invalidated based on timestamps
15571556
// however this is only implemented on jars, directories are never
15581557
// invalidated.
1559-
val tastyCore = (`tasty-core` / Compile / packageBin).value
1560-
val scala3Library = (`scala3-library` / Compile / packageBin).value
1558+
val tastyCore = (`tasty-core-nonbootstrapped` / Compile / packageBin).value
1559+
val scalaLibrary = (`scala-library-nonbootstrapped` / Compile / packageBin).value
15611560
val scala3Interfaces = (`scala3-interfaces` / Compile / packageBin).value
1562-
val scala3Compiler = (`scala3-compiler` / Compile / packageBin).value
1563-
1564-
val libraryJars = Array(scala3Library) ++ externalLibraryDeps
1565-
val compilerJars = Seq(tastyCore, scala3Interfaces, scala3Compiler) ++ (externalCompilerDeps -- externalLibraryDeps)
1561+
val scala3Compiler = (`scala3-compiler-nonbootstrapped` / Compile / packageBin).value
15661562

15671563
Defaults.makeScalaInstance(
15681564
dottyNonBootstrappedVersion,
1569-
libraryJars = libraryJars,
1570-
allCompilerJars = compilerJars,
1571-
allDocJars = Seq.empty,
1565+
libraryJars = Array(scalaLibrary),
1566+
allCompilerJars = Seq(tastyCore, scala3Interfaces, scala3Compiler) ++ externalCompilerDeps,
1567+
allDocJars = Seq.empty,
15721568
state.value,
15731569
scalaInstanceTopLoader.value
15741570
)
15751571
},
15761572
scalaCompilerBridgeBinaryJar := {
1577-
Some((`scala3-sbt-bridge` / Compile / packageBin).value)
1573+
Some((`scala3-sbt-bridge-nonbootstrapped` / Compile / packageBin).value)
15781574
},
15791575
)
15801576

0 commit comments

Comments
 (0)