-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Flip --incompatible_visibility_private_attributes_at_definition
and make it less breaking
#19141
Conversation
@meteorcloudy I would like to see this flag flipped, but would like to see the results of a downstream run before I bring this up for discussion. Could you trigger one for me on this PR? |
Here you go: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds?branch=pull%2F19141%2Fhead But there are many existing failures in downstream pipeline, you may need to compare the results. |
7a5201e
to
a09caf1
Compare
--incompatible_visibility_private_attributes_at_definition
--incompatible_visibility_private_attributes_at_definition
Downstream is looking good: https://buildkite.com/bazel/bazelisk-plus-incompatible-flags/builds/1625 Not entirely sure which team this belongs to, but based on prior interactions about this flag and the relation to visibility, I will go with @aranguyen Could you review this? I had a previous discussion about this with Greg on #19139. We can also wait for Greg to be back in office if you don't feel like you have sufficient context. CC @laurentlb as the reviewer of the original proposal (https://github.com/bazelbuild/proposals/blob/main/designs/2019-10-15-tool-visibility.md). With load visibility available now, there doesn't seem to be any reason not to flip this for Bazel. Blaze may be a different story, but could be solved with an RC file entry if you don't want to perform a migration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has a potential to show preexisting correctness bugs on unexpected edge cases. I'll run the internal tests and report back.
@brandjon, can you provide a second pair of eyes? This has been implemented in 2019: PiperOrigin-RevId: 277683498 Technically this could show us some edge cases / correctness issues. I remember fixing one related to this in the past that involved about 5 conditions to trigger. I'll run internal tests and if we don't have a plan for other actions that could de-risk us, I propose we move forward. This is a feature that both internal and external users were asking for and is a pain point for toolchain owners in general. @fmeum I don't see aspects covered in the tests of the original implementation. Could you add some tests for that? Should an implicit dependency in that case be visible to an aspect, not rule? cc @mai93 |
The test I was referring to is: targetCompatibleWith_mismatchesExecCompatibleWithinAspect. The aspect case is even more complex. Implicit dependency might be coming from the target an aspect is over or from an aspect. Please add tests. Undo approval. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests that cover aspect's implicit dependecies and implicit dependencies of targets an aspect is over.
I believe IntelliJ issues are related to aspects functionality. Please address them. |
--incompatible_visibility_private_attributes_at_definition
--incompatible_visibility_private_attributes_at_definition
and make it less breaking
a09caf1
to
927b47b
Compare
927b47b
to
a32cc80
Compare
@comius I made the change you suggested in #19330 (comment). |
src/test/java/com/google/devtools/build/lib/analysis/VisibilityTest.java
Show resolved
Hide resolved
There's one use case we haven't foreseen. Restricting visibility of tools to builtin rules. |
@comius Could you elaborate on this? Wouldn't something like |
I've just got a report from an internal user, that they tried It happened on an internal ruleset. Possibly a simple reproduction in Bazel is to reduce visibility of @bazel_tools/tools/def_parser:def_parser, which is used in cc_binary |
I checked that @comius If a rule |
cc also @brandjon; this is somewhat annoying since |
… make it less breaking In addition to flipping the flag, also add a check for visibility from the target as a fallback to make the flip less breaking. Closes #19330 RELNOTES[INC]: --incompatible_visibility_private_attributes_at_definition is flipped to true. See #19330 for details. Closes #19141. PiperOrigin-RevId: 569556377 Change-Id: Ic691c5585d9ba2d95b6ff3c32b9979f777147d8b (cherry picked from commit 0656103)
In addition to flipping the flag, also add a check for visibility from the target as a fallback to make the flip less breaking.
Closes #19330
RELNOTES[INC]: --incompatible_visibility_private_attributes_at_definition is flipped to true. See #19330 for details.