autoremove: handle runtime dependencies#21574
autoremove: handle runtime dependencies#21574wu21-web wants to merge 40 commits intoHomebrew:mainfrom
Conversation
Added handling for runtime dependencies in autoremove.
Ensures build dependencies are only kept for formulae built from source, not for bottles
Added mock for `runtime_dependencies` to avoid InstanceDouble errors in tests. Get rid of test failure in CI workers.
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Looks good so far! Please keep this in the same PR and don't open new PRs, instead just squash your history if things get messy.
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
|
@wu21-web please ensure you:
|
|
OK. Thanks for the tip. |
Update styling
Fix brew styling
Remove uninstall option for Homebrew actions.
There was a problem hiding this comment.
Pull request overview
Updates Homebrew’s autoremove logic to better account for runtime dependencies so brew cleanup doesn’t suggest/removal-attempt formulae that are still required by currently-installed formulae after dependency graph changes (Fixes #21511).
Changes:
- Update
Utils::Autoremoveto consider runtime dependencies in addition toinstalled_runtime_formula_dependencies. - Modify/remove existing autoremove specs (currently replaced with non-test code).
- Remove various inline comments/version annotations from the CI workflow.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
Library/Homebrew/utils/autoremove.rb |
Adjusts removable-formula computation to include runtime dependencies when building the “keep” set. |
Library/Homebrew/test/utils/autoremove_spec.rb |
Replaces the RSpec test suite with a duplicate module definition (breaks test coverage). |
.github/workflows/tests.yml |
Removes pinned-action version comments and several rationale comments from CI workflow steps. |
Comments suppressed due to low confidence (1)
.github/workflows/tests.yml:183
- The removed explanatory comments around these steps (e.g. rationale for caching/CI behavior) make the workflow harder to maintain because the decisions are non-obvious. Please keep/restore the rationale comments unless they were incorrect.
run: brew install-bundler-gems --groups=all
- name: Check for uncommitted RubyGems
working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
run: git diff --stat --exit-code Library/Homebrew/vendor/bundle/ruby
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
simplified line 77 Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rename context Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Re-add comments for easy documentation. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Your AI is making a bunch of shitty unnecessary changes. Please rereview this line by line and remove unnecessary changes or close this PR.
|
Sorry for being unable to handle the issue. I don't take programming as a career and I am only a starter with ruby. My apologies for that. |
Fixes #21511
brew lgtm(style, typechecking and tests) with your changes locally?Yes. Github Copilot was used in some debugging and styling modifications. I came up with the fix. I referenced sobert docs to verify the changes applied.
I noticed that the previous solution of modifying cleanup.rb in /Library/Homebrew/cmd and /Library/Homebrew/ is over-complicated and incorrect. Modifying autoremove.rb in libutils would be much easier.