-
Notifications
You must be signed in to change notification settings - Fork 49
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 -Yscala-release
flag
#138
Comments
First I'd like to insist on the fact that -Yscala-release is an experimental feature (hence the use of -Y, the flag will be renamed to -scala-release when it's deemed stable), it shouldn't be used to publish non-experimental artifacts and it certainly shouldn't be used by default in an sbt plugin.
Not in general as mentioned in typelevel/cats#4016 (comment)
I don't have more details than what's in https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html, right now sbt doesn't know anything about the flag, so when you're using |
Thanks for the response :)
I see. It wasn't obvious to me that using the new compiler with
Huh. I see why this is a good idea, but this sounds potentially quite complicated to actually implement in sbt. |
Also to reiterate something mentioned in passing in the doc: even once -scala-release will be considered stable, we make no guarantee that we will forever support every single older version of scala 3, we might drop support for older versions to keep a reasonable maintenance and testing burden (e.g. maybe scala 3.5 will only support -scala-release 3.2 and up). |
It's not exactly the same, if the new code we generate would be compatible with scala 3.0 we can keep generating it under -Yscala-release 3.0, but if we generate code that relies on APIs that only exist in >= 3.1 then we couldn't do that. |
This makes sense 👍
Right, which is why it wasn't obvious to me if typelevel/cats#4016 (comment) applies to |
Yeah that particular pr I linked to wouldn't cause mima issues I believe, sorry for the confusion. |
Actually, does |
Right now I don't think it does but it might although this is controversial, see discussion in scala/scala3#14136 |
Concrete example of why you can't default to -scala-release 3.0 in general: the fix for scala/scala3#11332 is very likely to require a minor version bump (because old compilers wouldn't be able to interpret tasty containing these weird method calls correctly which would break inlining among other things), it seems cats-effect is interested in this feature but it won't be available with an old version passed to -scala-release |
Sure, there are all sorts of reasons why a project may want to set |
This is available in: |
Seems the Scala 3 team is going in a different direction, and this flag won't be available in Scala 3.2. So no point to add support here. |
This is the new flag in Scala 3.1.2-RC1 that enables targeting Scala 3.0 from the Scala 3.1 compiler. One of the exciting things about sbt-typelevel is that we can remotely roll out this feature to several projects :)
I've been thinking about this, and I propose we add a
tlScala3Release
setting to thetypelevel-settings
plugin that defaults to 3.0.@smarter some projects such as fs2 are already being published against Scala 3.1. Is it okay to target them to Scala 3.0 going forward? Otherwise those projects will have to overwrite this setting.
It also seems there's some fiddling required with POM files. @smarter could you clarify what exactly this is? Thanks!
Seems related to:
https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html
The text was updated successfully, but these errors were encountered: