-
Notifications
You must be signed in to change notification settings - Fork 991
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 conan center with a specific version of conan client ? #12190
Comments
Hi @johan-boule There are a few different questions here, lets try to address them:
Regarding the lockfiles, it is true that 1.X lockfiles are complicated and challenging to master. Conan 2.0 is a huge improvement over that, it will allow 1 single
This is true that it would be convenient. We did some proof of concept in the past, and this is scheduled to be resumed after 2.0 (what we called the 2.X target): #8211 |
Thank you for the reply. My post was a bit too long, and my main point perhaps got lost. Thank you very much for smoothing the transition towards Conan 2. While we are still using Conan 1.x, we are in fact already using the forthcoming features of 2.x that have been backported to 1.x. We are already using "RREV" lock files committed into our git repo (we didn't need to commit PREV locks so far). And we are already using our own conan repo to upload the recipes and binary packages we need. In fact, our CI doesn't have internet access and exclusively uses our in-house conan repo. We are also already using separate conan home dirs for each build/branch as is recommended, with a shared download-cache to avoid redownloading the same packages between builds of different branches when they are the same. My issue is that, when I want to add or upgrade a dependency, on a dev box, I temporarily enable the conan center repo, and then everything falls apart because currently the conan client doesn't seem to have a mechanism to avoid trying to use recipes which are for higher versions of conan. It wouldn't make sense to upgrade the conan client on my dev machine, because I need to stick to the same version as our CI. So I am hoping that Conan 2.x includes a plan to address this specific point. As a workaround, I'm pondering whether we should make an internal mirror of Conan's Git repo so that our CI can pip install from it any version from a tag, and put it into a "venv" isolated inside the build directory. In other words, have a different conan version for each branch our CI is building. With that, I might "afford" upgrading conan just to add or upgrade a dependency and enjoy browsing conan-center without trouble :) Alternatively, we will produce a new container image with an upgraded conan version every time we want to touch a dependency. Every build/branch will use a different version of the image. This might be the easiest route. |
I am afraid this is not possible. Even if recipes have a
Yes, in practice the problem is approached in the other way: first you upgrade your Conan version in CI and dev machines. We do a ton of effort, due to our stability commitment not to break things, so it should be safe in most cases to update it. Having a CI process to do this, and control which Conan version is used in prod is recommended. Then, once you have an updated Conan version, you can try to update to the latest ConanCenter packages. |
Maybe I'm not entirely thinking this through, but I think the constraint on the conan version shouldn't lead to the same NP-hard problem as constraints between libraries: the version of conan is not an adjustable variable, it's a given constant. |
Now that Conan 2 is out, is there any chance that you implement a server-side filter so that only the recipes made for a Conan version less than or equal to the client's version are returned ? |
I am afraid this is still not possible. This kind of server side functionality is very challenging to implement and maintain, it requires a full new version of the protocol, give time to the many vendors that implement the protocol to adopt it, etc. Not to say that it would still be an NP problem, yes. When you get to a specific recipe that declares compatibility with a given Conan version, that specific recipe can contain So this is not realistically possible. Thanks very much for your feedback, I am closing this ticket as not planned. |
We are facing some complications using the conan center repository for our CI builds.
For CI stability, we want to decide when we upgrade the conan client, so we usually don't have the latest version.
In order to use packages compatible with our version of conan, we enabled revision support and create lock files to depend on specific revisions of the packages, and also create a separate CONAN_USER_HOME for each build (i.e. for each branch).
While this is working, I must say this is very painful to maintain.
Indeed, whenever I want to add or upgrade a dependency, this is what I'm doing (perhaps by lack of better knowledge):
Is there some way of handling this which doesn't involve all those manual actions ?
Or else, does Conan 2 have plans to address this ?
I think we would be fine if the conan center repository could be addressed with some global revision number that would only make visible the recipes and binary packages that where available at that point in time, even if that prevent seeing new libraries.
Basically, we are fine with having the notion of a globally versioned repository, like classic linux distros do, which also has the big advantage of solving version conflicts.
Also, as a side question, since conan center stores binary packages, why doesn't it store source packages ? By source, I mean the whole source code of the libraries. We would be much more confident if our ability to rebuild everything from scratch didn't depend on "random" external websites and only on our in-house repo or conan center itself. Just like linux distros have their own copy of all the source code of all packages. An other reason is our enterprise network is configured in a quite complicated way which involves proxies and overridden certificates to allow access to each website. I often see conan trying to download from e.g. sourceforge or whatever and fail because it doesn't have the right enterprise certificate for that particular website (we have to synchronise its cacert.pem with the system certs). It would be much more simpler if we only had to setup the certificate/proxy for conan center only.
As a workaround, is there a way I can force conan to generate a true self-contained source package so that I can upload it to our in-house repo ?
I was pondering whether the question about source packages should be asked as a separate topic, but I think source and revisions are intertwined, or actually, should not be. My idealised repository structure would be something like this:
Imagine I have conan 1.48 (so, neither 1.45 nor 1.50), unless I specify some particular recipe revision, I would expect it to download conan-1.45/recipe-revision-2.tgz (because presumably conan 1.48 can use recipes made for 1.45), and upstream-source.tgz (which is independent of conan's version or recipe)
In this pseudo view, I'm using revisions as incremented numbers, but conan uses some hash of course. How conan knows which revision is the latest is a mystery to me though.
The text was updated successfully, but these errors were encountered: