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

[bazel.build] Suggestion on Target Visibility documentation improvement #22332

Open
PaulRashidi opened this issue May 11, 2024 · 0 comments
Open
Labels
team-Documentation Documentation improvements that cannot be directly linked to other team labels team-Starlark-Integration Issues involving Bazel's integration with Starlark, excluding builtin symbols type: documentation (cleanup) untriaged

Comments

@PaulRashidi
Copy link

Page link:

https://bazel.build/concepts/visibility

Problem description (include actual vs expected text, if applicable):

When it comes to reading documentation on Bazel's visibility feature, IMHO, most devs are going to be in one of two modes: 1. Figuring out how to open up the visibility correctly 2. Setting up their project with good practice.

I think the docs could read slightly faster by having the target visibility docs suggest the better practice norm that every BUILD file declare a default visibility in the package rule at the top and override it within the lower rules, when something should be exposed. Most notable, just showing a 10 line BUILD file example with export_files, package, and a go_lib rule with a few comments about what would be visible.

As it is right now, the fact that default_visibility can be configured in the package state is within the second page of content on Target visibility, but even there the wording assumes you're versed in Bazel and know what the the package declaration is and where to find out what it's fields are so you can properly declare.

Also of note, showing devs a good simple norm on package groups would be nice as well. IMHO, the documentation is perfectly correct, but may not quickly address the most common use case of reading the documentation. It could have a "quick examples" section which assists in perpetuating the better practices without requiring devs to go to StackOverflow (which doesn't have many BUILD examples yet). Even if those quick examples pointed directly at files within GitHub.

Where do you see this issue? (include link to specific section of the page, if applicable)

https://bazel.build/concepts/visibility

Any other information you'd like to share?

No response

@PaulRashidi PaulRashidi added team-Documentation Documentation improvements that cannot be directly linked to other team labels type: documentation (cleanup) untriaged labels May 11, 2024
@iancha1992 iancha1992 added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label May 13, 2024
@meteorcloudy meteorcloudy added team-Starlark-Integration Issues involving Bazel's integration with Starlark, excluding builtin symbols and removed team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website labels May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Documentation Documentation improvements that cannot be directly linked to other team labels team-Starlark-Integration Issues involving Bazel's integration with Starlark, excluding builtin symbols type: documentation (cleanup) untriaged
Projects
None yet
Development

No branches or pull requests

5 participants