-
Notifications
You must be signed in to change notification settings - Fork 81
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
Scala3 version depends on 2.13 artifacts #545
Comments
Thank you for reporting! This is working as expected. The mdoc-cli module does not compile against Scala 3. You should be able to pick one of |
thanks, solved this on my own in datadog4s/datadog4s#422 |
Hi, so what is the general solution if mdoc depends on I just encountered this problem with I was able to adapt @tomasherman's solution (see my solution below), but I feel that I am just lucky that the way I use mdoc does not need lazy val docs = project
.in(file("docs-project"))
.dependsOn(core)
.enablePlugins(MdocPlugin)
.settings(
// mdoc (transitively) depends on sourcecode_2.13,
// which conflicts with core's dependency on sourcecode_3
libraryDependencies := libraryDependencies.value.map(_ excludeAll (
ExclusionRule(organization = "com.lihaoyi", name = "sourcecode_2.13"),
)),
) |
Yeah, it's problematic, but your solution is the only one I can think of now. While I'm going to update metaconfig to scala-3 only version in #563, I can see it's not the only source of 2.13: tree brought by metaconfig, solvable ├─ org.scalameta:mdoc-cli_2.13:2.2.23
│ ├─ com.geirsson:metaconfig-typesafe-config_2.13:0.9.10
│ │ ├─ com.geirsson:metaconfig-core_2.13:0.9.10
│ │ │ ├─ com.lihaoyi:pprint_2.13:0.5.9
│ │ │ │ ├─ com.lihaoyi:fansi_2.13:0.2.9
│ │ │ │ │ └─ com.lihaoyi:sourcecode_2.13:0.2.1 -> 0.2.7
│ │ │ │ └─ com.lihaoyi:sourcecode_2.13:0.2.1 -> 0.2.7
│ │ │ ├─ org.scala-lang:scala-library:2.13.1 -> 2.13.6
│ │ │ ├─ org.scala-lang.modules:scala-collection-compat_2.13:2.1.2 -> 2.4.4 (possible incompatibility)
│ │ │ │ └─ org.scala-lang:scala-library:2.13.5 -> 2.13.6
│ │ │ └─ org.typelevel:paiges-core_2.13:0.3.0
│ │ │ └─ org.scala-lang:scala-library:2.13.0 -> 2.13.6
│ │ └─ org.scala-lang:scala-library:2.13.1 -> 2.13.6 tree brought by scalameta │ └─ org.scalameta:scalameta_2.13:4.4.27
│ ├─ org.scala-lang:scala-library:2.13.6
│ ├─ org.scala-lang:scalap:2.13.6
│ │ └─ org.scala-lang:scala-compiler:2.13.6
│ │ ├─ org.scala-lang:scala-library:2.13.6
│ │ └─ org.scala-lang:scala-reflect:2.13.6
│ │ └─ org.scala-lang:scala-library:2.13.6
│ └─ org.scalameta:parsers_2.13:4.4.27
│ ├─ org.scala-lang:scala-library:2.13.6
│ └─ org.scalameta:trees_2.13:4.4.27
│ ├─ org.scala-lang:scala-library:2.13.6
│ ├─ org.scalameta:common_2.13:4.4.27
│ │ ├─ com.lihaoyi:sourcecode_2.13:0.2.7
│ │ ├─ com.thesamet.scalapb:scalapb-runtime_2.13:0.11.4
│ │ │ ├─ com.thesamet.scalapb:lenses_2.13:0.11.4
│ │ │ │ ├─ org.scala-lang:scala-library:2.13.6
│ │ │ │ └─ org.scala-lang.modules:scala-collection-compat_2.13:2.4.4
│ │ │ │ └─ org.scala-lang:scala-library:2.13.5 -> 2.13.6
│ │ │ ├─ org.scala-lang:scala-library:2.13.6
│ │ │ └─ org.scala-lang.modules:scala-collection-compat_2.13:2.4.4
│ │ │ └─ org.scala-lang:scala-library:2.13.5 -> 2.13.6
│ │ └─ org.scala-lang:scala-library:2.13.6
│ └─ org.scalameta:fastparse-v2_2.13:2.3.1
│ ├─ com.lihaoyi:geny_2.13:0.6.5
│ └─ com.lihaoyi:sourcecode_2.13:0.2.3 -> 0.2.7
│ │ │ └─ org.scala-lang:scala-library:2.13.6
│ │ │ └─ org.scala-lang:scala-library:2.13.6
│ │ └─ org.scala-lang:scala-library:2.13.6 The latter is harder to solve because of macro annotations in scalameta. And apparently fastparse, which I didn't think about before. Unfortunately it is possible to end up in a situation where this 3/2.13 sandwich breaks. It shouldn't be very likely, unless you're doing a lot of work within the com-lihaoyi libraries.. |
Thanks for commenting. I guess I should be fine. Are you suggesting that meta-programming in Scala 3 is not as powerful as macro annotations? |
The macro annotations' abilityb to synthesize members is the thing that Scala 3 doesn't support: https://contributors.scala-lang.org/t/annotation-macros/1211 I can't really speak to the exact comparison in terms of power between whitebox/blackbox macros in Scala 2 and Scala 3 metaprogramming facilities, but macro annotations are a particular problem. |
Hi,
it seems that mdoc_3 depends on org.scalameta : mdoc-cli_2.13. This is causing builds to fail because:
Am i doing something wrong or is this an error on mdoc side? This error only shows up for sbt
1.5.5
, for1.5.4
it works well, but im not sure it's correct.Thanks
The text was updated successfully, but these errors were encountered: