conan-package-tools: ERROR: Remote recipe is newer than local recipe
Getting this with Jenkins, I thought I remember seeing that CPT had a force built in to override this error but I guess not. Should it?
conans.errors.ConanException: Remote recipe is newer than local recipe:
Remote date: 1524688506
Local date: 1524688499
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 30 (16 by maintainers)
I would try to explain what is this issue about and why we don’t force the uploads by default.
Conan, when you upload a recipe or a package, check the manifest containing the checksums of the recipe files (usually just a conanfile.py). If the contents are the same, Conan doesn’t care about the dates, because, actually will skip the real upload as it is already there.
But if the recipe is different, by default, we want to warn the user if you are trying to overwrite a newer recipe. How can it happen? well, if a slave takes less time to build a package than others, it could happen that the recipe uploaded is newer than the local one.
But why are they different? Usually, this is an issue with the CRLF characters. If you see some traces like the following you have the answer:
Here are some docs about it: https://docs.conan.io/en/latest/faq/using.html?highlight=crlf#packages-got-outdated-when-uploading-an-unchanged-recipe-from-a-different-machine
Otherwise, if they are different, maybe you are mixing or overriding on purpose different recipes in the CI? Several consecutive pushes? Should it be happening? These are some questions to clarify before take the decission of forcing an upload. Please, shed some light about you use case and we could enable a configuration to opt-in the package overwritting.
@michaelmaguire you mentioned a promotion process, could you explain a bit more?
No thanks, I just ran into these line ending issues…
Hi @NealRame, please, read https://docs.conan.io/en/latest/faq/using.html#packages-got-outdated-when-uploading-an-unchanged-recipe-from-a-different-machine
You are not alone, this problem is well known: https://github.com/conan-io/conan/issues/1400
Please, open a new issue in the future.
Note: It requires this plugin: https://plugins.jenkins.io/pipeline-utility-steps
In this example I use the
--json
argument toconan create
to get the created reference with an auxiliary function. I will add this to the Conan => integrations => jenkins: