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
Linkage Monitor detects a genuine error between proto-google-common-protos and appengine-api-1.0-sdk #2045
Comments
what if we update the appengine-api-1.0-sdk? is the problem still present? |
Yes, the problem is still there. The latest JAR (appengine-api-1.0-sdk-1.9.88.jar ) also has the reference to the repackaged class in
|
I don't yet understand why or how this bug is caused. |
Is the problem that appengine-api-sdk provides a modified version of the non-repackaged class that uses repackaged classes in its signatures? If so, that's pretty bad. What I'm trying to figure out is how the use of non-repackaged classes in the proto-common-protos PR leads to a problem with the repackaged classes from the appengine-api-sdk jar. |
In the PastThe class VisibilityProto has been in the "class not found" linkage error in appengine-api-1.0-sdk's linkage check (see dashboard for the details).
NowNow the PR (googleapis/java-common-protos#148 (comment) ) is adding VisibilityProto.java into proto-google-common-protos artifact. This is going to fix the "class not found" error. This is a good thing. However, there is a discrepancy in getDescriptor method signature between the VisibilityProto class in the PR and appengine-api-1.0-sdk's reference. The pull request has VisibilityProto's getDescriptor returning
|
Thanks for the explanation. That makes sense. My followup question is whether this is going to break anything? I guess not, or at least not anything that wasn't already broken since previously VisibilityProto wasn't found at all? But then why have the repackaged classes bothered to change this at all? When the linkage checker says, "com.google.api.VisibilityProto's method getDescriptor() is expected to return ..." what is it looking at? That is, why does it think getDescriptor() returns `com.google.appengine.repackaged.com.google.protobuf.Descriptors$FileDescriptor? Are there two versions f this class in the classpath now, or is it looking at what the return value is assigned to, or what? This is very confusing. |
No, because (as you wrote) the missing VisibilityProto would have failed already.
(I don't know the exact reason) Usually people shade dependencies to avoid dependency conflicts. I guess the change to VisibilityProto's getDescriptor method was side-effect of it. It hasn't been a problem because appengine-api-1.0-sdk has no code path to touch the method. "com.google.api.VisibilityProto's method getDescriptor() is expected to return ..." means the 6 classes (
|
From googleapis/java-common-protos#148 (comment) , where Neenu told me that the Linkage Monitor check is blocking the pull request.
Upon checking I think It's a genuine linkage error but how can we bring the check back to green?
The Linkage Monitor says:
The error comes from the discrepancy between repackaged method reference (in appengine-api-1.0-sdk-1.9.71.jar) and non-repackaged implementation (in proto-google-common-protos).
appengine-api-1.0-sdk-1.9.71.jar
VisibilityProto.java in this PR
The method in this PR returns non-repackaged version of
FileDescriptors.FileDescriptor
In general, when one of the classes marked "not found" in appengine-api-1.0-sdk JAR file (dashboard) is introduced to proto-google-common-protos artifact, it may have such linkage errors on method references due to repackaged classes.
Solutions?
Ideal solution
If we can make the appengine-api-1.0-sdk artifact stop repackaging classes, then that's would be great.
Temporary Solution
We add the method reference to the default exclusion rule.
Others?
Other solution to unblock the pull request (googleapis/java-common-protos#148 (comment))?
The text was updated successfully, but these errors were encountered: