brave-planet-28195
10/06/2022, 5:56 PMcs resolve -t org.typelevel:log4cats-slf4j_2.13:2.5.0
for a small library log4cats
it will already show you conflicts among transitive dependencies (and its a single lib, not a group of them). Conflicts resolution is very very important topic for every build tool that is used for Java/Scala project (if project is not Hello world
of cause)....
I'm pretty sure JVM community will be keen on adopting pants v2 if there was any support for conflict resolution strategy. For example doing something like this would be very helpful.
versionReconciliation ++= Seq(
"org.typelevel" %% "cats-core" % "relaxed",
"*" % "*" % "strict"
)
https://www.scala-lang.org/2019/10/17/dependency-management.html
Anyways thank u for great tool! Looking forward for new features (heard that scala_library
is on its way....)ancient-vegetable-10556
10/06/2022, 9:03 PMstrict
— indeed, we use strict
under the hood to implement lockfiles.
Is being able to specify a particular artifact as strict
sufficient for you, or do you need other reconciliation types?
sdo you need anything other thanbrave-planet-28195
10/06/2022, 9:35 PMstrict-include
...coursier resolve ...
for every artifact that I specify in 3rdparty
folderancient-vegetable-10556
10/06/2022, 9:37 PMjvm_artifact
help here?brave-planet-28195
10/06/2022, 9:44 PMfs2
, tapir
, http4s
, fs2-kafka
. cats
, neotypes
That creates a total mess if run in strict
mode - this is general problem on conflicts resolution on JVM world - not related to pants.
The way to workaround this problem is to provide sane excludes
for jvm artifacts and compose them with proper versionspants
to show me the actual conflicts....ancient-vegetable-10556
10/06/2022, 9:45 PMbrave-planet-28195
10/06/2022, 9:46 PMcats-core
is real pain... it causes conflicts all over the place. So what i do is this:
jvm_artifact(
name="cats-effect",
group="org.typelevel",
artifact="cats-effect_2.13",
version="3.3.14",
packages=["cats.effect.**"],
excludes=[
"org.typelevel:cats-core_2.13"
]
)
I exclude cats-core from cats-effectjvm_artifact(
name="cats-core",
group="org.typelevel",
artifact="cats-core_2.13",
version="2.8.0",
packages=["cats.**"],
)
ancient-vegetable-10556
10/06/2022, 9:50 PMbrave-planet-28195
10/06/2022, 10:02 PMsilently
. Considering the fact that conflicts will happen in transitive dependencies - developer can see errors in runtime ClassNotFound
. No compile time error.... nothing
2. That's why conflict resolution
strategy is critical for JVM. For example sbt comes with several conflict resolution strategies. I understand that pants v2 is work in progress and what was already done is great. But for JVM community do adopt tool quicker it would be great to have at list 1 conflict resolution strategy (Strict). That would fail during check
goal if there are conflicts and display coursier transitive dependencies treeancient-vegetable-10556
10/06/2022, 10:03 PMbrave-planet-28195
10/06/2022, 10:11 PMcats-core
(version 2.8,0) - that will create a dependency conflictcats-effect
has transitive dependency to cats-core 2.7.0ancient-vegetable-10556
10/06/2022, 10:14 PMbrave-planet-28195
10/06/2022, 10:14 PMancient-vegetable-10556
10/06/2022, 10:15 PMbrave-planet-28195
10/06/2022, 10:15 PMjava.lang.NoClassDefFoundError: cats/kernel/Semigroup
Would you be willing to commit the broken configuration to a branch? That way I can get an issue written upI can create and issue in pants to further discuss this....
ancient-vegetable-10556
10/06/2022, 10:16 PMbrave-planet-28195
10/06/2022, 10:16 PMancient-vegetable-10556
10/06/2022, 10:16 PMbrave-planet-28195
10/06/2022, 10:17 PMancient-vegetable-10556
10/06/2022, 10:17 PMbrave-planet-28195
10/06/2022, 10:20 PMancient-vegetable-10556
10/06/2022, 10:20 PMbrave-planet-28195
10/06/2022, 10:23 PMancient-vegetable-10556
10/06/2022, 10:23 PMbrave-planet-28195
10/06/2022, 11:45 PMancient-vegetable-10556
10/07/2022, 3:02 PM