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

[develop2] Cache clean #13050

Merged
merged 3 commits into from
Feb 6, 2023

Conversation

memsharded
Copy link
Member

@memsharded memsharded commented Feb 3, 2023

Changelog: Feature: Add conan cache clean subcommand to clean build and source folders.
Close #11562

@memsharded memsharded added this to the 2.0.0-beta10 milestone Feb 3, 2023
Copy link
Contributor

@SSE4 SSE4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it safe? what happens if it raises in the middle of removal, will it leave some incomplete or inconsistent cache state? (or user just hits Ctrl-C/Ctrl-Break in the middle of the command).

@memsharded memsharded marked this pull request as ready for review February 5, 2023 01:23
conan/cli/commands/cache.py Outdated Show resolved Hide resolved
Copy link
Contributor

@czoido czoido left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the comment about the formatter and that the command required at least one argument saying what you want to clean.

@czoido
Copy link
Contributor

czoido commented Feb 6, 2023

is it safe? what happens if it raises in the middle of removal, will it leave some incomplete or inconsistent cache state? (or user just hits Ctrl-C/Ctrl-Break in the middle of the command).

@SSE4 I think this should be safe as we are not touching the database, if something goes wrong, a second execution would fix the clean that did not finish.

Copy link
Member

@AbrilRBS AbrilRBS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +75 to +76
package_list = conan_api.list.select(ref_pattern, package_query=args.package_query)
conan_api.cache.clean(package_list, source=args.source, build=args.build,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love how clean this looks

@czoido czoido merged commit 6207474 into conan-io:develop2 Feb 6, 2023
@memsharded memsharded deleted the feature/develop2_cache_clean branch February 6, 2023 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants