-
-
Notifications
You must be signed in to change notification settings - Fork 372
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
Scala 3 without Scala 2.13 toolchain #1383
Conversation
unapply is generated differently in Scala 3 creating an invinite loop Replaced the call to unapply to a manual implementation
uPickle 3 doesn't have a version that supports Scala 3.1, so I'm dropping it's support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not that intimate with the Ammonite code base, so I just bikeshedded a bit below. Otherwise, this looks reasonable to me.
@alexarchambault @lihaoyi Can I have another review? |
fastparse doesn't support it anymore
Some modules are cross-compiled to only one Scala 3 version which needs to be the oldest Scala 3 version, otherwise we can't make other modules depend on it. So we run tests by passing the binary version and let mill choose the last available Scala version that matches
This seems to be a bug in mill which doesn't allow to mix modules with different Scala 3 versions. Adding a workaround in the build by overriding a ScalaModule target
Looks reasonable to me. If the test suite passes that gives us confidence that nothing broke |
-350 lines of code is also very nice, given how gnarly a lot of the deleted code is |
Motivation
Until now Ammonite for Scala 3 was compiled using a mix of the Scala 2.13 and the Scala 3 compiler.
This was great since it allowed us to have Ammonite on Scala 3 before
fastparse
,mainargs
and other libraries were even supported on Scala 3, or they were not on par with their Scala 2.13 counterpart.Now that the ecosystem has caught up with Scala 3, we can avoid using Scala 2.13 and do everything with Scala 3.
This has the benefit that now all the classpath contains only Scala 3 libraries and we can finally invoke Scala 3 macros in the included libraries like
upickle
.Also, the build gets much simpler since we don't have to do tricks to swap dependencies at runtime and manually remove transitive dependencies.
The only dependency that still is on Scala 2.13 is scalameta
common
, for which we still force the Scala 3 version of itssourcecode
dependency to avoid double dependencies at runtime.uPickle macros on Scala 3
Breaking changes
-cross
naming convention anymore but are just like Scala 2 artifacts except for the_3
or_3.x.y
suffixammonite.util.Bind
now depends on typename instead of scala-reflect (which doesn't have a Scala 3 counterpartscala-java8-compat
updated to1.0.2
mainargs
updated to0.5.4
requests
updated to0.8.0
interp.api.APIHolder.value
is nowfinal
typeOf
removed from Scala 3 API (was not supported already)mainargs.Leftover
Pull request: #1383
Fixes: #1250