-
Notifications
You must be signed in to change notification settings - Fork 82
Migration to Scala 3 #4603
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
Migration to Scala 3 #4603
Conversation
String ++ String was converted into JArray(List(_, _))
…licit result types for implicits, required parenthesis etc
…comprehenison. It would introduce withFilter calls allowing for safer parsing.
Backported scala 2 source compatible changes in #4789 |
@WojciechMazur @fanf is this something I can help with? I tried to checkout this branch and make it compile, I had several compilation errors like
(while running |
Closing this draft, this is handled elsewhere (in several elsewhere). Thanks again for the help, without it, we would have been able to bootstrap that. |
oh wow @etorreborre - sorry, I totally missed your almost-one-year old comment. I think it's OK, but @mbaechler might ask you questions at some points if he discovers problems. |
@fanf no worries. @mbaechler don't hesitate to come back to me. |
This PR contains a mostly complete migration from Scala 2.13 to Scala 3 (3.2.1 current latest)
General status:
com.normation.rudder.rest.TestRestFromFileDef
com.normation.rudder.services.policies.write.WriteSystemTechniquesTest
com.normation.rudder.services.policies.write.WriteSystemTechniques500Test
During the migration we've spotted some bugs in compiler. Most of them were mitigated to allow for compilation. Bug fixes for them would probably be shipped in either 3.2.2 or 3.3:
The most notable changes:
fastparse
is not yet published for Scala 3. It is using macros to implement parsers to all definitions of parsers were move to temporalutils-parser
andrudder-parsers
submodules. AFAIK most on the work in terms of fastparse for Scala3 is mostly done (Scala 3 support com-lihaoyi/fastparse#262), so probably we should await a new release of it soon. At that point temporal modules can be removedsealerate
library is Scala2 only - it's usages were replaced with redefinition ofsealed traits
withenums
. This change can be potentially replaced with manual enumeration of possible cases or using a macro/typeclass derivation.specs2
- AFAIK Specs 4.x are having some problems with Scala 3 due to the changes in implicits resolution and syntax changes. I would recommend migration to Specs2 5.x whenever possible - it is only published for Scala 3Chimney
is not yet published for Scala 3. As a replacementDucktape
was used.silencer
plugin is not published for Scala 3. Since Scala 2.13 it can be safely removed withscala.annotation.nowarn
All usages of nowarn were replaced with this annotation, however probably most of its usages can probably be removedDefaultFormater
it should have the same semantics.final
modifier used on objects were removed. All objects are by definition final. Eachfinal object
was generating a warning and though made compilation logs unreadable. This change can be safely cherry picked to Scala 2.13 buildBecouse of the large amount of changes I recommend reviewing changes based on the commits and not total amount of changes. It would be easier that way. I've tried to group most of the closely related changes together.