bazel: Illegal reflective access by com.google.protobuf.UnsafeUtil

After having upgraded Bazel’s protobuf to 3.6.0 and Bazel’s JDK to 9, we are seeing these warnings wen building protobufs. It’s an annoying cosmetic issue.

INFO: From Compiling Java headers src/main/java/com/google/devtools/build/lib/windows/libwindows-hjar.jar (3 files):
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/usr/local/google/home/buchgr/.cache/bazel/_bazel_buchgr/install/e676aae4e6c63bf8d7cfde16175ea874/_embedded_binaries/embedded_tools/tools/jdk/turbine_deploy.jar) to field java.lang.String.value
WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO: From Compiling Java headers src/main/java/com/google/devtools/build/lib/libunix-hjar.jar (10 files) [for host]:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/usr/local/google/home/buchgr/.cache/bazel/_bazel_buchgr/install/e676aae4e6c63bf8d7cfde16175ea874/_embedded_binaries/embedded_tools/tools/jdk/turbine_deploy.jar) to field java.lang.String.value
WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
...

Any thoughts @cushon @rongjiecomputer? Can we possibly prevent them from being printed? The corresponding protobuf issue: https://github.com/google/protobuf/issues/3781

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Tried to install tensorflow with Bazel 0.17.2

[7,813 / 12,405] 32 actions running
    Compiling tensorflow/stream_executor/stream.cc [for host]; 50s local
    Compiling tensorflow/core/util/batch_util.cc [for host]; 50s local
    Compiling tensorflow/core/distributed_runtime/master_session.cc; 34s local
    Compiling tensorflow/core/common_runtime/direct_session.cc; 30s local
    Compiling tensorflow/core/kernels/remote_fused_graph_execute_utils.cc; 29s local
    Compiling tensorflow/core/kernels/argmax_op.cc; 29s local
    Compiling tensorflow/core/kernels/argmax_op_gpu.cu.cc; 29s local
    Compiling tensorflow/core/kernels/l2loss_op_gpu.cu.cc; 28s local ...

Server terminated abruptly (error code: 14, error message: '', log file: '/home/xxx/.cache/bazel/_bazel_xxx/1ac92dbf7fec9d8d5e9cfda761e288d7/server/jvm.out')

xxx@yyy:~/tensorflow$ cat /home/xxx/.cache/bazel/_bazel_xxx/1ac92dbf7fec9d8d5e9cfda761e288d7/server/jvm.out
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/home/xxx/.cache/bazel/_bazel_xxx/install/792a28b07894763eaa2bd870f8776b23/_embedded_binaries/A-server.jar) to field java.lang.String.value
WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

So it doesn’t seem just cosmetic…