Scala 3 support
Most of the complexity comes from migrating the BodyElementCollectorMacro macro.
Might be tacked with https://github.com/agourlay/cornichon/issues/736
Acceptance criteria:
- cross compiling 2.12, 2.13, 3.x (dropping 2.12?)
- introduce new unit tests for validating that the DSL yields the same
Featureobjects across Scala versions - no performance regression
It seems the dependency on PureConfig with auto derivation is also a problem to tackle during the migration.
It might be possible to drop the macro in Scala 3 by using context functions.
Credits to @yanns for the idea :beers:
Hi there!
I hope you’re doing well.
I’m wondering if there are any plans or progress updates regarding Scala 3 support. Has this task been scheduled or started yet?
Any information you can share would be greatly appreciated.
Thank you!
@mprevel No concrete work on Scala 3 has been started outside of the discussion on this issue.
TBH I have no bandwidth to push this change so it would have be to be driven by external contributors.
The migration plan is more or less:
- Check if all dependencies are available for Scala 3
- Check if the
BodyElementCollectorMacrocan be replaced by context functions OR else rewrite the macro for Scala 3
I am happy to provide guidance with the internals if necessary :)
Hi @agourlay,
I've tried to add support for scala 3.
What I've done:
- update of build.sbt
- migration of pureconfig conf for scala 3
- a few rewrites to be able to share code between versions (common syntax for function parameters, parboiled2 parser fixes, ...)
- moved some files to dedicated scala versions scala-2/ scala-3 so both can compile and have running tests
What is blocking now is the CoreDsl part. I don't think context functions can fit here because the DSL allows this kind of samples:
Scenario("name") {
step1
step2
step3
}
If my understanding is good, these steps cannot be grouped to a List[Step] using context functions.
With a mutable approach and a builder pattern we could probably achieve it but it would break the current DSL.
Scenario("name") {
step(step1)
step(step2)
step(step3)
}
So, if I'm not mistaken, keeping the exact same DSL means we have to use Scala 3 macros. If we switch to context functions instead, it would require changing the DSL.
@mprevel Thank you very much for getting the migration started :clap:
I trust your research regarding context functions, I did not look too deep into it myself.
So, if I'm not mistaken, keeping the exact same DSL means we have to use Scala 3 macros. If we switch to context functions instead, it would require changing the DSL.
You are right, we cannot break the DSL at this point. Which means using Scala 3 macros. Do you have any experience with those?
Thanks for picking this up again!
Fixed in 0.22.0