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

Bump checkerframework to 2.2.2 and stop building from source #4795

Closed

Conversation

davido
Copy link
Contributor

@davido davido commented Mar 8, 2018

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:

$ 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

@davido davido force-pushed the fix-checkerframework-fork-mess branch 2 times, most recently from d8ddc24 to 5d62f6a Compare March 9, 2018 05:21
@laszlocsomor laszlocsomor requested review from cushon and philwo March 9, 2018 10:18
@philwo
Copy link
Member

philwo commented Mar 9, 2018

Thanks a lot for figuring this out! If @cushon approves, I'll handle the merge.

@philwo
Copy link
Member

philwo commented Mar 9, 2018

@davido Maybe I'm missing something, but where does the dataflow-2.2.2.jar come from? Doesn't seem to be part of this PR?

@davido
Copy link
Contributor Author

davido commented Mar 9, 2018

@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({
Copy link
Member

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?

Copy link
Contributor

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.

Copy link
Contributor Author

@davido davido Mar 9, 2018

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(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@philwo @janakdr this change probably isn't OK? We still want to include the sources.

Copy link
Contributor Author

@davido davido Mar 9, 2018

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?

Copy link
Contributor

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?

Copy link
Contributor Author

@davido davido Mar 9, 2018

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({
Copy link
Contributor

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",
],
Copy link
Contributor

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.

Copy link
Contributor Author

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"
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@davido davido force-pushed the fix-checkerframework-fork-mess branch 2 times, most recently from 85b552a to 5cb1731 Compare March 9, 2018 22:55
@@ -4,23 +4,16 @@ licenses(["restricted"]) # GNU GPL v2 with Classpath exception

filegroup(
name = "srcs",
srcs = glob(["**"]),
srcs = ["dataflow-2.2.2-sources.jar"],
Copy link
Contributor

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.

Copy link
Contributor Author

@davido davido Mar 13, 2018

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>

Copy link
Contributor Author

@davido davido Mar 14, 2018

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

Copy link
Contributor Author

@davido davido Mar 14, 2018

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

@davido davido force-pushed the fix-checkerframework-fork-mess branch 2 times, most recently from 117bc0c to 4c96cfb Compare March 14, 2018 19:37
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
@davido davido force-pushed the fix-checkerframework-fork-mess branch from 4c96cfb to 5a405cc Compare March 16, 2018 20:31
@lfpino
Copy link
Contributor

lfpino commented Mar 27, 2018

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.

@davido davido closed this Mar 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants