pybind11 icon indicating copy to clipboard operation
pybind11 copied to clipboard

Build platform ABI tag improvements

Open wjakob opened this issue 1 year ago • 3 comments

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:

  • It removes PYBIND11_INTERNALS_KIND that was neither used nor documented.
  • It adapts the MSVC ABI tag to be less stringent (see PR #4953)
  • It adapts the GCC ABI tag to be less stringent.
  • It adds a check for a Clang/libc++ ABI tag that wasn't present before

wjakob avatar Nov 10 '24 15:11 wjakob

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

rwgk avatar Nov 10 '24 20:11 rwgk

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

We could have provisions for both:

  • Use #error in pybind11 GitHub Actions.
  • Use #define "UNKNOWN" otherwise.

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 avatar Nov 10 '24 20:11 rwgk

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.)

rwgk avatar Nov 10 '24 23:11 rwgk