Skip to content
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

Make scripted test run with Scala 2.13 by default #1300

Closed
Closed
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,12 @@ class IncHandler(directory: Path, cacheDir: Path, scriptedLog: ManagedLogger, co

def initBuildStructure(): Unit = {
val build = initBuild
val defaultScalaVersion = "2.13.12"
Copy link
Member Author

@Friendseeker Friendseeker Dec 5, 2023

Choose a reason for hiding this comment

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

Would it be better for defaultScalaVersion to be stored in sys.props instead?

e.g.

def scalaVersion =
sys.props
.get("zinc.build.compilerbridge.scalaVersion")
.getOrElse(sys.error("zinc.build.compilerbridge.scalaVersion property not found"))

Then we can conveniently setup CI to run scripted tests against both 2.12 & 2.13 in a clean manner. Despite 2.12 is phasing out, it might be still worthy it to keep 2.12 coverage for the slim chance that some issue only surface in 2.12.

Copy link
Member Author

@Friendseeker Friendseeker Dec 5, 2023

Choose a reason for hiding this comment

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

@xuwei-k Since you did lots of work on the CI & Testing side, would you mind to give a quick look on this PR? Your opinion would be valuable.

build.projects.foreach { p =>
val in: Path = p.in.getOrElse(directory / p.name)
val version = p.scalaVersion.getOrElse(scala.util.Properties.versionNumberString)
// TODO: when zinc-scripted builds at Scala 2.13 by default, instead
// uses scala.util.Properties.versionNumberString and remove defaultScalaVersion
val version = p.scalaVersion.getOrElse(defaultScalaVersion)
val deps = p.dependsOn.toVector.flatten
val project = ProjectStructure(
p.name,
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ object Dependencies {
val scala210 = "2.10.7"
val scala211 = "2.11.12"
val scala212 = "2.12.18"
val scala213 = "2.13.12"
val scala213 = "2.13.12" // Sync with defaultScalaVersion in IncHandler.scala
val defaultScalaVersion = scala212
val allScalaVersions = Seq(defaultScalaVersion, scala210, scala211, scala213)
val scala212_213 = Seq(defaultScalaVersion, scala213)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# The test passes in Scala 2.12 but not Scala 2.13
> checkProducts main.scala: ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2$OuterLevelWithVeryVeryVeryLongClassName3.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2$OuterLevelWithVeryVeryVeryLongClassName3$OuterLevelWithVeryVeryVeryLongClassName4.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2$OuterLevelWithVeryVeryVeryLongClassName3$OuterLevelWithVeryVeryVeryLongClassName4$OuterLevelWithVeryVeryVeryLongClassName5.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2$OuterLevelWithVeryVeryVeryLongClassName3$OuterLevelWithVeryVeryVeryLongClassName4$OuterLevelWithVeryVeryVeryLongClassName5$OuterLevelWithVeryVeryVeryLongClassName6.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVe$$$$6facba931fe42f8a8c3cee88c4087$$$$ryVeryLongClassName6$OuterLevelWithVeryVeryVeryLongClassName7.class
> checkProductsExists main.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# The test passes in Scala 2.12 but not Scala 2.13
> checkNoClassFiles
> compile
-> checkNoClassFiles
Expand Down