-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[package] pybind11 ignores targets and always link against the whole list of components #6605
Comments
Hey guys sorry for tagging you here but you're the experts here and I'm a bit stuck. Can the general target be changed? Or is it tied to the |
This can be done by setting Pybind11 is already doing the second part, so you only need to set cpp_info.names |
Not sufficient, |
Exactly. I want to keep the namespace but change the main target name. Is that even possible? |
Mmmmm, indeed, I didn't think enough before replying to this one, sorry! |
Should I open a different issue there? I know there is a way of moving issues around, but I don't mind opening a new one there. |
I think this could be covered by a previous discussion we had here conan-io/conan#8533 (review) |
IIUC that discussion is about creating aliases for the conan generated targets. In this case we need to rename the generic one since it conflicts with a real pybind11 target. |
@ericriff I was thinking about the second approach but it wouldn't be more like a workaround than a real feature. I have been working again with the components in the recipe and the information you provided in the issue and I agree the main problem here is that in the recipe you cannot override the general target linking with other targets. In the
and while this allows you to effectively create your own I have made a POC moving the target linking into the if-clause above like so:
and got the following result: Modifications in the recipe were minimal: just removed all the "requires" from the components to let the pybind11Common.cmake do it. Please let me know what you think about it and I would try to create a branch with my modifications so you can give it a go. Thanks! 😄 |
See #6938 for modifications in the recipe |
Is there any good workaround for this? Among the unwanted consequences are:
These issues are preventing me from updating from |
This is based on https://github.com/conan-io/conan-center-index/blob/7290d5b2e73aa8a30c935c511016d7e9d4834953/recipes/pybind11/all/conanfile.py which was the version before the commit that caused conan-io/conan-center-index#6605
We experience the same problem and had to manually build our own target from the variables defined by Is there anything added with the conan versions released since then that helps with this issue? Does the new |
Currently yes, but |
Just came across this problem. It took serious effort to debug and discover that this is the bug. In our case as soon as we added |
See #13283 for a draft PR in an attempt to resolve this issue. |
This works around our old friend conan-io/conan-center-index#6605.
This works around our old friend conan-io/conan-center-index#6605.
This works around our old friend conan-io/conan-center-index#6605.
Did this ever get solved? I see #13283 was merged but I still see |
pybind11
is a headers only library, but it exposes a bunch of targets that the consumer can link to in order to inherit build options and flags.Here it is the complete list
https://pybind11.readthedocs.io/en/stable/compiling.html#advanced-interface-library-targets
After the components update to this recipe, our build time increased significantly and we've tracked it down to the
lto
flag that wasn't there before.We use
pybind11
in 2 different ways, the standard way withpybind11_add_module(module NO_EXTRAS)
(the no extras should prevent the lto flag from being added), and we also use the "advanced" modeadd_library(module)
+target_link_libraries(module pybind11::module)
. In both situations we now have the lto flag, as if we were linking topybind11::lto
.I think it is a combination of 2 issues:
Conan just declares a bunch of components and it expects the build module to configure them. The main issue is that the build module links all the targets to
pybind11::pybind11
, which I think should only contain the headers, but in conan that means the whole list of components, right?All the components depend on
main
, which is also called pybind11::pybind11?I'm not completely sure if that is the issue, I'm still diving into it. Posting here to hear from the conan experts since I'm not big on components.
Could we make the main target that groups all other targets something different than
pybind11::pybind11
? Maybepybind11::pybind11_all
? Officially there is no target that groups everything.@danimtb
This is an extract of the build module
The text was updated successfully, but these errors were encountered: