Strange errors compiling almond with scala 3.1.0

I have reported strange errors with Scala 3.1.0 that happen when building Almond here:

My fork, https://github.com/NicolasRouquette/almond, allows me to build for either Scala 3.0.1 or 3.1.0.
Unfortunately, I lack sufficient knowledge about Mill to support either configuration.
Fortunately, all it takes is changing the value of the scala3 variable here:
https://github.com/NicolasRouquette/almond/blob/master/project/deps.sc#L68

With scala3 = "3.0.1", almond builds cleanly with this:

on unix: ./mill -i jupyter
on windows: .\mill.bat -i jupyter

With scala3 = "3.1.0", I get strange errors like this:

🕙[ 15:04:16 ] ❯ .\mill.bat -i jupyter 3.1.0
[109/396] shared.channels[3.1.0].compile
[info] compiling 11 Scala sources to C:\opt\local\github.me@com\almond\out\shared\channels\3.1.0\compile\dest\classes ...
[error] error while loading package, class file 'C:\opt\local\github.me@com\almond\out\shared\logger\3.1.0\compile\dest\classes\almond\logger\package.class' is broken
[error] (class scala.tools.tasty.UnpickleException/TASTy signature has wrong version.
[error]  expected: {majorVersion: 28, minorVersion: 0}
[error]  found   : {majorVersion: 28, minorVersion: 1}
[error]
[error] This TASTy file was produced by a more recent, forwards incompatible release.
[error] To read this TASTy file, please upgrade your tooling.
[error] The TASTy file was produced by Scala 3.1.0.)
[error] error while loading LoggerContext, class file 'C:\opt\local\github.me@com\almond\out\shared\logger\3.1.0\compile\dest\classes\almond\logger\LoggerContext.class' is broken
[error] (class scala.tools.tasty.UnpickleException/TASTy signature has wrong version.
[error]  expected: {majorVersion: 28, minorVersion: 0}
[error]  found   : {majorVersion: 28, minorVersion: 1}
[error]
[error] This TASTy file was produced by a more recent, forwards incompatible release.
[error] To read this TASTy file, please upgrade your tooling.
[error] The TASTy file was produced by Scala 3.1.0.)
[error] C:/opt/local/github.me@com/almond/modules/shared/channels/src/main/scala/almond/channels/zeromq/ZeromqConnection.scala:27:27: almond.logger.LoggerContext does not take parameters
[error]   private val log = logCtx(getClass)
[error]                           ^
[error] C:/opt/local/github.me@com/almond/modules/shared/channels/src/main/scala/almond/channels/zeromq/ZeromqSocketImpl.scala:32:27: almond.logger.LoggerContext does not take parameters
[error]   private val log = logCtx(getClass)
[error]                           ^
[error] four errors found
1 targets failed
shared.channels[3.1.0].compile Compilation failed

There are two different kinds of errors that I need help with:

  1. What does this mean?

It is unfortunately beyond my knowledge of mill to confirm how the source files were compiled;
however, the settings in project/deps.sc restricted the versions to 3.1.0 and 2.13.6.
How come then I get this error below?

[info] compiling 11 Scala sources to C:\opt\local\github.me@com\almond\out\shared\channels\3.1.0\compile\dest\classes ...
[error] error while loading package, class file 'C:\opt\local\github.me@com\almond\out\shared\logger\3.1.0\compile\dest\classes\almond\logger\package.class' is broken
[error] (class scala.tools.tasty.UnpickleException/TASTy signature has wrong version.
[error]  expected: {majorVersion: 28, minorVersion: 0}
[error]  found   : {majorVersion: 28, minorVersion: 1}
[error]
[error] This TASTy file was produced by a more recent, forwards incompatible release.
[error] To read this TASTy file, please upgrade your tooling.
[error] The TASTy file was produced by Scala 3.1.0.)
  1. Apply-related errors.

Can someone explain why the following source code compiles cleanly in 3.0.1 but not in 3.1.0?

final class ZeromqConnection(
  params: ConnectionParameters,
  bind: Boolean,
  identityOpt: Option[String],
  threads: ZeromqThreads,
  logCtx: LoggerContext
) extends Connection {

  import ZeromqConnection._

  private val log = logCtx(getClass)

Is there a 3.0 to 3.1 migration doc that explains the error in this code or is there something else going on?

  • Nicolas.

Don’t know if you have done this, but try to clean the project and recompile from scratch.
Do a “./mill clean” first. See Introduction to Mill :: Mill