-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Bump checkerframework to 2.2.2 and stop building from source #4795
Conversation
d8ddc24
to
5d62f6a
Compare
Thanks a lot for figuring this out! If @cushon approves, I'll handle the merge. |
@davido Maybe I'm missing something, but where does the |
@philwo Oh, my bad, sorry, probably I missed to add it to the commit? I will re-add it later today and push a new version of the PR. (The source is just Maven Central, the location that was referenced by @cushon). Also I'm not sure you really want to merge the 2 Java 9 related commits in this series. They are more or less a RFC. |
@@ -11,6 +11,10 @@ filegroup( | |||
java_library( | |||
name = "autocodec", | |||
exported_plugins = [":autocodec-plugin"], | |||
javacopts = select({ |
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.
@janakdr What's your thought on building autocodec with --add-modules=jdk.unsupported
for Java 9? Do you think there's a better way?
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.
I think the Java 9 changes should be made separately from the "bump checkerframework to 2.2.2 and stop building from source" change. The latter is big enough for one commit, and the details former may need more discussion.
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.
Done. Note that I was adding it here only to be able to build Java 9. Coming from Gerrit, what is the right way in GitHub to add dependent pull requests?
@@ -46,8 +44,6 @@ filegroup( | |||
filegroup( |
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.
@cushon Can you elaborate? Is that because of LGPL license?
The sources must be in tree? Can't we merge the from Source-JAR downloaded from Central?
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.
I don't see anything now. Are these changes reverted?
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.
Yes, I uploaded a new version of the PR. I restored the GPL source packaging. But now the jars are included in embedded_tools
:
$ bazel build src:embedded_tools
INFO: Analysed target //src:embedded_tools (1 packages loaded).
INFO: Found 1 target...
Target //src:embedded_tools up-to-date:
bazel-genfiles/src/embedded_tools.zip
INFO: Elapsed time: 0.279s, Critical Path: 0.00s
$ unzip -t bazel-genfiles/src/embedded_tools.zip | grep checker_framework
testing: third_party/checker_framework_dataflow/dataflow-2.2.2-sources.jar OK
testing: third_party/checker_framework_javacutil/javacutil-2.2.2-sources.jar OK
@@ -11,6 +11,10 @@ filegroup( | |||
java_library( | |||
name = "autocodec", | |||
exported_plugins = [":autocodec-plugin"], | |||
javacopts = select({ |
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.
I think the Java 9 changes should be made separately from the "bump checkerframework to 2.2.2 and stop building from source" change. The latter is big enough for one commit, and the details former may need more discussion.
javacopts = ["-Xep:MissingCasesInEnumSwitch:OFF"], | ||
jars = [ | ||
"dataflow-2.2.2.jar", | ||
], |
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.
Please add the source jars too.
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.
Done.
" value = \"by gRPC proto compiler$grpc_version$\",\n" | ||
" comments = \"Source: $file_name$\")\n" | ||
"// Generated by gRPC proto compiler$grpc_version$\n" | ||
"// Source: $file_name$\n" |
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.
This doesn't belong in this PR, it should be a separate change.
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.
Done.
85b552a
to
5cb1731
Compare
@@ -4,23 +4,16 @@ licenses(["restricted"]) # GNU GPL v2 with Classpath exception | |||
|
|||
filegroup( | |||
name = "srcs", | |||
srcs = glob(["**"]), | |||
srcs = ["dataflow-2.2.2-sources.jar"], |
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.
These sources get collected into a tar archive by //:bazel-srcs
. Currently the tar contains the .java
sources, this changes causes the tar to contain the source jar. I think we want the preserve the current behaviour.
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.
Currently the tar contains the .java sources, this changes causes the tar to contain the source jar.
This PR is a principle change in handling of checker framework. We stop building from the source and start to consume the pre-built artifacts (downloaded from Maven Central).
If we do not build from the source, and do not have sources in our tree, why should we supply sources in :bazel-srcs
at all? We don't include sources neither for guava
, nor for error prone
and nor for custom java compiler. How is checker framework is different from those and other dozens of Bazel dependencies without supplied sources in :bazel-srcs
artifact?
In fact, before this change, the //:bazel-srcs
tar already contains some source JARs:
$ davido@wizball:~/projects/bazel (master %=)$ tar -tf bazel-bin/bazel-srcs.tar | grep --regexp\="third_party/.*jar$" | grep source
./third_party/asm/asm-6.0-sources.jar
./third_party/asm/asm-analysis-6.0-sources.jar
./third_party/asm/asm-commons-6.0-sources.jar
./third_party/asm/asm-tree-6.0-sources.jar
./third_party/asm/asm-util-6.0-sources.jar
After this change we have two more:
[...]
./third_party/checker_framework_dataflow/dataflow-2.2.2-sources.jar
./third_party/checker_framework_javacutil/javacutil-2.2.2-sources.jar
So, if you would argue, that we should stop include source JARs for checker framework in //:bazel-srcs
artifact I think would agree with this point. Should we rather remove checker framework source JARs from //:bazel-srcs
entirely?
A different point is third-party:gpl-srcs
. There we also include source JARs for the checker-framework
that is part of embeded zip. But there we also have other JARs.
Moreover, I also think, that a follow-up change could be to stop building jFormatString
from the source (another LGPL licensed library) and consume pre-built binary from the Central:
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jFormatString</artifactId>
<version>3.0.0</version>
</dependency>
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.
Should we rather remove checker framework source JARs from
//:bazel-srcs
entirely?
I discontinued packaging checker framework source jars in //:bazel-srcs
in the updated PR version, and extended the commit message:
This change stops building checker framework from the source and consumes
the artifacts from Central. As the consequence, the sources are removed
from the Bazel tree and we discontinue packaging the sources in Bazel
source artifact.
GPL v2 with Classpath exception sources have to be still included in
third_party:gpl-srcs
rule. The source jars are included in this rule,
that is used in embeded_tools archive:
$ unzip -t bazel-genfiles/src/embedded_tools.zip|grep checker_framework
testing: third_party/checker_framework_dataflow/dataflow-2.2.2-sources.jar
testing: third_party/checker_framework_javacutil/javacutil-2.2.2-sources.jar
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.
Moreover, I also think, that a follow-up change could be to stop building jFormatString from the source (another LGPL licensed library) and consume pre-built binary from the Central
Done in #4843
117bc0c
to
4c96cfb
Compare
Fixes: bazelbuild#4709. This change stops building checker framework from the source and consumes the artifacts from Central. As the consequence, the sources are removed from the Bazel tree and we discontinue packaging the sources in Bazel source artifact. GPL v2 with Classpath exception sources have to be still included in third_party:gpl-srcs rule. The source jars are included in this rule, that is used in embeded_tools archive: $ unzip -t bazel-genfiles/src/embedded_tools.zip|grep checker_framework testing: third_party/checker_framework_dataflow/dataflow-2.2.2-sources.jar testing: third_party/checker_framework_javacutil/javacutil-2.2.2-sources.jar
4c96cfb
to
5a405cc
Compare
Hi @davido, Bazel sheriff here, what's the status of this pull request? It hasn't been updated for more than a week so it'd be good to understand if it's still ongoing or safe to close. Thanks. |
Fixes: #4709.
This change stops building checker framework from the source and consumes
the artifacts from Central. As the consequence, the sources are removed
from the Bazel tree and we discontinue packaging the sources in Bazel
source artifact.
GPL v2 with Classpath exception sources have to be still included in
third_party:gpl-srcs
rule. The source jars are included in this rule,that is used in embeded_tools archive: