Ensure vague Scala versions are capped at defaults #3259
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3233
Note: this may potentially be a breaking change.
This changes how Scala version is picked when
major
ormajor.minor
prefixes are passed, rather than the full version tag:-S 3
will now point to the launcher default Scala 3 Next version, rather than whatever is the latest stable thatcoursier
can find upstream-S 3.<current launcher default minor>
will now point to the launcher default Scala 3 Next version-S 2.13
will point to the launcher default Scala 2.13 version (which up till now only affected tests and generated docs)-S 2.12
will now point to the launcher default Scala 2.12 version--cli-user-scala-version
to accomodate for Scala CLI installed asscala
Or, to give examples, with what is currently on sonatype:
-S 3
-S 3
, when--cli-user-scala-version 3.6.0
-S 3.5
For more examples, refer to the test suite cases.
The purpose of this change is to safeguard against future incidents similar to the Scala 3.6.0 mis-release. When a new Scala version is released on sonatype, Scala CLI will no longer pick it up automatically with vague version tags (such as
-S 3
). Of course, any version remains usable when the entire version string is passed (so-S 3.6.1
remains valid for any launcher).The downside of this change is that the meaning of a vague version string will change on
scala-cli
launcher upgrade.