Skip to content

Conversation

@nicholasjng
Copy link
Contributor

Instead of maintaining custom nanobind and robin-map build files, and bootstrapping these archives with a custom module extension, use nanobind_bazel from the BCR.

The advantage of this is that less maintenance is needed inside the LLVM Bazel tree, and usage of nanobind_bazel's wrapper macros save a few lines of code while directly expressing the extensions as nanobind_extensions, which is more indicative of the target's purpose than just a cc_binary.


Follow-up of #164891, just wanted to draw this up to visualize how building bindings with nanobind_bazel from the BCR might look like.

This change is not entirely equivalent to the current state, since I'm not setting macros in nanobind to enable shared library exports - I'm tracking that in nicholasjng/nanobind-bazel#81. It does come with a "free" robin-map bump to v1.4.0, though, hence the removed TODO.

Instead of maintaining custom nanobind and robin-map build files, and bootstrapping
these archives with a custom module extension, use `nanobind_bazel` from the BCR.

The advantage of this is that less maintenance is needed inside the LLVM Bazel tree,
and usage of nanobind_bazel's wrapper macros save a few lines of code while directly
expressing the extensions as `nanobind_extension`s, which is more indicative of the
target's purpose than just a `cc_binary`.
@keith
Copy link
Member

keith commented Nov 24, 2025

nice, i started working on this one too. i went a different path and was updating the upstream nanobind target, which would be a drop in replacement for what we have today. to me the interesting question is what we expect from downstream users for this. because right now i guess folks have likely roughly copy pasted what is here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bazel "Peripheral" support tier build system: utils/bazel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants