Skip to content
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] conan2 local integrity check of cache contents based on manifest #13499

Closed
1 task done
bbandix opened this issue Mar 22, 2023 · 4 comments · Fixed by #13502
Closed
1 task done

[question] conan2 local integrity check of cache contents based on manifest #13499

bbandix opened this issue Mar 22, 2023 · 4 comments · Fixed by #13502

Comments

@bbandix
Copy link

bbandix commented Mar 22, 2023

What is your question?

Hi!

We started an experimental migration of our packages to conan 2.x.

In our integration with conan 1.x we used the following to check the integrity of packages in the local cache based on the manifest:

conan upload --skip-upload --all -c '*'

In conan 2.x --skip-upload is gone, thus the above does not seem to be possible any more.

Question:

  • Is a local integrity check based on the manifest possible in some other way or is the recommended way to implement a custom command for this?
  • Perhaps a conan cache check PATTERN sub-command to conan cache would be the right place for such a feature

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@bbandix bbandix changed the title [question] Local integrity check of cache contents based on manifest [question] conan2 local integrity check of cache contents based on manifest Mar 22, 2023
@memsharded
Copy link
Member

Hi @bbandix

It is true that Conan 2.0 removed this "skip-upload" case that can be leveraged for checking packages checksums.
I think we might want to introduce this check, probably as a conan cache subcommand, labeling this as a possible feature.

In the meantime, it should be relatively easy to create your own custom command to do that, because the api exposes it, something like this could be enough:

    ref_pattern = ListPattern(args.reference, package_id="*", only_recipe=args.only_recipe)
    package_list = conan_api.list.select(ref_pattern, package_query=args.package_query)
    conan_api.cache.check_integrity(package_list)

The https://docs.conan.io/2/examples/extensions/commands/clean/custom_command_clean_revisions.html docs might help.

@bbandix
Copy link
Author

bbandix commented Mar 22, 2023

Hi @memsharded,
Thanks again for the quick answer!

@memsharded
Copy link
Member

As this is quite straightforward, I am directly proposing it for built-in in #13502, lets see how it goes.

@memsharded
Copy link
Member

#13502 was merged, conan cache check-integrity will be in 2.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants