'buildifier_lint_check' broken with bazel 7
Required information
Operating system: Ubuntu 22.04 LTS
Compiler version: any
Eclipse iceoryx version:
master branch
Observed result or behaviour:
bazel run //:buildifier_lint_check errors out with
ERROR: /root/.cache/bazel/_bazel_root/a177ea2271aed5b8d4b661751e11f9b0/external/io_bazel_rules_go/BUILD.bazel:73:16: in (an implicit dependency) attribute of go_context_data rule @@io_bazel_rules_go//:go_context_data: in $whitelist_function_transition attribute of go_context_data rule @@io_bazel_rules_go//:go_context_data: package group '@@bazel_tools//tools/whitelists/function_transition_whitelist:function_transition_whitelist' is misplaced here (they are only allowed in the visibility attribute)
ERROR: /root/.cache/bazel/_bazel_root/a177ea2271aed5b8d4b661751e11f9b0/external/io_bazel_rules_go/BUILD.bazel:73:16: Analysis of target '@@io_bazel_rules_go//:go_context_data' failed
INFO: Repository protobuf~3.19.6 instantiated at:
<builtin>: in <toplevel>
Repository rule http_archive defined at:
/root/.cache/bazel/_bazel_root/a177ea2271aed5b8d4b661751e11f9b0/external/bazel_tools/tools/build_defs/repo/http.bzl:384:31: in <toplevel>
INFO: Repository zlib instantiated at:
/iceoryx/WORKSPACE.bazel:27:19: in <toplevel>
/iceoryx/bazel/setup_repositories.bzl:25:37: in setup_repositories
/iceoryx/bazel/bazelbuild/setup.bzl:29:18: in setup_go_protobuf_for_bazelbuild
/root/.cache/bazel/_bazel_root/a177ea2271aed5b8d4b661751e11f9b0/external/com_google_protobuf/protobuf_deps.bzl:19:21: in protobuf_deps
Repository rule http_archive defined at:
/root/.cache/bazel/_bazel_root/a177ea2271aed5b8d4b661751e11f9b0/external/bazel_tools/tools/build_defs/repo/http.bzl:384:31: in <toplevel>
ERROR: Analysis of target '//:buildifier_lint_check' failed; build aborted: Analysis failed
INFO: Elapsed time: 61.399s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target
FAILED:
Fetching repository @@org_golang_x_tools; Patching repository
Fetching https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.19.6.zip; 3.6 MiB (51.0%)
Fetching https://github.com/madler/zlib/archive/v1.2.11.tar.gz; 80.8 KiB (12.8%)
Expected result or behaviour: No error
Conditions where it occurred / Performed steps:
Edit .bazelversion and set the version to 7.0.0. Now run bazel run //:buildifier_lint_check
Did you figure out what causes this @elBoberido? I'm having the same problem.
No, unfortunately not. I'm also not experienced with Bazel so I will probably also not be able to fix it myself.
This is fixing by upgrade the rule io_bazel_rules_go
Sorry for not coming back on this. I came to the same conclusion. In my case I only transitively depended on rules_go through rules_docker. I solved the issue by migrating to rules_oci.