pybind / pybind11

Seamless operability between C++11 and Python
https://pybind11.readthedocs.io/
Other
15.82k stars 2.12k forks source link

Build platform ABI tag improvements #5437

Open wjakob opened 2 weeks ago

wjakob commented 2 weeks ago

With pybind11 and nanobind considering changes to the platform ABI tag, there is a nice opportunity to make them consistent with each other. This would make it potentially possible to later use that ABI tag to safely dispatch function calls between the two libraries.

This commit adapts the ABI tag as follows:

rwgk commented 2 weeks ago

I just merged #5375: the code changed here now lives in include/pybind11/conduit/pybind11_platform_abi_id.h

rwgk commented 2 weeks ago

I had second but inconclusive thoughts about using #error vs #define "UNKNOWN":

We could have provisions for both:

This way we'd be forced to update the code here (pybind/pybind11), but not the rest of the world. This might be convenient in some situations, but I still believe will backfire in others. I'm not sure what'll be best overall.

rwgk commented 2 weeks ago

FYI I just created #5439. It may take me a few iterations there to get all GitHub Actions to pass. I'll then post an overview of the PYBIND11_PLATFORM_ABI_IDs seen in the logs. (I'll tag people when I reach a stage suitable for reviews.)