nicholasjng / nanobind-bazel

Bazel defs and rules for building Python projects with nanobind extensions.
Apache License 2.0
6 stars 0 forks source link

Add GitHub Actions job building and testing wjakob/nanobind_example #2

Closed nicholasjng closed 4 months ago

nicholasjng commented 4 months ago

Replicates the local directory structure that I set up on my machine:

$WORKSPACE/nanobind-bazel
          /nanobind_example

Since the bzlmod path is hardcoded right now, that setup needs to be replicated in CI.

nicholasjng commented 4 months ago

I'm guessing I need to -Wl,-dead_strip here somewhere (and do the equivalent on Linux & Windows).

ImportError: /opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/nanobind_example/nanobind_example_ext.cpython-38-x86_64-linux-gnu.so: undefined symbol: PyType_GetName

The offending symbol, PyType_GetName, was added in Python 3.11, which makes sense given that builds >=3.11 succeed.

Windows builds are a different story, where the DLL import apparently fails. Whether this is due to the extension name being hardcoded to .so or a different issue needs investigation. (Also, why is 3.11 building but not 3.12?)