Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixes match error when using withDottyCompat #352

Merged
merged 1 commit into from
Dec 19, 2020

Conversation

eed3si9n
Copy link
Member

@eed3si9n eed3si9n commented Dec 19, 2020

Fixes sbt/sbt#6210

scodec-bits is published with pvp versionScheme (nice), this means that we should just evaluate the version portion for pvp-ness, but I was using guessSecondSegment that checks for Scala suffix. That's mistake 1.

guessSecondSegment assumes that the Scala suffix uses the given ScalaModuleInfo, but with 2.13-3 sandwich we can't assume this. In the reported case, Scala module is 3.0.0-M3 but scodec-bits uses 2.13. So that's mistake 2.

This attempts to correct both the mistakes.

  1. Instead of guessSecondSegment, this adds a simpler evalPvp function.
  2. guessSecondSegment just looks for _2. or _3 and ignores the Scala module.

Fixes sbt/sbt#6210

scodec-bits is published with pvp versionScheme (nice), this means that
we should just evaluate the version portion for pvp-ness, but I was
using `guessSecondSegment` that checks for Scala suffix. That's mistake
1.

`guessSecondSegment` assumes that the Scala suffix uses the given
ScalaModuleInfo, but with 2.13-3 sandwich we can't assume this.
In the reported case, Scala module is 3.0.0-M3 but scodec-bits uses
2.13. So that's mistake 2.

This attempts to correct both the mistakes.
1. Instead of `guessSecondSegment`, this adds a simpler `evalPvp`
function.
2. `guessSecondSegment` just looks for `_2.` or `_3` and ignores the
Scala module.
@eed3si9n
Copy link
Member Author

Locally confirmed that this will fix the actual bug:

sbt:sbt-hello> compile
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] compiling 1 Scala source to /private/tmp/sbt-hello/target/scala-3.0.0-M3/classes ...

@eed3si9n eed3si9n merged commit 7547f67 into sbt:develop Dec 19, 2020
@eed3si9n eed3si9n deleted the wip/match_error branch December 19, 2020 22:32
eed3si9n added a commit to eed3si9n/librarymanagement that referenced this pull request Dec 20, 2020
Follow-up on sbt#352
@eed3si9n eed3si9n mentioned this pull request Dec 20, 2020
eed3si9n added a commit to eed3si9n/librarymanagement that referenced this pull request Dec 20, 2020
Follow-up on sbt#352
@eed3si9n eed3si9n mentioned this pull request Dec 20, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MatchError in EvictionWarning when using withDottyCompat
1 participant