Skip to content
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

Fix Scala version enforcement #2055

Closed
wants to merge 6 commits into from

Conversation

eed3si9n
Copy link
Contributor

@eed3si9n eed3si9n commented Jun 12, 2021

Fixes #2054 / sbt/sbt#6439

Problem

Currently forceScalaVersionOpt option, which by default is set to true
when a Scala version is present, conflates the notion of overriding the
Scala standard modules (such as scala-library, scala-reflect) and
overriding the cross building full suffix of any libraries.

This ignores the user's specification of dependency such as
"org.typelevel" % "macro-compat_2.13.0-RC2" % "1.1.1"
and substitutes it with "macro-compat_2.13.5" etc.

Side note: Maybe this was convenient feature when Typelevel had its own Scala compiler? Today, it's more common to want to use a Scala plugin with different Scala full suffix (for debugging purpose or because plugin is not available yet) than using third-party compiler implementation.

Solution

Create a new option specifically to override the full suffix, and make it opt-in.
Scala modules should continue to enjoy the Scala version overriding.

Fixes coursier#2054

Problem
-------
Currently `forceScalaVersionOpt` option, which by default is set to true
when a Scala version is present, conflates the notion of overriding the
Scala standard modules (such as scala-library, scala-reflect) and
overriding the cross building full suffix of any libraries.

This ignores the user's specification of dependency such as
`"org.typelevel" % "macro-compat_2.13.0-RC2" % "1.1.1"`
and substitutes it with `"macro-compat_2.13.5"` etc.

Solution
--------
Create a new option specifically to override the full suffix, and make
it opt-in.
Scala modules should continue to enjoy the Scala version overriding.
Copy link
Member

@alexarchambault alexarchambault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @eed3si9n, and sorry for the late review :|

I pushed a few more commits to merge with the current master, and make sure the ResolutionParams hash computation in tests doesn't change in spite of the additional field.

If the CI is green, and if you're ok with it, I'll probably merge from a different branch after rebasing, and merging the "Clean-up" / "Bintray" / "NIT" commits in yours (unless you want to handle that yourself?)

@eed3si9n
Copy link
Contributor Author

eed3si9n commented Jul 6, 2021

If the CI is green, and if you're ok with it, I'll probably merge from a different branch after rebasing, and merging the "Clean-up" / "Bintray" / "NIT" commits in yours

Sounds good to me :)

@alexarchambault
Copy link
Member

Merged via #2104.

@eed3si9n
Copy link
Contributor Author

@alexarchambault Could you release a new version of Coursier with this patch please?

@alexarchambault
Copy link
Member

The release workflow of coursier needs to be fixed… I should have a bit of time for it later this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transitive dependency suffix gets overwritten by the scala version of current subproject
2 participants