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

Fix downstream failures due to new error prone checks #15219

Closed
hvadehra opened this issue Apr 12, 2022 · 5 comments
Closed

Fix downstream failures due to new error prone checks #15219

hvadehra opened this issue Apr 12, 2022 · 5 comments
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Rules-Java Issues for Java rules type: process

Comments

@hvadehra
Copy link
Member

New error prone checks since the last java_tools release now break bazel and other downstream projects (https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2430)
This is currently blocking a java_tools release (bazelbuild/java_tools#55).

I plan to disable the checks for now (as done before in cf57345) on the default java toolchain and proceed with the release.

Filing this issue to track fixing of downstream and then re-enable the checks.

cc @comius

@hvadehra hvadehra self-assigned this Apr 12, 2022
@comius comius added P1 I'll work on this now. (Assignee required) team-Rules-Java Issues for Java rules P2 We'll consider working on this in future. (Assignee optional) and removed P1 I'll work on this now. (Assignee required) labels Apr 12, 2022
@cushon
Copy link
Contributor

cushon commented Apr 12, 2022

Disabling globally to make progress is OK with me.

These are the distinct errors I saw, which could be fixed more locally. Did you see others?

api/src/test/java/com/google/common/flogger/LogContextTest.java:418: error: [FloggerLogString] Arguments to log(String) must be compile-time constants or parameters annotated with @CompileTimeConstant. If possible, use Flogger's formatting log methods instead.
--
  | logger.atInfo().log(nullString);
  | ^
external/desugar_jdk_libs/src/share/classes/java/util/stream/Collectors.java:630: error: [ReturnValueIgnored] Return value of 'sumWithCompensation' must be used
--
  | (a, t) -> { sumWithCompensation(a, mapper.applyAsDouble(t)); a[2]++; a[3]+= mapper.applyAsDouble(t);},
  | ^

@hvadehra
Copy link
Member Author

hvadehra commented Apr 12, 2022

The Flogger test needs to be updated. It's been fixed internally (423382085) but for some reason has not been exported to github yet (probably waiting for an error prone release)
The latter desugar lib failure is the one I'm attempting to fix with the global disable of ReturnValueIgnored (afaict flags allowing more fine-grained disabling have been removed)
These are the only failures related to error prone.

@cushon
Copy link
Contributor

cushon commented Apr 12, 2022

The original flogger fix was made internal only, I just mailed cl/441196089

For desugar I think you could also add the flag to the javacopts for the affected target, but disabling it globally to unblock the release is still fine with me

@hvadehra
Copy link
Member Author

Got it, I'll mail a change to update it locally at desugar as a followup.

bazel-io pushed a commit that referenced this issue Apr 12, 2022
New checks added since the last release break //tools/android/...

Re-enabling this is being tracked in #15219

PiperOrigin-RevId: 441198376
copybara-service bot pushed a commit to googlecloudrobotics/core that referenced this issue Apr 13, 2022
New error prone checks have been added around FluentLogger, so building with the bazel at head with latest java_tools causes the following errors:

```
core/src/java/com/cloudrobotics/tokenvendor/cloudiot/BUILD.bazel:3:13: Building src/java/com/cloudrobotics/tokenvendor/cloudiot/libcloudiot.jar (3 source files) and running annotation processors (ComponentProcessor) failed: (Exit 1): java failed: error executing command (from target //src/java/com/cloudrobotics/tokenvendor/cloudiot:cloudiot)
--
  | (cd /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/8c32e694a468f8d49666471b7551ce22/execroot/cloud_robotics && \
  | exec env - \
  | LC_CTYPE=en_US.UTF-8 \
  | PATH=/bin:/usr/bin:/usr/local/bin \
  | external/remotejdk11_linux/bin/java -XX:-CompactStrings '--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.resources=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED' '--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED' '--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED' '--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED' '--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED' '--add-opens=java.base/java.nio=ALL-UNNAMED' '--add-opens=java.base/java.lang=ALL-UNNAMED' '--patch-module=java.compiler=external/remote_java_tools/java_tools/java_compiler.jar' '--patch-module=jdk.compiler=external/remote_java_tools/java_tools/jdk_compiler.jar' -jar external/remote_java_tools/java_tools/JavaBuilder_deploy.jar @bazel-out/k8-opt/bin/src/java/com/cloudrobotics/tokenvendor/cloudiot/libcloudiot.jar-0.params @bazel-out/k8-opt/bin/src/java/com/cloudrobotics/tokenvendor/cloudiot/libcloudiot.jar-1.params)
  | # Configuration: cdbffe1c6342375d5b3fac01cf67bc8ac55c5eabd9fbbd4f23198902b250e7be
  | # Execution platform: @local_config_platform//:host
  | src/java/com/cloudrobotics/tokenvendor/cloudiot/CloudIotPublicKeyRepository.java:73: error: [FloggerLogString] Arguments to log(String) must be compile-time constants or parameters annotated with @CompileTimeConstant. If possible, use Flogger's formatting log methods instead.
  | logger.atSevere().withCause(e).log(message);
  | ^
  | src/java/com/cloudrobotics/tokenvendor/cloudiot/CloudIotPublicKeyRepository.java:164: error: [FloggerLogString] Arguments to log(String) must be compile-time constants or parameters annotated with @CompileTimeConstant. If possible, use Flogger's formatting log methods instead.
  | logger.atSevere().withCause(e).log(message);
  | ^
  | src/java/com/cloudrobotics/tokenvendor/cloudiot/CloudIotPublicKeyRepository.java:190: error: [FloggerLogString] Arguments to log(String) must be compile-time constants or parameters annotated with @CompileTimeConstant. If possible, use Flogger's formatting log methods instead.
  | logger.atSevere().withCause(e).log(message);
```

Context: bazelbuild/bazel#15219

Closes #89
#89

ORIGINAL_AUTHOR=hvd <hvadehra@gmail.com>
GitOrigin-RevId: 8ba0d64a65a10fa33234e47b5c648513517ccabc
Change-Id: I411be1dc3b70193ee51a4ddaba40e1bdba99e6e7
ckolli5 added a commit that referenced this issue May 23, 2022
New checks added since the last release break //tools/android/...

Re-enabling this is being tracked in #15219

PiperOrigin-RevId: 441198376

Co-authored-by: hvd <hvd@google.com>
ckolli5 added a commit that referenced this issue May 24, 2022
New checks added since the last release break //tools/android/...

Re-enabling this is being tracked in #15219

PiperOrigin-RevId: 441198376

Co-authored-by: hvd <hvd@google.com>
@github-actions
Copy link

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Jun 17, 2023
@github-actions github-actions bot removed the stale Issues or PRs that are stale (no activity for 30 days) label Jun 28, 2023
@hvadehra hvadehra closed this as not planned Won't fix, can't repro, duplicate, stale Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Rules-Java Issues for Java rules type: process
Projects
None yet
Development

No branches or pull requests

3 participants