-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does pybind11-abi
shield from using different versions of GCC
#77
Comments
Cc @conda-forge/core we may need to rethink this or do proper migrations for compiler bumps? Colleagues of mine are seeing this too. |
That would be great! This really send me down a swamp with a lot of hand-work that I seek to avoid with conda-forge |
I wonder if we need to rebuild the Abi package with compiler bumps and then kick off a pybind11 Abi migration. |
We’ll see. I don’t fully understand the constraints here. |
A note is that I did not have the same issues on all platforms. So I don't know of certain compilers or certain updates are more prone to this |
As mentioned in pybind/pybind11#3751 the fix is to turn off |
The workaround I would say, it does come at a small risk I think |
What small risk? |
That's overly pessimistic. We have thousands of packages built with gcc 9 and they work fine with gcc 10 and pybind11 is the only package that gets affected this? That's highly unlikely. |
You might be right, honestly I did not invest in understanding how rare the segmentation faults were, I was just naturally cautious. But in case you are right it should be common practice on conda-forge. Can this be done when the feedstock is built? |
This was very much overly pessimistic. There were rare, hard to track down segfaults, but people were doing things like mixing different compilers, etc. So this was completely locked down (with the comment that it was overkill). If someone wants to more properly decide when things are compatible and when they are not, then that would be welcomed. One "special" thing about pybind11 though is that it depends on |
We've found another issue with pybind11 across gcc major versions. It appears to be related to exception handling in C++ so not sure if that is the same as above. We are working on a minimal working example. |
Here's my reproduction code for the exception handling. Build |
@isuruf This reminds of the exception passing issue we had on osx due to libcxx_abi differences. I wonder if maybe there is an ABI break in the equivalent libs for gcc10 and gcc9? |
No. see the linked pybind11 issue of how to workaround this |
Forgive my ignorance on this. Is your suggestion
|
|
I don't follow the above TBH. We have to have This raises a policy question. Is our intent to force all of conda-forge into a more generous ABI posture wrt to compilers and pybind11? This may have impacts on external users of our pybind11 packages who expect the stronger ABI protection. |
I meant add that to activation script, not in the build script.
pybind11 is a header only library. That makes no sense.
Yes
As I said before, this is overly pessimistic and I don't see why people insist on a "stronger ABI protection" when |
We could patch the headers in the header-only library to always set
Right of course. If we patch the headers in the feedstock, we force folks. If we include the defines with the abi package via an activation script, we only get a more generous ABI compat for people who use that package, but people who don't use I am totally fine with the more generous ABI compact in general. I simply don't understand completely how the steps above get us there. It seems to me that we cannot rely on the |
I'll add something subtle that not everyone may fully grok and took me a while. pybind11 is header-only, but if you pass stuff between two pybind11 built codes at the C++ level, you get a dependence on their internal ABI. I suspect folks might be doing this in conda-forge without knowing to use the pybind11-abi metapackage to mark the builds. If we only use that mechanism, then we might still leave things buggy. It would be buggy for doing something wrong, so not the worst thing that ever happened. |
Permit me to weigh in here. I find it difficult to judge to which end Therefore, I see the following options:
Now my favourite:
|
I vaguely remember at one point reading about an ongoing effort to turn pybind11 into a compiled library. Is this still happening? It seems like with a compiled pybind11 all these ABI compatibility issues could be solved within the existing conda-forge infrastructure without having to hard-code compile definitions or rely on a special |
I'm having problems due to different libraries having been compiled using different versions of GCC, see pybind/pybind11#3751 .
My question: does having
shield me from this in the future?
Is there a way to detect such an issue also for a local build of library being used to a build on conda-forge ?
The text was updated successfully, but these errors were encountered: