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

Workaround Coursier/Ivy dependency resolution bug #2113

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

ppkarwasz
Copy link
Contributor

Workaround a Coursier/Ivy dependency resolution bug that affects log4j-slf4j-impl and log4j-mongodb3.

This bug also affects popular sites like MvnRepository (cf. log4j-mongodb3:2.22.0).

Closes #2065

@vy
Copy link
Member

vy commented Dec 20, 2023

I have doubts about this fix @ppkarwasz. It is not even reported to the source AFAIK. I am also curious how can we be certain that our solution is exhaustive?

Maybe dumb, but an alternative I can't stop thinking: Why don't we document the issue and its for Coursier/Ivy users?

@ppkarwasz
Copy link
Contributor Author

To test this solution I used a micro SBT project with build.sbt file:

val scala3Version = "3.3.1"

lazy val root = project
  .in(file("."))
  .settings(
    name := "Scala 3 Project Template",
    version := "0.1.0-SNAPSHOT",

    scalaVersion := scala3Version,

    libraryDependencies ++= Seq(
        "org.apache.logging.log4j" % "log4j-slf4j-impl" % "2.23.0-SNAPSHOT",
        "org.apache.logging.log4j" % "log4j-mongodb3" % "2.23.0-SNAPSHOT"),
    resolvers += Resolver.mavenLocal
  )

With SBT 1.9.8 I can confirm that this workaround works. Of course, the issue must be reported to Coursier/Ivy. AFAIK no-one did it and I'll do it myself shortly.

@vy
Copy link
Member

vy commented Dec 21, 2023

To test this solution I used...

@ppkarwasz, I wasn't questioning whether your solution fixes the user-reported problem or not. I have no doubts you did your due diligence for testing. My question is about coverage: How can we know if we covered all such Coursier/Ivy misbehaviour? Or are we just patching a single hole among many?

@ppkarwasz
Copy link
Contributor Author

ppkarwasz commented Dec 21, 2023

Since there are a lot of dependency resolution libraries out there, we are probably working around one bug among many.
My reason behind supplying this patch is that MvnRepository.com (the first search result for log4j-slf4j-impl) also exhibits signs of this problem (BTW: I also contacted them and asked to fix it on their website) and the workaround does not cost us anything.

I submitted a corresponding bug in Coursier: coursier/coursier#2906

Workaround a Coursier/Ivy dependency resolution bug that affects
`log4j-slf4j-impl` and `log4j-mongodb3`.

This bug also affects popular sites like MvnRepository (cf.
[`log4j-mongodb3:2.22.0`](https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-mongodb3/2.22.0)).

Closes apache#2065
@ppkarwasz ppkarwasz merged commit ee5ac6b into apache:2.x Dec 22, 2023
6 checks passed
@ppkarwasz ppkarwasz deleted the coursier-bug branch December 22, 2023 06:59
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.

log4j-slf4j-impl 2.22.0 appears to depend on slf4j-api 2
2 participants