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

Display unbottled dependencies when skipping #717

Merged
merged 4 commits into from
Nov 18, 2021

Conversation

carlocab
Copy link
Member

Also, simplify handling of :all bottles.

Closes #705.

We currently have a few places elsewhere that check for `:all` bottle
dependencies separately. We can simplify those by building the `:all`
bottle logic into the `#bottled?` method.
We also no longer need to handle the `:all` bottle case separately after
e41d68e.

Closes Homebrew#705.
The logic for `:all` bottles is now in the `#bottled?` method.

We also remove `no_older_versions: true` since this is handled in the
`#install_dependent` method.
carlocab added a commit to carlocab/homebrew-test-bot that referenced this pull request Nov 18, 2021
If the `--build-dependents-from-source` flag is passed, then all
dependents are built from source. This is the current behaviour.

We change behaviour in two ways:
1. Build unbottled dependents from source if all its dependencies are
   either bottled, or were built earlier in the `test-bot` run.
2. Build Linux-only formulae from source too (either with the
   appropriate flag or when the above condition is true) instead of
   always skipping source builds on Linux.

Building unbottled dependents will be useful for detecting dependents
which should be bottled after Homebrew#714.

This change should also allow us to clean up a bit of code in the
`#dependent_formulae!` method. I've omitted that for now since I have a
pending PR (Homebrew#717) which introduces conflicting changes.
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

One suggestion, code looks good.

Comment on lines +17 to +18
if formula.bottle_specification.tag?(Utils::Bottles.tag(:all))
formula.deps.all? { |dep| bottled?(dep.to_formula, no_older_versions: no_older_versions) }
Copy link
Member

Choose a reason for hiding this comment

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

Should this be recursive deps? Feels like a comment explaining why this is done would be useful.

Copy link
Member Author

@carlocab carlocab Nov 18, 2021

Choose a reason for hiding this comment

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

No need. This procedure guarantees that the recursive dependencies are bottled too because a formula won't be bottled unless its dependencies are. (The handful that were accidentally bottled during mass bottling have been bumped since.)

We only need to recurse further up the tree whenever we find an :all bottle, but that's what this method does already.

Copy link
Member

Choose a reason for hiding this comment

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

Gotcha.

Copy link
Member

Choose a reason for hiding this comment

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

This procedure guarantees that the recursive dependencies are bottled too because a formula won't be bottled unless its dependencies are. (The handful that were accidentally bottled during mass bottling have been bumped since.)

This may be the case in core, but it is not the case in osrf/simulation right now. There are some formulae with big_sur bottles that were built before Nov 3 against catalina or earlier bottles of at least one dependency. Now, when rebuilding these formulae, they lose their big_sur bottle since their dependency chain isn't completely bottled on big_sur (for example osrf/homebrew-simulation@140ece0).

I'll try to test and find a reproducible test case from the osrf/simulation tap. Thanks for you help with all this!

Copy link
Member Author

@carlocab carlocab Nov 18, 2021

Choose a reason for hiding this comment

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

Changing deps to recursive_dependencies here only makes your problem worse, not better, though. This discussion is also about formulae with :all bottles, which I guess you don't have yet?

Copy link
Member

Choose a reason for hiding this comment

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

fair enough; I don't fully understand all this code. thanks for your patience

we don't yet have :all bottles; we need to resolve osrf/homebrew-simulation#1682 before we will get :all bottles automatically from test-bot

Comment on lines +17 to +18
if formula.bottle_specification.tag?(Utils::Bottles.tag(:all))
formula.deps.all? { |dep| bottled?(dep.to_formula, no_older_versions: no_older_versions) }
Copy link
Member

Choose a reason for hiding this comment

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

Gotcha.

@carlocab carlocab merged commit 7e3c529 into Homebrew:master Nov 18, 2021
@carlocab carlocab deleted the bottled-logic branch November 18, 2021 15:03
carlocab added a commit to carlocab/homebrew-test-bot that referenced this pull request Nov 18, 2021
If the `--build-dependents-from-source` flag is passed, then all
dependents are built from source. This is the current behaviour.

We change behaviour in two ways:
1. Build unbottled dependents from source if all its dependencies are
   either bottled, or were built earlier in the `test-bot` run.
2. Build Linux-only formulae from source too (either with the
   appropriate flag or when the above condition is true) instead of
   always skipping source builds on Linux.

Building unbottled dependents will be useful for detecting dependents
which should be bottled after Homebrew#714.

This change should also allow us to clean up a bit of code in the
`#dependent_formulae!` method. I've omitted that for now since I have a
pending PR (Homebrew#717) which introduces conflicting changes.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Behavior change in building bottles against bottles from previous macOS versions
3 participants