-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Refine ask‐option dependency resolution and strengthen tests #20033
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
Conversation
…h dependencies and dependants is upgraded as expected
I saw a problem, with this example, I don't know if it's the expected behaviour. |
@tyuwags Not sure I understand the question. It's expected that some dependencies may need to be upgraded and others may not. Does that answer your question? |
Thanks for the reply! Let me clarify the issue a bit: In this example:
However, during the actual upgrade, Homebrew skips sqlite because its direct parent (python@3.13) is not being rebuilt. So my actual question is: Should my function consider only the outdated recursive dependencies whose parent will also be rebuilt? |
This is expected.
Thanks for this. Ideally this would be done by using the same code rather than having two code paths that have to mirror each other. |
That was my initial thought as well. However, from what I’ve seen, brew doesn’t seem to know upfront which formulae will need to be upgraded. Instead, it determines the necessary dependencies and dependents dynamically using: Upgrade.upgrade_formulae formulae_to_install
Upgrade.check_installed_dependents formulae_to_install What I'd like is for these functions to return the full list of formulae that need to be upgraded, without performing the upgrade yet. Then, I could pass that list to a separate function that handles the actual upgrade logic. This way, I could reuse the existing resolution logic and keep everything consistent, without duplicating or mirroring code paths. |
@tyuwags I'm open to seeing PR(s) to modify those functions to the logic can be shared. Let me know when this one is ready for review and maybe make it draft until then? |
# Conflicts: # Library/Homebrew/test/cmd/upgrade_spec.rb
@MikeMcQuaid, everything is ready, everything is resolved |
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.
A few suggested style tweaks but the bulk of this looks great, thanks @tyuwags! Feel like we're really close now. Gonna ask a few other maintainers to review.
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.
Looks good overall. Mostly some naming comments here, though with a couple of logic comments at the end which are more important.
Co-authored-by: Bo Anderson <mail@boanderson.me>
Co-authored-by: Bo Anderson <mail@boanderson.me>
Thanks @tyuwags! |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?These changes resolve an error a finding the whole hierarchy for the ask option, pruning the build dependencies and be able to find the whole dependants hierarchy of the formula.
These changes also create and update tests to make sure the whole hierarchy is displayed in the ask prompt.