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

BUILD target visibility broken by upcoming Bazel 6.0 release #58168

Closed
brandjon opened this issue Oct 19, 2022 · 3 comments
Closed

BUILD target visibility broken by upcoming Bazel 6.0 release #58168

brandjon opened this issue Oct 19, 2022 · 3 comments
Assignees
Labels
stat:awaiting tensorflower Status - Awaiting response from tensorflower subtype:bazel Bazel related Build_Installation issues type:build/install Build and install issues

Comments

@brandjon
Copy link

brandjon commented Oct 19, 2022

Issue Type

Build/Install

Source

source

Tensorflow Version

Near-HEAD

Custom Code

No

OS Platform and Distribution

No response

Mobile device

No response

Python version

No response

Bazel version

pre-6.0

GCC/Compiler version

No response

CUDA/cuDNN version

No response

GPU model and memory

No response

Current Behaviour?

Tensorflow's build will break in Bazel 6.0 due to a bugfix in the behavior of package_group. (See Bazel CI run)

The target //tensorflow/compiler/xla/mlir/transforms/runtime:calling_convention depends on //tensorflow/compiler/xla/mlir/ir/runtime:rt, and is granted visibility via the latter's default_visibility of @tf_runtime//:friends. This friends package group contains //..., which under pre-6.0 behavior grants visibility to everyone (effectively public). The corrected behavior is that it grants visibility only to all packages within the same repo as that package group, i.e., to packages under @tf_runtime.

If you want the behavior of the package group to be "visible to all packages, everywhere", you can replace //... with the special string constant public, which is new to Bazel 6.0. This will break compatibility with prior Bazel versions. Note that there is no direct way for a package group to specify "visible to the following packages that live outside of my own repo".

Alternatively, you can rewrite the default_visibility in tensorflow/compiler/xla/mlir/ir/runtime/BUILD to //visibility:public, because that's effectively what it already is; or you can determine a more suitable narrower visibility definition.

Finally, you can opt out of this change for your build by passing --incompatible_fix_package_group_reporoot_syntax=false in Bazel 6.0. This is particularly helpful if you want to migrate to use public for any package groups in the meantime

See bazelbuild/bazel#16323 for more information.

Standalone code to reproduce the issue

Build at head Bazel.

Relevant log output

No response

@google-ml-butler google-ml-butler bot added the type:build/install Build and install issues label Oct 19, 2022
@tilakrayal tilakrayal added the subtype:bazel Bazel related Build_Installation issues label Oct 20, 2022
@sushreebarsa sushreebarsa added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Oct 21, 2022
@fweikert
Copy link

Friendly ping

@meteorcloudy
Copy link
Member

Looks like this is fixed by 4695502

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting tensorflower Status - Awaiting response from tensorflower subtype:bazel Bazel related Build_Installation issues type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

8 participants