scala / scala3

The Scala 3 compiler, also known as Dotty.
https://dotty.epfl.ch
Apache License 2.0
5.87k stars 1.06k forks source link

Scala 3.2.0-RC2 Open Community Build regressions tracker #15647

Closed WojciechMazur closed 1 year ago

WojciechMazur commented 2 years ago

Each table contains a list of projects that failed to compile with Scala 3.2.0-RC2, but was successfully built with the given previous version. A summary is based only on final and released candidate versions of Scala 3. Information about the last Scala version used for the last successful build might not always be correct, due to lack of data (lack of build for that project with given Scala version)

Open community build might have applied -source:X-migration flag if it is detected it could possibly fix the build. Summary only contains projects that failed when compiling source or test files of at least 1 sub-project.

All tested projects: 818 Open Community build run: Build #17 - 3.2.0-RC2-all-projects

Notes for issue reproducers: To reproduce builds locally you can use:

scala-cli run https://raw.githubusercontent.com/VirtusLab/community-build3/master/cli/scb-cli.scala -- reproduce --locally BUILD_ID

BUILD ID can be found in the BUILD_URL columns (eg. Open CB #BUILD_ID) Helpful options for reproducer scripts:

griggt commented 2 years ago

The build failures of ohze/akka-guice, ohze/couchbase-scala, and ohze/sd-util are all due to the use of the sbt plugin "com.sandinh" % "sd-devops-oss". That plugin checks the value of CrossVersion.scalaApiVersion(scalaVersion):

https://github.com/ohze/sbt-devops/blob/771fbf9283d687e2fe68e5918adec23097cb3891/sd/src/main/scala/com/sandinh/sbtsd/SdPlugin.scala#L150

which has this behavior:

CrossVersion.scalaApiVersion("3.1.0")       // Some((3,1))
CrossVersion.scalaApiVersion("3.1.3")       // Some((3,1))
CrossVersion.scalaApiVersion("3.1.0-RC1")   // None
CrossVersion.scalaApiVersion("3.1.3-RC1")   // Some((3,1))
CrossVersion.scalaApiVersion("3.2.0")       // Some((3,2))
CrossVersion.scalaApiVersion("3.2.0-RC2")   // None      <---- this is our failing case
CrossVersion.scalaApiVersion("3.2.1-RC2")   // Some((3,2))

I'm not sure if this scalaApiVersion method is intended to be used with Scala 3 versioning (all the test cases are for Scala 2), but it seems the issue here is either with the plugin or sbt.

armanbilge commented 2 years ago

Btw, I'm looking into my own project on that list. I don't think it's a regression, even the current main doesn't seem to be compiling locally even though CI is green. So something weird going on.

som-snytt commented 2 years ago

@armanbilge technically, that is called a weird regression.

griggt commented 2 years ago

Some of the other build failures are not regressions per se, but expected based on changes from 3.1 to 3.2.

Examples:

armanbilge commented 2 years ago

I offer CI evidence that my project is fine on 3.2.0-RC2. https://github.com/armanbilge/saslprep/runs/7294875650?check_suite_focus=true

I don't know what's magic about CI. Seems to go badly wrong basically everywhere else, not just Scala 3 but Scala 2 as well.

griggt commented 2 years ago

Here's a reproducer for the tinkoff/phobos failure:

import scala.quoted.*

class ProductTypeField(using val quotes: Quotes)(val name: String)

def foo(using Quotes): ProductTypeField = ProductTypeField()("")
-- Error: ptf.scala:5:58 -------------------------------------------------------
5 |def foo(using Quotes): ProductTypeField = ProductTypeField()("")
  |                                          ^^^^^^^^^^^^^^^^^^
  |missing argument for parameter name of constructor ProductTypeField in class ProductTypeField: (name: String): ProductTypeField

However if I understand correctly this is caused by an intentional source breaking change in #14840?

griggt commented 2 years ago

Btw, I'm looking into my own project [saslprep] on that list. I don't think it's a regression, even the current main doesn't seem to be compiling locally even though CI is green. So something weird going on.

I cloned it and built and tested locally on 3.2.0-RC2 and it was fine, so :shrug:

WojciechMazur commented 2 years ago

@griggt great hob. The failure in shiftleftsecurity/codepropertygraph in theory should be handled as we do apply -source:3.2-migration flag if logs show us it could fix the build, the problem was caused by the fact of combination -Xfatal-warnings or -Wconf:e:any flag which do elevate warning about possible rewrite, into an error (https://github.com/lampepfl/dotty/pull/15589)

WojciechMazur commented 2 years ago

@armanbilge I can confirm that the issue with your project is only happening in our testing environment due to a more strict resource policy (limited memory inside the container) though due to reduced -Xss leading to StackOverflowError. It can re reproduced when using the scala-cli script listed at the begging of the issue (without --locally flag). It can be ignored

KacperFKorban commented 2 years ago

I took a look at jcouyang/meow:

KacperFKorban commented 2 years ago

When it comes to losizm/little-sql the error is caused by difference in java version. (deprecation of java method + -Werror)

WojciechMazur commented 2 years ago

Similarly eikek/binny fails due to usage of method missing in Java 8.
Sidenote: open community build picks the lowest version of Java version defined in github workflows, otherwise it defaults to Java 11. Config both of the failing projects due to this issue was overridden.

WojciechMazur commented 2 years ago

Failures observed in @gzoller /scala-reflection are not regressions either. Scala 3.1.3 introduced a bug fix, which prevented access to the protected constructor of case class. Code snippet from this project fails starting at that version and it is correct behavior (however it's not ok that it was introduced in a patch release, next minor would be more suitable):

case class SealedTraitInfo protected(
    name: String, 
    children: Array[RType]
  )

Adding a public apply method in the companion object or making the primary constructor public would fix the problem.

ckipp01 commented 1 year ago

Seeing that we're releasing 3.3.0 and many of the build urls now 404, are we ok just to close this @WojciechMazur?