-
Notifications
You must be signed in to change notification settings - Fork 541
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
docs: give some general guidance on how to define custom toolchains #2220
Conversation
bea9e30
to
66691b5
Compare
66691b5
to
a199dc9
Compare
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.
LGTM, thanks a lot!
Python toolchains can be utilized in other bazel rules, such as `genrule()`, by adding the `toolchains=["@rules_python//python:current_py_toolchain"]` attribute. You can obtain the path to the Python interpreter using the `$(PYTHON2)` and `$(PYTHON3)` ["Make" Variables](https://bazel.build/reference/be/make-variables). See the | ||
{gh-path}`test_current_py_toolchain <tests/load_from_macro/BUILD.bazel>` target for an example. | ||
|
||
Python toolchains can be utilized in other bazel rules, such as `genrule()`, by |
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.
nit, should we have a link to the bazel docs here?
Python toolchains can be utilized in other bazel rules, such as `genrule()`, by | |
Python toolchains can be utilized in other bazel rules, such as `genrule()`, by |
attribute. You can obtain the path to the Python interpreter using the | ||
`$(PYTHON2)` and `$(PYTHON3)` ["Make" | ||
Variables](https://bazel.build/reference/be/make-variables). See the | ||
{gh-path}`test_current_py_toolchain <tests/load_from_macro/BUILD.bazel>` target |
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.
nice!
|
||
Defining toolchains for this might look something like this: | ||
|
||
``` |
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.
Do our docs support this sort of highlighting?
``` | |
```starlark |
From the discussion in #2216, it's clear that some better docs are needed to help people
figure out how to define a toolchain and what the different pieces me.
This gives some more explanation of the toolchain types, what they do, and how to
define them.
Along the way:
foo()