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

Unable to depend on org.apache.pulsar:pulsar-client:4.0.1 #1313

Open
shs96c opened this issue Jan 17, 2025 · 1 comment
Open

Unable to depend on org.apache.pulsar:pulsar-client:4.0.1 #1313

shs96c opened this issue Jan 17, 2025 · 1 comment

Comments

@shs96c
Copy link
Collaborator

shs96c commented Jan 17, 2025

When using the coursier resolver, depending on the target generated by the artifact org.apache.pulsar:pulsar-client:4.0.1 causes builds to fail with:

ERROR: /private/var/tmp/_bazel_shs/ba5e5ef8767214bd9e0ee1b56f35c5cc/external/_main~maven~foo/BUILD:160:11: in deps attribute of jvm_import rule @@_main~maven~foo//:org_apache_pulsar_bouncy_castle_bc_pkg: rule '@@_main~maven~foo//:org_bouncycastle_bcprov_ext_jdk18on' does not exist
ERROR: /private/var/tmp/_bazel_shs/ba5e5ef8767214bd9e0ee1b56f35c5cc/external/_main~maven~foo/BUILD:160:11: Analysis of target '@@_main~maven~foo//:org_apache_pulsar_bouncy_castle_bc_pkg' failed

Inspecting the dependency tree using Maven, it's clear that the dependency is added like so:

    <dependency>
      <groupId>org.apache.pulsar</groupId>
      <artifactId>bouncy-castle-bc</artifactId>
      <version>4.0.1</version>
      <classifier>pkg</classifier>
      <scope>compile</scope>
    </dependency>

The interesting thing here is the classifier is pkg

To reproduce:

maven.install(
    name = "foo",
    lock_file = "//:foo_install.json",
    artifacts = [
        "org.apache.pulsar:pulsar-client:4.0.1",
    ],
)

Followed by a pin and a bazel build @foo//:org_apache_pulsar_pulsar_client

@shs96c
Copy link
Collaborator Author

shs96c commented Jan 17, 2025

Looks like the pkg thing is leading us in the wrong direction. The actual dep that's at fault is org.apache.pulsar:bouncy-castle-bc:4.0.1.

Running coursier fetch "org.apache.pulsar:bouncy-castle-bc:4.0.1" --artifact-type "jar,json,aar,bundle,eclipse-plugin,exe,orbit,test-jar,hk2-jar,maven-plugin,scala-jar,dylib,so,dll,pom,src,doc" --verbose --no-default --json-output-file "dep-tree.json" --checksum "SHA-1,MD5" --repository 'https://repo1.maven.org/maven2' shows the problem: "org.bouncycastle:bcprov-ext-jdk18on:1.78.1" is listed as a direct dependency, but there's no matching item in the dependencies list

{
  "conflict_resolution": {},
  "dependencies": [
    {
      "coord": "org.apache.pulsar:bouncy-castle-bc:4.0.1",
      "file": "/Users/shs/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/pulsar/bouncy-castle-bc/4.0.1/bouncy-castle-bc-4.0.1.jar",
      "directDependencies": [
        "org.bouncycastle:bcpkix-jdk18on:1.78.1",
        "org.bouncycastle:bcprov-ext-jdk18on:1.78.1"
      ],
      "dependencies": [
        "org.bouncycastle:bcpkix-jdk18on:1.78.1",
        "org.bouncycastle:bcprov-ext-jdk18on:1.78.1",
        "org.bouncycastle:bcprov-jdk18on:1.78.1",
        "org.bouncycastle:bcprov-jdk18on:jar:1.78.1",
        "org.bouncycastle:bcutil-jdk18on:jar:1.78.1"
      ]
    },
    {
      "coord": "org.bouncycastle:bcpkix-jdk18on:1.78.1",
      "file": "/Users/shs/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/bouncycastle/bcpkix-jdk18on/1.78.1/bcpkix-jdk18on-1.78.1.jar",
      "directDependencies": [
        "org.bouncycastle:bcprov-jdk18on:jar:1.78.1",
        "org.bouncycastle:bcutil-jdk18on:jar:1.78.1"
      ],
      "dependencies": [
        "org.bouncycastle:bcprov-jdk18on:jar:1.78.1",
        "org.bouncycastle:bcutil-jdk18on:jar:1.78.1"
      ]
    },
    {
      "coord": "org.bouncycastle:bcprov-jdk18on:1.78.1",
      "file": "/Users/shs/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk18on/1.78.1/bcprov-jdk18on-1.78.1.jar",
      "directDependencies": [],
      "dependencies": []
    },
    {
      "coord": "org.bouncycastle:bcprov-jdk18on:jar:1.78.1",
      "file": "/Users/shs/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk18on/1.78.1/bcprov-jdk18on-1.78.1.jar",
      "directDependencies": [],
      "dependencies": []
    },
    {
      "coord": "org.bouncycastle:bcutil-jdk18on:jar:1.78.1",
      "file": "/Users/shs/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/bouncycastle/bcutil-jdk18on/1.78.1/bcutil-jdk18on-1.78.1.jar",
      "directDependencies": [
        "org.bouncycastle:bcprov-jdk18on:jar:1.78.1"
      ],
      "dependencies": [
        "org.bouncycastle:bcprov-jdk18on:jar:1.78.1"
      ]
    }
  ],
  "version": "0.1.0"
}

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

No branches or pull requests

1 participant