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

Apply scalaVersion enforcement to Compile related configs #2827

Merged
merged 2 commits into from
Nov 12, 2016

Conversation

eed3si9n
Copy link
Member

@eed3si9n eed3si9n commented Nov 11, 2016

Fixes #2786. Ref #2634.

sbt 0.13.12 added Ivy mediator that enforces scalaOrganization and
scalaVersion for Scala toolchain artifacts.
This turns out to be a bit too aggressive because Ivy configurations
can be used as an independent dependency graph that does not rely on
the scalaVersion used by Compile configuration. Enforcing
scalaVersion in those graphs causes runtime failure.

This change checks if the configuration extends Default, Compile,
Provided, or Optional before enforcing scalaVersion.

/review @dwijnand

@eed3si9n eed3si9n added this to the 0.13.14 milestone Nov 11, 2016
Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

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

Is there any way that that list of config can be made configurable by the build user?

@dwijnand
Copy link
Member

Also I think we should add a little test case, that emulates scalafmt's use case. To avoid this regressing.

@eed3si9n
Copy link
Member Author

I tried adding testing but I couldn't get it to fail without using 2.12, which requires JDK8.

I also tried exposing configurations setting but without a major hack like InlineConfigurationWithExcludes, I don't think we can easily in sbt 0.13.

Fixes sbt#2786. Ref sbt#2634.

sbt 0.13.12 added Ivy mediator that enforces scalaOrganization and
scalaVersion for Scala toolchain artifacts.
This turns out to be a bit too aggressive because Ivy configurations
can be used as an independent dependency graph that does not rely on
the scalaVersion used by Compile configuration. By enforcing
scalaVersion in those graph causes runtime failure.

This change checks if the configuration extends Default, Compile,
Provided, or Optional before enforcing scalaVersion.
@eed3si9n eed3si9n merged commit 85f9189 into sbt:0.13 Nov 12, 2016
@eed3si9n eed3si9n deleted the wip/mediator_fix branch November 12, 2016 01:11
@milessabin
Copy link
Contributor

Many thanks for dealing with this ... my apologies for not being able to find the time to get to it before you did :-(

@eed3si9n
Copy link
Member Author

@milessabin no problemo :)

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.

None yet

3 participants