[mlir][bazel] Build MLIR bindings extensions with nanobind_bazel
#169306
+33
−124
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Instead of maintaining custom nanobind and robin-map build files, and bootstrapping these archives with a custom module extension, use
nanobind_bazelfrom 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 acc_binary.Follow-up of #164891, just wanted to draw this up to visualize how building bindings with
nanobind_bazelfrom 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.