-
Notifications
You must be signed in to change notification settings - Fork 207
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
Update nanobind-bazel docs with latest developments #842
Conversation
`nanobind_bazel` v2.4.0 was released on the BCR. The MODULE.bazel code example was thus updated, as is tradition, along with two more user-facing changes: 1. The minimum Bazel version was increased to Bazel 7, since we need to use a sufficiently new `rules_python` for free-threading support. 2. The `@nanobind_bazel//:free_threading` flag was removed, since it was not that useful - you still needed to give `rules_python`'s free-threading flag separately to request a free-threaded toolchain, and supplying it did not even guarantee a free-threading build. Now, we just use `rules_python`'s free-threading flag value directly instead.
Actually, onecomment: it may be useful to keep the free-threading attribute to as an opt-in (similarly to how this is implemented in the CMake build system). Upgrading a package to correctly work in a free-threaded environment can be quite complex. One checkpoint along the way is just to run it as-is (not opted in), in which case the free-threaded features of the interpreter are turned off. Not very useful if your goal is parallelism, but helpful for bring-up of large multi-extension projects. |
I agree - in fact, Also, no free-threading is the default, so we can build regular CPython 3.13 just fine (in fact, that's what I'm still doing in nanobind_bazel CI). Does that match your expectation? |
That makes sense! Is this documented somewhere? Otherwise, it may not be easy to infer for users. |
Afraid not. I can add a paragraph on free-threaded builds to the Bazel doc, either in this PR or a follow-up. |
Let's put it here, we can keep this PR open a little longer. |
Presents the necessary toolchain setup in a code block, and mentions the flag name that must be set for a free-threaded libnanobind build.
Done. On a side note, the docs venv setup is broken at least on my MacOS machine: When pip-installing docs/requirements.txt with Python<3.13, I get an error from sphinx about missing
That one can be fixed by running
Just wanted to put this out there, since there are other people working on the documentation as well. EDIT: The second one is about |
Thank you! I'll make a note to transition to a newer version of Sphinx in the future. |
nanobind_bazel
v2.4.0 was released on the BCR on christmas. The MODULE.bazel code example is thus updated, as is tradition, along with two more user-facing changes:rules_python
for free-threading support.@nanobind_bazel//:free_threading
flag was removed, since it was not that useful - you still needed to giverules_python
's free-threading flag separately to request a free-threaded toolchain, and supplying it did not even guarantee a free-threading build. Now, we just userules_python
's free-threading flag value directly instead.