pybind / pybind/pybind11

[BUG]: finer grained ABI compatibility

Open
#3,793 17 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
18k
Forks
2.3k
Avg merge
5d 17h
Merged PRs (30d)
10

Description

Required prerequisites
Problem description

Based on the extensive discussion in conda-forge plus offline discussion with @isuruf, we think there may be a better approach to ABI compatibility with respect to compilers and c++ runtimes.

Currently, pybind11 uses a combination of various things. The one of interest here is the __GXX_ABI_VERSION. This appears to be too strict, especially for forward-compatible libraries commonly in use.

The suggestion is to replace __GXX_ABI_VERSION with

  • __GLIBCXX_USE_CXX11_ABI
  • __GLIBCXX_USE_DEPRECATED
  • __SEH__ (only in clang I think)
  • __SJLJ_EXCEPTIONS__

These capture the fine-grained, core ABI changes without being overly prescriptive. The last two are related to exception handling. There may be more macros to use to capture dwarf2 exceptions explicitly.

Thoughts @henryiii @isuruf?

Reproducible example code

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name files, tests, or provide a reproducible example. Start by locating pybind11's current use of __GXX_ABI_VERSION, then compare that logic with the proposed __GLIBCXX_USE_CXX11_ABI, __GLIBCXX_USE_DEPRECATED, SEH, and SJLJ_EXCEPTIONS macros. Done would require an agreed ABI-compatibility design and corresponding validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.