-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[question] How to use a editable dependency that uses a different profile to the main consumer #17761
Comments
Thanks for your question. In general, when a particular package gets some settings different than the main project ones, the approach is to use per-package settings, see for example https://docs.conan.io/en/1.66/reference/profiles.html#package-settings-and-env-vars So something like:
Note that if you override the As side feedback, I guess that you might be aware that things like |
Thank you for the quick reply as always @memsharded. This is a solution to my problem, but it requires the consumer to be aware of the And yes, I am aware of the build profile feature of conan 1.x and 2.x. It is something my team need to tinker with to understand before enforcing the company's dev workflow. We're slowly trying to transition our workflow to conan 2.x by making sure our conan 1.x recipes use the conan 2.x recommended features. We're also aware that ConanCenter no longer supports 1.x packages so we will need to move if we want newer packages |
I am not sure if I understood. In the original question you said:
So it seemed that it was desired to not modify the DLL recipe/package. If you want to modify it, then what you were suggesting above, like more aggressive I think in general it is better to leave the
What is not possible neither in Conan 1 nor in Conan 2 is to modify settings of DLL from a consumer |
Oh I see. Little misunderstanding. I'm willing to make some changes to the dll's recipe like the one you mentioned since there aren't many significant changes and branches needed to support both editable and real behaviours in the same recipe. I think its worth testing the more aggressive def package_id(self):
# dll with a c interface, doesn't matter what it's compiled with or depends on
del self.info.settings.compiler
self.info.requires.unrelated_mode() |
While it is in editable, not much, as the binary location is mostly defined in the If you wanted to do the right changes to the For things to work fine when editable, the important point is to define a correct |
What is your question?
Conan: 1.66.0
OS: Windows 11
Hi, I am having trouble when installing a consumer package that uses a dependency that is built with a different profile (namely settings.compiler).
My situation is that the dependency built with a different profile than the consumer outputs a DLL. The DLL exposes C API to communicate, so there are no ABI issues between the DLL user and its internals. Because the DLL needs to work on Windows XP and newer environments and VS ended XP support with the v141_xp msvc toolset, v141_xp is the latest compiler the project can use and have designed a build profile to match this requirement. Some consumer projects for this DLL package only run on newer Windows environments so they can use new compilers and we've written profiles for this.
We designed the DLL package's recipe to accommodate these requirements. This can be seen below when the compiler and requirements are removed from consideration when calculating the package ID. When using a real package from the cache, this works as expected. However, when using this project as an editable, the consumers that use different profiles fail when installing. I'm not sure why this is an issue for the editable case.
Can the issue be explained and is there a solution for this issue without any major changes needed for the DLL package
DLL package's profile
Dll package's recipe
Example consumer profile
Error message
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: