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

upgrade: check for already broken dependents #8500

Merged

Conversation

scpeters
Copy link
Member

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew tests with your changes locally?

After upgrading a formula, it currently checks for broken dependents after upgrading any outdated dependents. If there are no outdated dependents, it exits early and doesn't check for broken dependents. This adds an earlier check for already broken dependents so they can be fixed even if there are no outdated dependents. (sorry that's kind of a mouthful)

I duplicated the block that checks for broken dependents; let me know if it should have its own method instead.

I haven't profiled this, but I expect it will perform linkage checks for dependents more often.

After upgrading a formula, it currently checks for
broken dependents after upgrading any outdated dependents.
If there are no outdated dependents, it exits early
and doesn't check for broken dependents.
This adds an earlier check for already broken dependents
so they can be fixed even if there are no outdated dependents.
@MikeMcQuaid
Copy link
Member

I duplicated the block that checks for broken dependents; let me know if it should have its own method instead.

Yes, I think this would be desirable.

This adds an earlier check for already broken dependents so they can be fixed even if there are no outdated dependents.

So this fix, if I understand correctly, is to fix the case where they haven't been broken by this brew upgrade but may have done by e.g. a previous one or user action?

This behaviour (and possibly your previous PR) may also warrant being added to cmd/install.rb and cmd/reinstall.rb which also both perform some of these checks.

Just to call it out: it does seem potentially surprising that this would start reinstalling things that are unrelated to anything that's being upgraded. I think it's still probably the right move but might want to improve the messaging.

@scpeters
Copy link
Member Author

I duplicated the block that checks for broken dependents; let me know if it should have its own method instead.

Yes, I think this would be desirable.

I moved the logic to a check_broken_dependents method in the same file in 24e7f55

This adds an earlier check for already broken dependents so they can be fixed even if there are no outdated dependents.

So this fix, if I understand correctly, is to fix the case where they haven't been broken by this brew upgrade but may have done by e.g. a previous one or user action?

That's correct

This behaviour (and possibly your previous PR) may also warrant being added to cmd/install.rb and cmd/reinstall.rb which also both perform some of these checks.

Just to call it out: it does seem potentially surprising that this would start reinstalling things that are unrelated to anything that's being upgraded. I think it's still probably the right move but might want to improve the messaging.

Yes, if we make this change we should improve the messaging. Alternatively, we could put this behavior in a separate command brew rebuild_broken_bottles or brew linkage --rebuild-broken-from-source

@MikeMcQuaid MikeMcQuaid merged commit eb09a09 into Homebrew:master Aug 31, 2020
@MikeMcQuaid
Copy link
Member

MikeMcQuaid commented Aug 31, 2020

Let's try this out for now and see how people react. Thanks again @scpeters!

@scpeters
Copy link
Member Author

thanks!

@scpeters scpeters deleted the upgrade_check_already_broken_dependents branch August 31, 2020 16:53
scpeters added a commit to scpeters/brew that referenced this pull request Sep 18, 2020
Use `uniq` on the list of outdated dependents to remove
duplicates, similar to a change made in Homebrew#8500.
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Dec 14, 2020
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Dec 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants