Skip to content
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

Rewrite rules/macros in Starlark for greater flexibility #38

Open
nicholasjng opened this issue Sep 5, 2024 · 1 comment
Open

Rewrite rules/macros in Starlark for greater flexibility #38

nicholasjng opened this issue Sep 5, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@nicholasjng
Copy link
Owner

This project started as a small collection of macros for nanobind in Bazel, heavily borrowing from pybind11-bazel and its macros.

Some design differences and changes from nanobind (most notably, the library part and the stable ABI facilities) have made it necessary to expose a number of feature flags to fully take advantage of nanobind's configurability.

Unfortunately, the combination of different features (SABI versions, target platforms, build mode, now free-threading coming up) have lead to a combinatorial explosion of config options in nanobind-bazel.

I'm not sure how many people inspect the Bazel graph on the daily, but I imagine nanobind-bazel's to look pretty horrifically cluttered.

What would be a better solution is to rewrite the macros as rules with proper Starlark implementations, where you can (if I'm not mistaken) get a flag's value, and proceed to do different things with if statements based on the obtained values.

This would also make it easier to just ignore certain ill-formed combinations, e.g. SABI builds with Python versions <3.12. It would also help to not produce two .so build artifacts in the SABI case, one of which is completely unused.

@nicholasjng nicholasjng added the enhancement New feature or request label Sep 5, 2024
@nicholasjng nicholasjng self-assigned this Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants
@nicholasjng and others