-
Notifications
You must be signed in to change notification settings - Fork 361
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] Conan 2 lockfiles: How-to lock pkgid and prev? #3869
Comments
Hi @SzBosch Thanks for your question. Lockfiles in Conan 2 do not lock the
The Please let me know if this clarifies your question. |
Hi @memsharded, thank you for the quick answer. What I basically understood now is earlier (e.g. as explained here: https://blog.conan.io/2019/09/27/package-id-modes.html) the pkgid was only calculated from settings, options and requirements. Now it has changed to the pkgid is calculated from settings, options, requirements AND the content (files), correct? With which version has this exactly changed? |
No, the But Conan 2 assumes that the configuration is correctly defined. If the source input is the same (same |
Unfortunately it seems very easy for people (and even in automated CI/CD cases) to screw up this model by specifying a version in the conanfile.py, executing "conan export-pkg" and "conan upload", then modifying a file (which is not recipe relevant), forget to change the version in the conanfile.py and execute again "conan export-pkg" and "conan upload" resulting in an additional prev for the same version, rrev and pkgid. Is there any possibility with conan to prevent or at least detect this issue? |
The first important recommendation, as documented in https://docs.conan.io/2/knowledge/guidelines.html, is that developers shouldn't be able to upload directly to production repos. Of course they can upload to "playground"-like repos, but not to production repos. Then, for CI, it is way more unlikely to screw it up. In the first place, they are not locally modifying files at all, not using local flow with So we haven't seen issues with this in practice, and basically all occurrences of this situation happened because the process was "over-building" with some It is important to note that one of the reason this was dropped in Conan 2 is because even if this an "inefficiency" and users might be unnecessarily rebuilding from source and wasting resources, the resulting binaries or the new
Detecting these inefficiencies is relatively easy, doing a |
Thanks for the questions and explanations. This thread would make a good documentation. This is all clear. |
Thanks for the feedback @johan-boule If @SzBosch also thinks it is more clear now, I can move it to the docs repo to add there some further explanations. |
Dear Conan team,
earlier with Conan 1 a lockfile contained the full reference incl. pkgid and prev.
With Conan 2.0.x this information is not anymore in the lockfile by default. But you provided a parameter "--lockfile-packages" which brought back this information.
Now with newer Conan versions (tried 2.4.1 and 2.6.0) this parameter is gone from the documentation, but can be still given on the command line, but giving an (non-breaking) error, e.g.:
What is the correct way to get a full lockfile incl. pkgid and prev?
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: