Commit 14a1036
test(e2e): cover nanobind_extension against the PBS py_cc toolchain (#1299)
Adds an e2e case that builds a real `nanobind_extension` in a graph
whose only Python toolchains come from `python_interpreters` (the
rules_python `python.toolchain()` drop-in), exercising the
`@rules_python//python/cc:current_py_cc_headers` path that nanobind and
pybind11 use to resolve Python headers.
`pbs-cc-toolchain` already covers the bare `cc_binary` +
`current_py_cc_headers`/`current_py_cc_libs` path; this adds the
**nanobind** consumer, which is how most real-world native extensions
reach `current_py_cc_headers`. It guards the py_cc toolchain
registration (issue #1095) against regression.
Two targets:
- `example_ext_build_test` — a `build_test` over the
`nanobind_extension`; fails at analysis if `python_interpreters` does
not register `@rules_python//python/cc:toolchain_type`.
- `example_ext_test` — compiles, links, loads and calls the extension
under a PBS runtime (py 3.13).
**End-user visible:** no (test-only). **Breaking:** no.
**Test plan:** `bazel test //nanobind-py-cc/...` in `e2e/cases` passes
locally (build_test + runtime import/call; Linux x86_64, llvm
toolchain).
Context: came out of testing the py_cc gap for a real nanobind consumer
(discussed in #1131); @jbedard suggested opening this.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent b9296a9 commit 14a1036
5 files changed
Lines changed: 87 additions & 0 deletions
File tree
- e2e/cases
- nanobind-py-cc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments