Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Linkage problem: toImmutableSet #46

Closed
elharo opened this issue Oct 1, 2019 · 11 comments
Closed

Linkage problem: toImmutableSet #46

elharo opened this issue Oct 1, 2019 · 11 comments
Assignees
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. 🚨 This issue needs some love. semver: patch A minor bug fix or small change. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@elharo
Copy link
Contributor

elharo commented Oct 1, 2019

I tried adding the linkage checker enforcer rule to this project and got this error:

[ERROR] Linkage Checker rule found 1 error. Linkage error report:
(guava-28.1-android.jar) com.google.common.collect.ImmutableSet's method toImmutableSet() is not found;
referenced by 1 class file
com.google.auto.service.processor.AutoServiceProcessor (auto-service-1.0-rc4.jar)

@elharo
Copy link
Contributor Author

elharo commented Oct 1, 2019

This appears to be a true positive. This method exists in the jre verison of Guaa but not the android version we use.

@elharo elharo added priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. semver: patch A minor bug fix or small change. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Oct 1, 2019
@elharo
Copy link
Contributor Author

elharo commented Oct 1, 2019

I do not immediately see how we're pulling this in.

@chingor13 chingor13 self-assigned this Oct 1, 2019
@elharo
Copy link
Contributor Author

elharo commented Oct 1, 2019

Can we separate the annotation processor classpath from the compile time classpath?

@netdpb
Copy link

netdpb commented Oct 1, 2019

Do we have the dependency tree that shows where the dependencies come from?

@elharo
Copy link
Contributor Author

elharo commented Oct 1, 2019

mvn dependency:tree doesn't point to any likely culprits:

