-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
cleanup: fix various cases where cache wasn't being removed properly #16977
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to add regression tests for these bugs?
file = file.resolved_path | ||
|
||
filename = file.basename.to_s | ||
return false if formula.bottle.blank? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file = file.resolved_path | |
filename = file.basename.to_s | |
return false if formula.bottle.blank? | |
return false if formula.bottle.blank? | |
file = file.resolved_path | |
filename = file.basename.to_s |
Nit: Avoid extra work if the bottle doesn't exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @Bo98!
Agreed regression tests would be nice but don't want this to be blocked on that for the tag tomorrow.
This seems introducing a regression that may aggressively cleanup cached bottle downloads when bottles were ever rebuilt. For example, with latest |
Probably the first commit. Rebuilds were previously never removed because it was completely broken. It's possible that the original intended behaviour is now slightly too aggressive or I missed an edge case. Will check your example. |
Can't reproduce the cached bottle part but have reproduced the manifest issue and have fixed: #16992 |
Actually it seems also related to the formula's I just tried |
It turns out that #16992 also resolves the issue for formulae with non-default |
@lembacon Thanks for reporting and testing 🎉 |
Ah yeah that makes sense if it's glib rather than ncurses. Weren't using |
version_scheme
is bumped,formula.version > version
will not be true. We cannot extract the version scheme here, but we can special case the latest-version-installed case to make that!=
which should cover most scenarios.brew cleanup <formula>
failed to check any associated bottle manifests and those would only ever be removed by the timed prune._bottle_manifest
suffix when parsing the formula name.Will probably make a tag with this given it's causing some confusion/concern.