pybind11_abseil icon indicating copy to clipboard operation
pybind11_abseil copied to clipboard

Provide a fine grained mechanism for specifying `PYBIND11_ABSEIL_STATUS_MODULE_PATH`

Open jiawen opened this issue 1 year ago • 0 comments

I am using pybind11_abseil with pybind11_bazel.

I recently updated pybind11_abseil to HEAD and was surprised when my tests failed trying to import pybind11_absil.status. It took some time to track down the offending line to pybind11::google::ImportStatusModule(); on the C++ side and then to track down how the path is discovered.

With Bazel and assuming the default external repository name of pybind11_abseil, the corresponding Python import is from pybind11_abseil.pybind11_abseil import status. It took a while to find the relevant #define in README.md.

As the README accurately states, one must pass -D PYBIND11_ABSEIL_STATUS_MODULE_PATH=<path> directly on the command line (via bazel build --cxxopt="-D ...").

I was hoping for a more fine grained customization point via a macro that wraps @pybind11_abseil//pybind11_abseil:status_casters. At the moment, it is a pure pybind_library with no way to pass a defines or local_defines without setting --cxxopt globally.

jiawen avatar Feb 16 '24 20:02 jiawen