google / flogger

A Fluent Logging API for Java
Apache License 2.0
1.45k stars 123 forks source link

java failed error executing Javac command from target //api:checks #373

Closed sgowroji closed 5 months ago

sgowroji commented 5 months ago

CI : https://buildkite.com/bazel/flogger/builds/2701#018d64f0-b10f-4087-b959-3e56353224da

Platform : Windows

Logs:

ERROR: /workdir/api/BUILD:118:13: Building api/libchecks.jar (1 source file) failed: (Exit 1): java failed: error executing Javac command (from target //api:checks)
  (cd /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/execroot/_main && \
  exec env - \
    LC_CTYPE=en_US.UTF-8 \
    PATH=/var/lib/buildkite-agent/.cache/bazelisk/downloads/bazelbuild/bazel-7.0.2-linux-x86_64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
  external/rules_java~7.1.0~toolchains~remotejdk21_linux/bin/java '--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' '-Dsun.io.useCanonCaches=false' -XX:-CompactStrings -Xlog:disable '-Xlog:all=warning:stderr:uptime,level,tags' -jar external/rules_java~7.1.0~toolchains~remote_java_tools/java_tools/JavaBuilder_deploy.jar @bazel-out/k8-fastbuild/bin/api/libchecks.jar-0.params @bazel-out/k8-fastbuild/bin/api/libchecks.jar-1.params)
# Configuration: fd66a9126ba7176f05dc4a8964fe8b3c6b44c682598eed64c0b9bdf306f5b715
# Execution platform: @@local_config_platform//:host
error: Source option 7 is no longer supported. Use 8 or later.
error: Target option 7 is no longer supported. Use 8 or later.
(13:52:13) ERROR: /workdir/api/BUILD:111:13: Building api/libstack_getter_common.jar (2 source files) failed: (Exit 1): java failed: error executing Javac command (from target //api:stack_getter_common)

CC Greenteam @wyv

chaoren commented 5 months ago

Apparently the builds have been failing since December.

chaoren commented 5 months ago

https://buildkite.com/bazel/flogger/builds/2715#018daa29-0ee6-4680-ad6d-4ec7dfce09bf is failing now for a different reason:

log4j2/src/test/java/com/google/common/flogger/backend/log4j2/Log4j2BackendFactoryTest.java:34: error: [strict] Using type com.google.common.collect.ImmutableList from an indirect dependency (TOOL_INFO: "@@com_google_guava_guava//:com_google_guava_guava"). See command below **
    ImmutableList<BackendFactory> factories =
    ^
 ** Please add the following dependencies:
  @@com_google_guava_guava//:com_google_guava_guava to //log4j2:src/test/java/com/google/common/flogger/backend/log4j2/Log4j2BackendFactoryTest
 ** You can use the following buildozer command:
buildozer 'add deps @@com_google_guava_guava//:com_google_guava_guava' //log4j2:src/test/java/com/google/common/flogger/backend/log4j2/Log4j2BackendFactoryTest

I just realized that this isn't our CI (which is currently green: https://github.com/google/flogger/actions).

@sgowroji, what's the difference between that build and this repo's CI? Where are the configs for this project on buildkite?

chaoren commented 5 months ago

Oh, I see. The config is in https://github.com/bazelbuild/continuous-integration/blob/master/pipelines/flogger.yml.

chaoren commented 5 months ago

So it's just bazel build //... that's failing. I wonder why the project's CI doesn't cover that.

cpovirk commented 5 months ago

It looks like our normal build probably builds that, too: https://github.com/google/flogger/blob/3b7e325dcde4f5ee041494e0fbcfe947d53dbfde/.github/workflows/ci.yml#L43

Maybe just a Bazel version issue? I think you'd pointed me to the version selection recently: https://github.com/google/flogger/blob/3b7e325dcde4f5ee041494e0fbcfe947d53dbfde/.github/workflows/ci.yml#L20

I can reproduce the successful build locally with:

$ echo 3.7.1 > .bazelversion

$ bazelisk build //log4j2:src/test/java/com/google/common/flogger/backend/log4j2/Log4j2BackendFactoryTest

But without the .bazelversion file, bazelisk picks a more recent version, and the build fails.