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

Documentation issue: Label - What happens when label sections are blank? #14503

Closed
psigen opened this issue Jan 2, 2022 · 1 comment
Closed
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Documentation Documentation improvements that cannot be directly linked to other team labels team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts type: documentation (cleanup)

Comments

@psigen
Copy link
Contributor

psigen commented Jan 2, 2022

Documentation URL: https://docs.bazel.build/versions/main/skylark/lib/Label.html

Would it be possible to add documentation around what happens with this API when portions of a label are empty?

Here are some examples I was having trouble with:

  • if no package is specified, i.e. //:abc, does package return "." or "" or None?
  • if the name is not specified, i.e. //pkg, does it automatically set name to "pkg"?
  • if the workspace is not specified, i.e. //pkg:abc, does workspace_name automatically resolve to "" or "__main__" or dynamically resolve to the workspace name specified in WORKSPACE?
  • if the workspace is not specified, i.e. //pkg:abc, does workspace_root get set to "." or None or some other value?
@psigen psigen changed the title Documentation issue: Label Documentation issue: Label - What happens when label sections are blank? Jan 2, 2022
@sventiffe sventiffe added team-Documentation Documentation improvements that cannot be directly linked to other team labels untriaged labels Jan 13, 2022
@Wyverald Wyverald self-assigned this Jan 20, 2022
@sgowroji sgowroji added team-Starlark-Interpreter Issues involving the Starlark interpreter used by Bazel team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts and removed team-Starlark-Interpreter Issues involving the Starlark interpreter used by Bazel labels Nov 22, 2022
@keertk keertk added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Jan 9, 2023
@Wyverald
Copy link
Member

A number of documentation improvements in this area have been made to address some of the concerns raised here. Other questions like if the name is not specified, i.e. //pkg, does it automatically set name to "pkg"? can be answered by simply reading the docs (in this case, //pkg behaves exactly the same as //pkg:pkg). So I'll go ahead and close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Documentation Documentation improvements that cannot be directly linked to other team labels team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts type: documentation (cleanup)
Projects
None yet
Development

No branches or pull requests

6 participants