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

toolchain docs should mention issues with repository names #6828

Open
katre opened this issue Dec 3, 2018 · 0 comments
Open

toolchain docs should mention issues with repository names #6828

katre opened this issue Dec 3, 2018 · 0 comments
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Configurability platforms, toolchains, cquery, select(), config transitions team-Documentation Documentation improvements that cannot be directly linked to other team labels type: documentation (cleanup)

Comments

@katre
Copy link
Member

katre commented Dec 3, 2018

The toolchains documentation gives details on creating a toolchain and using it in the same repository. Due to the way Starlark handles loads and target equivalence, when a toolchain is used via an external repository, it must be referred to by the fully qualified label (including the repository) everywhere, including in the rule definitions and toolchain definitions.

This can be exemplified by the rules_rust repo repo:

  1. The WORKSPACE defines the repository name as io_bazel_rules_rust: https://github.com/bazelbuild/rules_rust/blob/master/WORKSPACE#L1
  2. The rules refer to the toolchain type by a fully-qualified label: https://github.com/bazelbuild/rules_rust/blob/master/rust/private/rust.bzl#L207
  3. Toolchain declarations also use the fully-qualified label: https://github.com/bazelbuild/rules_rust/blob/master/rust/repositories.bzl#L151
  4. All users must import the rules under the name io_bazel_rules_rust.

The documentation should be set up to describe this.

Ideally, error-checking code in toolchain resolution would also at least mention this case, but that's very very tricky.

@katre katre added type: documentation (cleanup) P2 We'll consider working on this in future. (Assignee optional) category: extensibility > toolchains team-Configurability platforms, toolchains, cquery, select(), config transitions labels Dec 3, 2018
@katre katre self-assigned this Dec 3, 2018
@sgowroji sgowroji added the team-Documentation Documentation improvements that cannot be directly linked to other team labels label Jan 11, 2023
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-Configurability platforms, toolchains, cquery, select(), config transitions team-Documentation Documentation improvements that cannot be directly linked to other team labels type: documentation (cleanup)
Projects
None yet
Development

No branches or pull requests

3 participants