-
-
Notifications
You must be signed in to change notification settings - Fork 678
doc how to lookup python toolchain information #3044
Copy link
Copy link
Labels
Good first issueA good first issue for people looking to contributeA good first issue for people looking to contributetype: documentation
Description
A case I've had to explain a few times to people is how to use toolchains to get information custom rules want. Often what I see is people hard-coding python versions in constants or using large select statements, when a toolchain lookup is typically more appropriate.
Bazel Toolchains are intimidating, though. Most Bazel docs talk about the backend details of defining them and resolving them, so the easy part of just accessing them gets lost:
- Add
toolchains = ...arg to rule() - Use
ctx.toolchains[...]in the rule
We should have some docs that give examples for some common cases, e.g.
- I want to get the current python version
- I want to get the current python headers
- I want to build the string needed for e.g. wheel file naming.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Good first issueA good first issue for people looking to contributeA good first issue for people looking to contributetype: documentation