INFO]
[INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ google-cloud-core ---
[INFO] com.google.cloud:google-cloud-core:jar:1.91.2
[INFO] +- junit:junit:jar:4.12:test
[INFO] | - org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.easymock:easymock:jar:3.6:test
[INFO] +- org.objenesis:objenesis:jar:2.6:test
[INFO] +- com.google.api:gax:jar:1.49.0:compile
[INFO] | +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] | - io.opencensus:opencensus-api:jar:0.24.0:compile
[INFO] | - io.grpc:grpc-context:jar:1.24.0:compile
[INFO] +- com.google.protobuf:protobuf-java-util:jar:3.10.0:compile
[INFO] | +- com.google.errorprone:error_prone_annotations:jar:2.3.3:compile
[INFO] | - com.google.code.gson:gson:jar:2.8.5:compile
[INFO] +- com.google.api.grpc:proto-google-common-protos:jar:1.16.0:compile
[INFO] +- com.google.api.grpc:proto-google-iam-v1:jar:0.13.0:compile
[INFO] +- org.threeten:threetenbp:jar:1.3.3:compile
[INFO] +- com.google.api:api-common:jar:1.8.1:compile
[INFO] | - javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] +- com.google.auth:google-auth-library-credentials:jar:0.17.2:compile
[INFO] +- com.google.auth:google-auth-library-oauth2-http:jar:0.17.2:compile
[INFO] | - com.google.auto.value:auto-value-annotations:jar:1.6.6:compile
[INFO] +- com.google.http-client:google-http-client:jar:1.32.1:compile
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.5.10:compile
[INFO] | | +- commons-logging:commons-logging:jar:1.2:compile
[INFO] | | - commons-codec:commons-codec:jar:1.11:compile
[INFO] | +- org.apache.httpcomponents:httpcore:jar:4.4.12:compile
[INFO] | +- com.google.j2objc:j2objc-annotations:jar:1.3:compile
[INFO] | - io.opencensus:opencensus-contrib-http-util:jar:0.24.0:compile
[INFO] +- com.google.http-client:google-http-client-jackson2:jar:1.32.1:compile
[INFO] | - com.fasterxml.jackson.core:jackson-core:jar:2.9.9:compile
[INFO] +- com.google.protobuf:protobuf-java:jar:3.10.0:compile
[INFO] +- com.google.guava:guava:jar:28.1-android:compile
[INFO] | +- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] | +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] | +- org.checkerframework:checker-compat-qual:jar:2.5.5:compile
[INFO] | - org.codehaus.mojo:animal-sniffer-annotations:jar:1.18:compile
[INFO] +- com.google.truth:truth:jar:1.0:test
[INFO] | - com.googlecode.java-diff-utils:diffutils:jar:1.3.0:test
[INFO] - com.google.guava:guava-testlib:jar:28.1-android:test
[INFO]
[INFO] --------------< com.google.cloud:google-cloud-core-http >---------------
[INFO] Building Google Cloud Core HTTP 1.91.2 [3/5]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ google-cloud-core-http ---
[INFO] com.google.cloud:google-cloud-core-http:jar:1.91.2
[INFO] +- com.google.cloud:google-cloud-core:jar:1.91.2:compile
[INFO] | +- com.google.protobuf:protobuf-java-util:jar:3.10.0:compile
[INFO] | +- com.google.api.grpc:proto-google-common-protos:jar:1.16.0:compile
[INFO] | +- com.google.api.grpc:proto-google-iam-v1:jar:0.13.0:compile
[INFO] | +- org.threeten:threetenbp:jar:1.3.3:compile
[INFO] | +- com.google.http-client:google-http-client-jackson2:jar:1.32.1:compile
[INFO] | | - com.fasterxml.jackson.core:jackson-core:jar:2.9.9:compile
[INFO] | - com.google.protobuf:protobuf-java:jar:3.10.0:compile
[INFO] +- com.google.auth:google-auth-library-credentials:jar:0.17.2:compile
[INFO] +- com.google.auth:google-auth-library-oauth2-http:jar:0.17.2:compile
[INFO] | - com.google.auto.value:auto-value-annotations:jar:1.6.6:compile
[INFO] +- com.google.http-client:google-http-client:jar:1.32.1:compile
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.5.10:compile
[INFO] | | +- commons-logging:commons-logging:jar:1.2:compile
[INFO] | | - commons-codec:commons-codec:jar:1.11:compile
[INFO] | +- org.apache.httpcomponents:httpcore:jar:4.4.12:compile
[INFO] | - com.google.j2objc:j2objc-annotations:jar:1.3:compile
[INFO] +- com.google.guava:guava:jar:28.1-android:compile
[INFO] | +- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] | +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] | +- org.checkerframework:checker-compat-qual:jar:2.5.5:compile
[INFO] | +- com.google.errorprone:error_prone_annotations:jar:2.3.3:compile
[INFO] | - org.codehaus.mojo:animal-sniffer-annotations:jar:1.18:compile
[INFO] +- com.google.api-client:google-api-client:jar:1.30.4:compile
[INFO] | - com.google.oauth-client:google-oauth-client:jar:1.30.3:compile
[INFO] +- com.google.http-client:google-http-client-appengine:jar:1.32.1:compile
[INFO] +- com.google.api:gax:jar:1.49.0:compile
[INFO] +- com.google.api:gax-httpjson:jar:0.66.0:compile
[INFO] | - com.google.code.gson:gson:jar:2.8.5:compile
[INFO] +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] +- io.opencensus:opencensus-api:jar:0.24.0:compile
[INFO] | - io.grpc:grpc-context:jar:1.24.0:compile
[INFO] +- io.opencensus:opencensus-contrib-http-util:jar:0.24.0:compile
[INFO] +- com.google.api:api-common:jar:1.8.1:compile
[INFO] | - javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] +- junit:junit:jar:4.12:test
[INFO] | - org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.easymock:easymock:jar:3.6:test
[INFO] +- org.objenesis:objenesis:jar:2.6:test
[INFO] - com.google.truth:truth:jar:1.0:test
[INFO] - com.googlecode.java-diff-utils:diffutils:jar:1.3.0:test
[INFO]
[INFO] --------------< com.google.cloud:google-cloud-core-grpc >---------------
[INFO] Building Google Cloud Core gRPC 1.91.2 [4/5]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ google-cloud-core-grpc ---
[INFO] com.google.cloud:google-cloud-core-grpc:jar:1.91.2
[INFO] +- com.google.auth:google-auth-library-credentials:jar:0.17.2:compile
[INFO] +- com.google.cloud:google-cloud-core:jar:1.91.2:compile
[INFO] | +- com.google.protobuf:protobuf-java-util:jar:3.10.0:compile
[INFO] | +- com.google.api.grpc:proto-google-common-protos:jar:1.16.0:compile
[INFO] | +- com.google.api.grpc:proto-google-iam-v1:jar:0.13.0:compile
[INFO] | +- org.threeten:threetenbp:jar:1.3.3:compile
[INFO] | +- com.google.auth:google-auth-library-oauth2-http:jar:0.17.2:compile
[INFO] | | - com.google.auto.value:auto-value-annotations:jar:1.6.6:compile
[INFO] | +- com.google.http-client:google-http-client-jackson2:jar:1.32.1:compile
[INFO] | | - com.fasterxml.jackson.core:jackson-core:jar:2.9.9:compile
[INFO] | - com.google.protobuf:protobuf-java:jar:3.10.0:compile
[INFO] +- com.google.guava:guava:jar:28.1-android:compile
[INFO] | +- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] | +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] | +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] | +- org.checkerframework:checker-compat-qual:jar:2.5.5:compile
[INFO] | +- com.google.errorprone:error_prone_annotations:jar:2.3.3:compile
[INFO] | +- com.google.j2objc:j2objc-annotations:jar:1.3:compile
[INFO] | - org.codehaus.mojo:animal-sniffer-annotations:jar:1.18:compile
[INFO] +- com.google.api:gax:jar:1.49.0:compile
[INFO] | - io.opencensus:opencensus-api:jar:0.24.0:compile
[INFO] +- com.google.api:gax-grpc:jar:1.49.0:compile
[INFO] | +- io.grpc:grpc-stub:jar:1.24.0:compile
[INFO] | +- io.grpc:grpc-auth:jar:1.24.0:compile
[INFO] | +- io.grpc:grpc-protobuf:jar:1.24.0:compile
[INFO] | | - io.grpc:grpc-protobuf-lite:jar:1.24.0:compile
[INFO] | +- io.grpc:grpc-netty-shaded:jar:1.24.0:compile
[INFO] | - io.grpc:grpc-alts:jar:1.24.0:compile
[INFO] | +- io.grpc:grpc-grpclb:jar:1.24.0:compile
[INFO] | - org.apache.commons:commons-lang3:jar:3.5:compile
[INFO] +- com.google.api:api-common:jar:1.8.1:compile
[INFO] | - javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] +- io.grpc:grpc-api:jar:1.24.0:compile
[INFO] | - io.grpc:grpc-context:jar:1.24.0:compile
[INFO] +- io.grpc:grpc-core:jar:1.24.0:compile
[INFO] | +- com.google.code.gson:gson:jar:2.8.5:compile
[INFO] | +- com.google.android:annotations:jar:4.1.1.4:compile
[INFO] | +- io.perfmark:perfmark-api:jar:0.17.0:compile
[INFO] | - io.opencensus:opencensus-contrib-grpc-metrics:jar:0.21.0:compile
[INFO] +- com.google.http-client:google-http-client:jar:1.32.1:compile
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.5.10:compile
[INFO] | | +- commons-logging:commons-logging:jar:1.2:compile
[INFO] | | - commons-codec:commons-codec:jar:1.11:compile
[INFO] | +- org.apache.httpcomponents:httpcore:jar:4.4.12:compile
[INFO] | - io.opencensus:opencensus-contrib-http-util:jar:0.24.0:compile
[INFO] +- junit:junit:jar:4.12:test
[INFO] | - org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.easymock:easymock:jar:3.6:test
[INFO] - org.objenesis:objenesis:jar:2.6:test

@chingor13
Copy link
Contributor

We have a <dependencyManagement> section in a profile in the parent pom, but it's just a depedencyManagement declaration

@elharo
Copy link
Contributor Author

elharo commented Oct 2, 2019

Setting optional to true in pom.xml resolves this:

      <dependency>
        <groupId>com.google.auto.value</groupId>
        <artifactId>auto-value-annotations</artifactId>
        <version>${autovalue.version}</version>
        <optional>true</optional>
      </dependency>

@netdpb
Copy link

netdpb commented Oct 2, 2019

Is that in the <dependencyManagement> section in the parent? That is interesting. Does that mean that the <optional> property in that section overrides even whatever transitive dependency exists?

@elharo
Copy link
Contributor Author

elharo commented Oct 2, 2019

New hypothesis: this isn't a problem in this project at all. Rather it's a problem with the linkage checker rule or the maven enforcer which is somehow mixing classpaths with the project being built.

@chingor13
Copy link
Contributor

chingor13 commented Oct 8, 2019

This one should be fixed by googleapis/google-auth-library-java#358 which is included in google-auth-library 0.17.3

@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels Oct 8, 2019
@chingor13
Copy link
Contributor

Fixed by #56

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. 🚨 This issue needs some love. semver: patch A minor bug fix or small change. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

4 participants