-
Notifications
You must be signed in to change notification settings - Fork 21
not found: type Serializable after Scala 2.13.6 upgrade up to 2.13.7+ #12740
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
Comments
I wonder if |
@som-snytt wow a nice guess, it could be it, I can check it really quick. However in some cases it could be caused by a trait, i.e. check this out (another project where I noticed the same behavior): locationtech/geotrellis@b493b61 |
This is the bell that rang scala/scala#9661 |
miss the podcast ❤️ (the English-language one; I don't speak Russian) |
👋 @SethTisue I miss it too ❤️ |
@som-snytt apparently it turned out to be not that easy to check 🤦 I added classes and they are not failing; only the only one causes failure (link to a diff to get error back). But I think it is a very nice guess (scala/scala#9661), it could be smth related to the loading ordering. That may explain why in some projects / modules package objects are compiling fine and in some are not, and why it's so hard to reproduce. 🤔 |
I was able to reproduce it in Scastie (https://scastie.scala-lang.org/pomadchin/X8YFi5YuT9yUNTp1fpmNEA/1), sadly still not locally; seems to be the fact that is a |
it reproduces for me locally with scala-cli and //> using scala "2.13.10"
package test
package object X extends Serializable { }
object Test {
def main(args: Array[String]): Unit = {
}
} this fails during normal compilation, not even Scaladoc generation |
Ha, yes, fails for me locally with scala-cli as well. |
@SethTisue nice minimal rendition @pomadchin I've forgotten if all inheritance for package objects is deprecated? Not to blame the victim. It may explain why it's not been reported. I fixed |
@som-snytt I think package objects are deprecated and to be removed in general, since the top level expressions are legit in Scala 3.
|
@som-snytt Adriaan wanted that, but we ended up reverting it scala/scala-dev#441 |
Thank-you both, I always forget which parallel universe we happen to find ourselves in. |
Yes. I may have coded it too fast. |
@som-snytt woooot; incredible! I can try to test the PR later on all failing projects to double / triple check it. |
Reproduction steps
I was unable to get a locally reproducible / relatively easy project that fails.
I could not reproduce it locally at all. 😭Thx team with all the help to reproduce it!Scala version: 2.13.7+
SBT and JDK versions independent.
Code:
Scasite: https://scastie.scala-lang.org/pomadchin/X8YFi5YuT9yUNTp1fpmNEA/1
Publish:
$ ./sbt +publishLocal
Steps to try to reproduce locally with the https://github.com/PDAL/java project
I know that it makes this bug / feature report very hard to work with, but mb there is any chance to get some help tracing it?
Any help / comments are really appreciated.
I spent a the whole weekend trying to catch it and was only able ("got lucky") to catch it in a smaller OSS project and reduce failure await times in CI.
Problem
In several projects (https://github.com/PDAL/java, https://github.com/locationtech/geotrellis/) after updating Scala 2.13.6 up to 2.13.7+ I get
not found: type Serializable
error on the package+publish
command invocation, more specifically, on theCompile/doc
stage.The most unclear thing is that it may fail within some specific modules of a project, not in every module of a project, I was unable to catch the real issue / to find a simple reproducible way to catch it.
By experiments, I was able to double check that this behavior is not related to the SBT version and to the JDK version.
Code: https://github.com/PDAL/java/blob/bug/scala-upd/core-scala/src/main/scala/io/pdal/pipeline/package.scala#L19
Diff that triggers the CI error: PDAL/java@f068ac2
CI Error: https://github.com/PDAL/java/actions/runs/4277401013/jobs/7446185708#step:6:201
Workarounds that work for now:
Ref to another project issue where I have the same problem locationtech/geotrellis#3503
The text was updated successfully, but these errors were encountered: