-
-
Notifications
You must be signed in to change notification settings - Fork 507
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
ENH add global pin for pybind11-abi #849
Conversation
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please create an issue in pybind11-feedstock
about why we are doing this and ping conda-forge/pybind11
team there
@bluescarni do you have an example in code of what goes wrong or a link? |
I'll try to collect here a few useful links. First, from the official pybind11 docs (https://pybind11.readthedocs.io/en/stable/upgrade.html#stricter-enforcement-of-hidden-symbol-visibility-for-pybind11-modules):
This is admittedly a bit vague. More concretely, see this issue report pybind/pybind11#796 where the pybind11 author states:
The where it seems like the versioning of the internals does not depend only on the pybind11 version, but also compiler, stdlib, etc. I'll try to add some more info later if I find anything else. |
Thanks @bluescarni! I made an issue here @isuruf: conda-forge/pybind11-feedstock#53 Good idea to ping the dev team for their input! |
bump here @conda-forge/core @conda-forge/pybind11 |
Let's wait for more info conda-forge/pybind11-feedstock#53 |
That can't be true, right? Most of the things in pin run as build now are only host too. Do all of those entries do nothing and we don't have proper run exports? |
At least some of things there do have run exports, so those entries should be removed. There is at least one exception. Poppler ships libraries and doesn't have a run export AFAICT |
We probably need a |
Pybind11 has a Many projects are hardcoded to a specific Python version via git submodule, including "current master" much of the time. That's why the INTERNAL_IDs version exists - anytime the internal structure changes, it gets bumped. 2.5 seems to be the last time it was bumped (to 4, FYI). So a 2.5 extension should be able to work with a 2.6.1 one. I do get these mixed sometimes, but I think this means that pybind11 could always be listed in "build" and not in "host". |
@henryiii This same statement could be made about any ABI pin in conda-forge. If you don't ever plan on using two packages together, then they don't need to be pinned to the same ABI of some shared dependency. However, nobody can really be sure that two packages won't eventually be co-installed. So if there is some ABI-like limitation, we need to manage it. Otherwise, we will get a bunch of problems that conda-forge was actually built to solve, namely
Thus we absolutely should create pins for common dependencies, even header-only dependencies, that generate ABI or ABI-like incompatibilities. At minimum pybind11 needs some sort of export (either run or run constrained) to indicate in the metadata that things are incompatible. However, once you do that, you want all packages on the same version and so you need to pin. At least this is my understanding of things. Other more knowledgable @conda-forge/core members should comment too! |
The difference here is that there is not a strong coupling by default. If Boost-histogram and PyTorch have different versions of pybind11 (and, at least until recently, they did, quite drastically), it doesn't matter, there is no incompatibility at all. If you get both packages, you shouldn't even get pybind11; that's only a build dependency. Only if I write boost-histogram in such a way that it returns a PyTorch object, and then expect PyTorch to do the C++ -> Python translation for me does the ABI version matter. This sort of connection is pretty uncommon as far as I know, except in special cases, usually multiple extensions of the same package ecosystem. So Unlike most "run exports" packages, where you have to load the same library at runtime, there is no runtime component for pybind11. A "user" should never have it - it's for building only. I'm not actually saying that this is the wrong thing to do, by the way. It could be that if a package wants to participate in pybind11 pinning because there may be other packages returning items from them - for example, GooFit might return iMinuit objects after the iMinuit rewrite to pybind11, then there should be a way to opt into this. |
Right. So we make the global pin and then people opt-in via using pybind11 in host without a pin. If they instead pin it themselves or vendor it in their build, then they are opting-out. The global pin is not forcing people to use it, but it is the correct way to allow people to opt-in to it. |
Can you use it in build: to opt out, and in host: to opt in? That would be ideal, I think. (I'm still a bit rough with the difference between host: and build:) |
I am not sure @henryiii. Maybe someone on @conda-forge/core can weigh in? |
There probably also is not a way to specify that, for example, 2.5 and 2.6 are compatible? On average the pinning has been bumped roughly every 1-2 minor versions (and never in a patch version, which is good / most important) |
This can be changed in the run / run constrained export of bybind11 itself. We can also skip some pin changes as needed. |
we can have a |
Chiming in just to say that this is the exact usage scenario that motivated the initial discussion on the conda forge chat channel. In our case, we have a stack of interdependent C++ libraries, each one on a different release schedule and each one with its own package on conda-forge, and each one with its own set of pybind11 bindings. On the Python side, we need to be able to pass objects of type At the moment we are doing a manual pinning in all our recipes to a specific pybind11 commit, but of course this is hackish and it requires a simultaneous update of all recipes if we ever want to change the pinned version of pybind11. Having a more robust solution for this scenario in conda would be great. |
Ok. I propose we create the pybind11-abi metapackage. Then we can add run constrained on pybind11 itself for this package. Finally, we can use a strong run export of pybind11-abi on itself. Then if people need the abi constraint, then can include the pybind11-abi package in their host or build envs and it will propagate, forcing any downstream builds to require the same abi. Finally, we can put a pin on the abi package here. |
@conda-forge/core @conda-forge/pybind11 Is the plan above satisfactory? edit: copied here
|
I think it's fine, @wjakob thought so too. |
@henryiii Which internals IDs should we use? Is the Here is the code for reference
|
See this issue: conda-forge/pybind11-feedstock#63 |
@isuruf The abi package is made and just merged. I am going to merge this PR with the actual pin. We should add some repodata patches on the older pybind11 builds too. I will do that later today. |
Checklist
0
(if the version changed)conda-smithy
(Use the phrase@conda-forge-admin, please rerender
in a comment in this PR for automated rerendering)cc @isuruf @SylvainCorlay @xhochy