-
Notifications
You must be signed in to change notification settings - Fork 992
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 handle different versions of the same requirement #6391
Comments
Hello @bog-dan-ro and in the consuming package you would have in requires both kuesa and qt. Wouldnt this fit all your needs? So something like this.
Now in Application A you would do:
In application B you would do:
Now when you would try to build the Application B it would tell you that you didnt prebuilt the kuesa with qt/5.14 << you can do I may be missing something and I am not that knowledgeable in conan but above should work? |
Thanks a lot for your reply! Building the dependencies for package B is what we try to avoid by using conan. It's needed to decrease the time needed by our CI to check every patch. I think we'll go with solution 2: we'll add a I hope in conan 2.0 to have an easier way to do it. |
Hello @bog-dan-ro After you did After that you wouldn't need to recompile kuesa or qt in that particular configuration again. |
Hi @fulara, I did a quick test with your suggestions, but, sadly, conan (1.21.1) doesn't download the right kuesa package, the one built with a different Qt version. These are my test files:
It warns me about the requirements override, but it still using the version built with 5.12. |
Hello @bog-dan-ro
minor_mode() switch does not go into Scroll down a little bit and you will see:
After that be sure to check whats the conanmanifest of your package! you will see there that it will probably have Let me know if it works for you now :) |
Hi @fulara Many thanks, it works perfectly! Now I need to figure out how to pre-build these packages for all qt versions ;-) . |
Hi! Thanks very much @fulara for the great explanations. Indeed the default At the moment it sounds difficult to do it, but I think it might be worth in 2.0 too to try to define a more comprehensive scope checking, and raise an error if So if the above is working, and with these 2 things the UX will improve, maybe we can close this issue? Thanks for all the feedback! |
@memsharded yes, please close it, though without #6384 it will be hard to package Qt 5.14.x for Android :) . |
Closing this as outdated/solved in Conan 2 |
Hi,
I'm facing this problem especially with Qt (but the same problem applies to other libs as well e.g. openssl).
Let's take an example to be easier to understand:
I want to create a package for kuesa. The problem is that the same kuesa version can be built with multiple Qt versions (e.g. 5.12.x, 5.13.x, 5.14.x), but depending on what qt version you build it, it will enable different features (e.g. kuesa built with qt 5.14 will have more features than kuesa built with 5.12).
The problem comes when application A requires Qt 5.12 and kuesa 1.0 and application B requires Qt 5.14 and kuesa 1.0. How to tell conan to download kuesa 1.0 built with Qt 5.12 for application A and kuesa 1.0 built with qt 5.14 for application B?
What is the best solution to handle this situation?
I explored a few solutions, but all of them have some disadvantages:
1.a. add qt version to the package version: kuesa/0.10.0-qt_5.12@user/channel
1.b use different channels for each qt version: kuesa/0.10.0@user/qt_5.12
Pro:
Con:
conanfile.txt
(andconanfile.py
) as we need to change these files to specify which qt version we like to use for each package (unless there is a way to use placeholders in bothconanfile.txt
andconanfile.py
).Pro:
conanfile.txt
nor toconanfile.py
!Con:
settings.yml
for each problematic package and we need a profile for each combination (can be easily handled using conan config install).Pro:
settings.yml
nor toprofiles
conanfile.py
besides the followings:Con:
Is there a better solution that I missed?
The text was updated successfully, but these errors were encountered: