-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[BEAM-8917] jsr305 dependency declaration for Nullable class #10324
Conversation
@@ -69,6 +69,7 @@ dependencies { | |||
compile library.java.protobuf_java | |||
compile library.java.commons_compress | |||
compile library.java.commons_lang3 | |||
compile library.java.jsr305 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You cannot do this a compile time dependency due to the license (LGPL) of findbugs/spotbugs. So far I think we have gotten around it because of the scope.
beam/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
Lines 738 to 741 in 8066d78
// spotbugs-annotations artifact is licensed under LGPL and cannot be included in the | |
// Apache Beam distribution, but may be relied on during build. | |
// See: https://www.apache.org/legal/resolved.html#prohibited | |
"com.github.spotbugs:spotbugs-annotations:3.1.12", |
CC: @kennknowles who probably knows more of the details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For extra ref the licenses we cannot include in Apache Software Foundations (ASF) projects is known as the Category X dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good info thanks! We probably still would need to go with spotbugs anyway to be consistent with the previous upgrade, but maybe it is worth to focus on the big issue that's on https://issues.apache.org/jira/browse/BEAM-8858
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I can wait for BEAM-8858 cleared.
What is "the previous upgrade" you're referring?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add it to the list of compileOnlyAnnotationDeps
where you see spotbugs-annotations
?
I am actually sort of surprised this works, since spotbugs operates on bytecode, not during compilation. I guess the annotations are retained and inspected in a way that does not require having the annotation library present. I have heard that any annotation with a class name (insensitive) of "nullable" will work, for example.
Noting in yet another place that spotbugs nullability analysis appears to be nonfunctional anyhow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In findbugsproject/findbugs#128 (comment), iloveeclipse confirmed that JSR305 has BSD license and was unexpectedly uploaded to Maven Central with a wrong license.
I moved the JSR305 explanation closer to spotbugs-annotations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that it is not a compileOnlyAnnotation
anymore because it is used to resolve nullability of Schema based fields per 788ce61#diff-504e2e0131eda09163b086becec92f3cR91 so it is needed at runtime too, or am I misreading this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iemejia That explanation is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. The LGPL annotations are spotbugs-annotations which have things like SuppresFBWarnings and a few other utility annotations. jsr305 is fine. The landscape of these annotations and what they do is actually quite strange, incomplete, and also changed.
Run Java PreCommit |
Run Python PreCommit |
Run Java PreCommit |
Run Python PreCommit |
Run BigQueryIO Streaming Performance Test Java |
Run Python PreCommit |
Run Dataflow ValidatesRunner |
Run Python PreCommit |
Run Dataflow ValidatesRunner |
Run Dataflow ValidatesRunner |
Run Python PreCommit |
Run Java PostCommit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kennknowles PTAL.
@@ -69,6 +69,7 @@ dependencies { | |||
compile library.java.protobuf_java | |||
compile library.java.commons_compress | |||
compile library.java.commons_lang3 | |||
compile library.java.jsr305 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In findbugsproject/findbugs#128 (comment), iloveeclipse confirmed that JSR305 has BSD license and was unexpectedly uploaded to Maven Central with a wrong license.
I moved the JSR305 explanation closer to spotbugs-annotations.
Run CommunityMetrics PreCommit |
Run Dataflow ValidatesRunner |
Run Java PostCommit |
Run Java HadoopFormatIO Performance Test |
Run BigQueryIO Streaming Performance Test Java |
Run Spark ValidatesRunner |
Run SQL Postcommit |
Dataflow Runner Nexmark Tests |
Run Java Flink PortableValidatesRunner Batch |
Run Java Flink PortableValidatesRunner Streaming |
Direct Runner Nexmark Tests |
Run Java Spark PortableValidatesRunner Batch |
Run Spark ValidatesRunner |
2 similar comments
Run Spark ValidatesRunner |
Run Spark ValidatesRunner |
Apache Spark Runner ValidatesRunner Tests don't succeed probably because of PR 10151 |
Run Spark ValidatesRunner |
@iemejia @kennknowles All checks passed. Does this look good? |
Kenn, Thank you. |
…10324) The Maven artifact org.apache.beam:beam-sdks-java-core, which contains org.apache.beam.sdk.schemas.FieldValueTypeInformation, should declare the dependency to com.google.code.findbugs:jsr305. The class needs Nullable class at runtime.
…10324) The Maven artifact org.apache.beam:beam-sdks-java-core, which contains org.apache.beam.sdk.schemas.FieldValueTypeInformation, should declare the dependency to com.google.code.findbugs:jsr305. The class needs Nullable class at runtime.
…ncy declaration for Nullable class (#10324)
Just double checked with today's SNAPSHOTs after the merge and the pom of core is not modified, however the deps look good in master, not sure if the change was applied before the SNAPSHOT generation, but still to double check. |
Investigating that. I see the same problem in my local installation. |
PR to fix this #10382 |
…10324) The Maven artifact org.apache.beam:beam-sdks-java-core, which contains org.apache.beam.sdk.schemas.FieldValueTypeInformation, should declare the dependency to com.google.code.findbugs:jsr305. The class needs Nullable class at runtime.
https://issues.apache.org/jira/projects/BEAM/issues/BEAM-8917
The Maven artifact org.apache.beam:beam-sdks-java-core, which contains org.apache.beam.sdk.schemas.FieldValueTypeInformation, should declare the dependency to com.google.code.findbugs:jsr305. The class needs Nullable class at runtime:
Example project to produce an issue: https:/suztomo/beam-java-sdk-missing-nullable .
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username
).[BEAM-XXX] Fixes bug in ApproximateQuantiles
, where you replaceBEAM-XXX
with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.See the Contributor Guide for more tips on how to make review process smoother.
Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.