Skip to content

test(e2e): cover nanobind_extension against the PBS py_cc toolchain#1299

Open
ctcjab wants to merge 1 commit into
aspect-build:mainfrom
ctcjab:nanobind-py-cc-e2e
Open

test(e2e): cover nanobind_extension against the PBS py_cc toolchain#1299
ctcjab wants to merge 1 commit into
aspect-build:mainfrom
ctcjab:nanobind-py-cc-e2e

Conversation

@ctcjab

@ctcjab ctcjab commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

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.

Adds an e2e case that builds a real nanobind_extension in a graph whose
only Python toolchains come from python_interpreters, exercising the
@rules_python//python/cc:current_py_cc_headers path that nanobind and
pybind11 use to resolve Python headers. Complements pbs-cc-toolchain
(bare cc_binary + current_py_cc_headers/libs) with the common nanobind
consumer, guarding the py_cc toolchain registration behind issue aspect-build#1095.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant