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

Support for scala 3.1 #895

Closed
NicolasRouquette opened this issue Nov 13, 2021 · 2 comments
Closed

Support for scala 3.1 #895

NicolasRouquette opened this issue Nov 13, 2021 · 2 comments

Comments

@NicolasRouquette
Copy link

Although one can build almond with scala 3.0.1, trying to update the mill files to build with scala 3.1.0 leads to several problems.

First, due to the binary incompatibility between scala 3.1.x and scala 3.0.x, we cannot include both versions of scala3, we have to choose one or the other.

Second, if we include scala 3.1.0, then we cannot cross-build with scala 2.13 and 2.12.; in that case, we can only use scala 3.1.0 and scala 2.13.

Third, in scala 3.1, macros require using the @experimental annotation; this affects the almond Logger that uses logging macros.

Fourth, minor nitpick w.r.t. folks who are trying to build almond on windows; some paths need to be adjusted according to the OS.

Finally, even after resolving all the above (see for example my fork: https://github.com/NicolasRouquette/almond), there are errors that leave me clueless about what is going on:

🕙[ 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

I am submitting a PR with all the above changes, not expecting it to be merged but to document the problems that I've ran into and what I tried to fix them.

@hmf
Copy link
Contributor

hmf commented Mar 17, 2022

See #918

@alexarchambault
Copy link
Member

Should be fixed by #932 (tweaked Scala 3 support) and #942 (update to Scala 3.1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants