Skip to content

sbt-dotty does not load on sbt 1.3.0-SNAPSHOT #5671

Closed

Description

@eed3si9n

steps

  1. Use addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.2.6") with sbt 1.3.0-SNAPSHOT.

problem

[error] java.lang.RuntimeException: The sbt-dotty plugin cannot work with this version of sbt (1.3.0-SNAPSHOT), sbt >= 1.1.5 is required.

expectation

sbt-dotty works with any sbt 1.x >= 1.1.5.

notes

https://github.com/lampepfl/dotty/blob/bcccb2f3ce83bb6bf12559c7ae018e0f12042d32/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala#L92-L104

NonReleaseV requires z to be > 0.

Activity

  1. smarter commented on Jan 3, 2019

    @smarter
    Member

    This is very weird, dotty itself and https://github.com/lampepfl/dotty-example-project use sbt 1.2.x without issues. In fact, I just tried changing the version that dotty-example-project uses to 1.2.8 and I did not encounter the error you're reporting, can you share the project ?

    In there sbtMinor is hardcoded to 1.

    It's not, if sbtMinor > 1 then the error is not displayed, so 1.2.x is fine.

  2. changed the title [-]sbt-dotty does not load on sbt 1.2.x[/-] [+]sbt-dotty does not load on sbt 1.3.0-SNAPSHOT[/+] on Jan 3, 2019
  3. eed3si9n commented on Jan 3, 2019

    @eed3si9n
    MemberAuthor

    Where I actually saw this was in scripted test. I figured it was anything above sbt 1.1.x, but maybe the problem is with -SNAPSHOT?

  4. smarter commented on Jan 3, 2019

    @smarter
    Member

    ah indeed, looks like sbtFullVersion will return None for 1.3.0-SNAPSHOT, the error should not be emitted if we couldn't parse the version number.

  5. self-assigned this
    on Jan 3, 2019
  6. smarter commented on Jan 3, 2019

    @smarter
    Member

    By the way it'd be nice if sbt provided something like sbtFullVersion so that I wouldn't have to implement it myself badly :).

  7. smarter commented on Jan 3, 2019

    @smarter
    Member

    Or maybe just a high-level mechanism to enforce that this plugin requires a particular minimum version of sbt.

  8. eed3si9n commented on Jan 3, 2019

    @eed3si9n
    MemberAuthor

    I think https://github.com/sbt/librarymanagement/blob/develop/core/src/main/scala/sbt/librarymanagement/VersionNumber.scala has semver check.

    scala> import sbt.librarymanagement.{ VersionNumber, SemanticSelector }
    import sbt.librarymanagement.{VersionNumber, SemanticSelector}
    
    scala> VersionNumber("2.12.5").matchesSemVer(SemanticSelector(">=2.12"))
    res1: Boolean = true
  9. added a commit that references this issue on Jan 3, 2019
  10. eed3si9n commented on Jan 3, 2019

    @eed3si9n
    MemberAuthor
    scala> import sbt.librarymanagement.{ VersionNumber, SemanticSelector }
    import sbt.librarymanagement.{VersionNumber, SemanticSelector}
    
    scala> VersionNumber("1.3.0-SNAPSHOT").matchesSemVer(SemanticSelector(">=1.1.5"))
    res0: Boolean = true
    
    scala> VersionNumber("1.1.0").matchesSemVer(SemanticSelector(">=1.1.5"))
    res1: Boolean = false
  11. changhe626 commented on Jan 21, 2019

    @changhe626
  12. added 9 commits that reference this issue on Feb 2, 2019
    e13b53d
    4f6a486
    83ad987
    e6e34ef
    e956ce4
    7d8d21c
    eaead4f
    c3cd8fa
    90b3820
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions