Repository navigation
Conversation
|
Tick the box to add this pull request to the merge queue (same as
|
|
Hi. What is the motivation for this change? With sbt-updates installed globally, bumping minimal supported sbt version is a big deal. |
|
The motivation is to move the sbt 2 plugin to Scala 3.9 LTS as its long-term compiler baseline, with sbt 2.1 as the corresponding minimum. This follows eed3si9n’s reasoning about a stable foundation after the sbt 2.1 release, rather than addressing a dependency-update feature that requires sbt 2.1. I agree that global installation makes the compatibility impact particularly important: updating the global plugin would stop it working with sbt 2.0 builds. That is a real trade-off, not something the LTS rationale eliminates. The sbt 1 plugin remains separately cross-built. |
|
Closing, as there seems to be no compelling reasons to use scala 3.9 dropping sbt 2.0 compatibility. |
|
human: The idea is that the sbt plugin ecosystem starts targeting sbt 2.1.0 / Scala 3.9.0 as baseline from now on. Reason is because Scala 3.9 is a LTS and will receives fixes for many years. But if we all would agree to already use sbt 2.1.0 and Scala 3.9 as the baseline for sbt plugins now, that would mean we would get scala fixes also for sbt plugins for many years to come and without requring applications bumping from 2.0 to 2.1 in the future avoiding any burden on application developers. Why do I think that make sense or why do I think that should be at least considered by the sbt ecosystem and why I came up with that whole initiative: When we do that now, coordinated, we can avoid mess and wild west in the future. For enterprises using Scala and sbt plugins being able to rely in stable plugins, stable code is very important. I get contacted by companies asking "why does this break", "why is sbt complaining", every now and then. companies that run 1000+ microservcies in scala or copanpies that run hundrets of on-prem scala applications at their customer locations. Not every developer of that companies is knee deep into sbt and scala to fully understand the problems, and then complain about "why is sbt and scala breaking again just because I upgraded a sbt plugin"? For me my guts feelings just tells me its much better if the majority of the scala plugins already target 2.1.0 / Scala 3.9.0 now already for the upcoming years to avoid mess later on, where we have to ask maintainers (and hope they haven't gone on holiday) to please up- or downgrade a plugin's sbt/scala target again because its last release that contained an important security fix (sbt2ssh2shell4rootaccess) causes incompatibilities with the rest of the sbt ecosystem. Also, libraries and plugins targeting 3.9 will not be asked by scala steward to upgrade to scala.next as scala steward will only suggest to bump to the next scala lts in a few years. |
|
And also sbt 2.1.0 release notes (https://github.com/sbt/sbt/releases/tag/v2.1.0) say:
|
|
Hi @mkurz, thank you for the write-up. I re-opened the PR as you have a point here. Although, I'm still not sure if this trade-off is worth it, I need to think a bit about it. For a regular plugin that is typically added as a part of the build it would be almost a no-brainer. For a plugin, that in my opinion should be installed globally, it is a bit more complicated. |
Summary
Local verification uses a separate full checkout because the existing JGit dependency does not recognize linked worktrees. Original checkout is untouched. The Scala 3 compatibility shim uses public sbt.librarymanagement.CredentialUtils instead of the removed internal IvyCredentials helper; the Scala 2 credential implementation is unchanged.
The Scala 3.9-built plugin requires sbt 2.1 or newer; the sbt 1 artifact remains separately cross-built.
Verification
sbt -batch "set every scriptedParallelInstances := 1" "scalafmtSbt" "scalafmtAll": passed on Java 17.sbt -batch "set every scriptedParallelInstances := 1" "project sbt-updates-2_x" "set Compile / scalacOptions := (Compile / scalacOptions).value.filterNot(o => o.startsWith(\"-Wconf:\") || Set(\"-Werror\", \"-Xfatal-warnings\", \"-Wwarning\").contains(o)) ++ Seq(\"-rewrite\", \"-source\", \"3.8-migration\")" "clean" "compile": passed on Java 17.sbt -batch "set every scriptedParallelInstances := 1" "sbt-updates-1_x/compile" "sbt-updates-2_x/compile" "sbt-updates-1_x/test" "sbt-updates-2_x/test" "sbt-updates-1_latest/scripted" "sbt-updates-2_1_0/scripted": passed on Java 17.References