Hi!
I just want to start by saying you are doing an awesome job working on Conan and it is very much appreciated how much time you are taking for questions and suggestions from the community!
I have quite an interesting use case of Conan but am struggling with some details of how best to implement - let me explain the situation:
I would like to deploy these applications and I think it would be really nice to be able to use conan for this. What I am talking about is writing a conanfile which has a set of applications listed as its requirements, this gives me the ability to:
I have a proof of concept that works pretty well but the main issue I am running into is how to handle the application dependencies. You'll notice that the above solution essentially treats the product as a C++ application and the actual applications as libraries that are supposed to be linked at the end. This imposes the requirement that there can be only one version of any given library present at the end (= linking step) even though in this case no actual linking is taking place.
Consider this case:
product-conanfile:
requires:
appA v1.0.0 ( --> requires libX v1.0.0)
appB v1.0.0 ( --> requires libX v2.0.0)
This will raise a conflict which in the usual C++ building/linking workflow is absolutely correct, but in this case I don't necessarily care that the versions are different because I am using Conan to specify and deploy my set of applications. In this case I don't care about constructing the full dependency graph - there are some libraries I might want to enforce the same version for, whereas some might be free to change e.g. if one application needs some new boost functionality I want to be able to update its boost version without necessarily caring that a different application uses an older version/
I realise this is not perhaps a supported use case but I was just wondering if you might have some tips/avenues that I might explore. My first instinct was to use build_requires but after reading https://github.com/conan-io/conan/issues/4753#issuecomment-481663245 it does not seem suitable after all. There are also 'private' requirements but their use seems to be discouraged - could these be an option?
Hi! First of all, thanks a lot for your kind words, I'll convey them to the rest of the team 馃槉
As you said this is not a use-case we are considering right now, we do have enough problems with the graph itself and the "dependency hell" trying to make provide consistency to the graph and, as you know, we are still facing many issues related to version_ranges, overrides, alias, build_requires,... So, the general answer is no, this use-case cannot be a priority for us right now.
Said that, let's see if we can do something to help you. I assume that you are using the deploy generator, so it is not a problem to gather the applications and libraries into your working directory, then you can explore different packaging approaches.
And I would say that the build_requires approach should work for you. In theory, a build_requires should create an isolated graph. Maybe we need to come back to #4753 and update the status of that issue, Conan has evolved since then.
What do you think if we (you and me) create a repo with a Travis job using the latest Conan, with your use-case and monitor what happens with those different versions in the graph? Although deploying the multi-application is not a use-case for us, build_requires creating isolated subgraphs are 馃槈
Hi!
Right now I am actually using the deploy() method: as I am statically linking everything I don't need to copy any libs into user space, only applications. I think it is certainly worth investigating using the deploy generator instead and weigh the pro's and cons of both approaches.
I would be delighted to collaborate with you on this issue and I am happy to set-up a repo which mimics my use case. However first it is time for the holidays and rest! I will get back to you about this in the new year!
To you and the rest of the team: A Merry Christmas and a Happy New Year! :christmas_tree: :smile:
I created a toy example here: https://github.com/acmeijer/conan-deploy which seems to work fine using build_requires - I will give it a try on my more complex use case to see if it still works!