-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
github_runner_matrix: deploy new x86_64 runner when required #18363
base: master
Are you sure you want to change the base?
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.
Thanks @carlocab, great work so far!
NEW_INTEL_MACOS_MUST_BUILD_FORMULAE = %w[pkg-config pkgconf].freeze | ||
|
||
sig { returns(T::Boolean) } | ||
def deploy_new_x86_64_runner? | ||
return true if @testing_formulae.any? { |f| NEW_INTEL_MACOS_MUST_BUILD_FORMULAE.include?(f.name) } | ||
return true if @testing_formulae.any? { |f| f.formula.class.pour_bottle_only_if == :clt_installed } | ||
|
||
Formula.all.any? do |formula| | ||
non_test_dependencies = Dependency.expand(formula, cache_key: "determine-test-runners") do |_, dependency| | ||
Dependency.prune if dependency.test? | ||
end | ||
next false if non_test_dependencies.none? { |dep| @testing_formulae.map(&:name).include?(dep.name) } | ||
|
||
formula.class.pour_bottle_only_if == :clt_installed | ||
end | ||
end |
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.
As mentioned before: I'd love to see this be a temporary stop-gap while we add a DSL. I think this needs some pretty hefty amounts of comments until then explaining why these particular formulae need to be doing what they are doing here.
return true if @testing_formulae.any? { |f| NEW_INTEL_MACOS_MUST_BUILD_FORMULAE.include?(f.name) } | ||
return true if @testing_formulae.any? { |f| f.formula.class.pour_bottle_only_if == :clt_installed } | ||
|
||
Formula.all.any? do |formula| |
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.
can this instead use e.g. the relevant tap(s) instead of reading all formulae unconditionally here?
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.
I can skip formulae not in the given tap, but Tap
objects don't seem to have a nice way to recover the formulae they contain. They can give me the formulae files, but not sure handling those directly is nicer than this.
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.
I think handling formulae files is always nicer than doing Formula.all
and evaluating every formula, whether needed or not.
22ccc44
to
30e25c5
Compare
return true if @testing_formulae.any? { |f| NEW_INTEL_MACOS_MUST_BUILD_FORMULAE.include?(f.name) } | ||
return true if @testing_formulae.any? { |f| f.formula.class.pour_bottle_only_if == :clt_installed } | ||
|
||
Formula.all.any? do |formula| |
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.
You probably need to pass eval_all
here
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.
Yep, will add it when I get around to updating the calls in homebrew/core
next if !@all_supported && macos_version > NEWEST_HOMEBREW_CORE_INTEL_MACOS_RUNNER | ||
# `#deploy_new_x86_64_runner?` is expensive, so: | ||
# - avoid calling it if we don't have to | ||
# - cache the result to a variable to avoid calling it multiple times | ||
if macos_version > NEWEST_DEFAULT_HOMEBREW_CORE_INTEL_MACOS_RUNNER && |
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.
Was removing the !@all_supported
intentional?
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.
It's up here:
@deploy_new_x86_64_runner = T.let(all_supported, T::Boolean) |
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.
Ah thanks, that wasn't obvious at first.
Closes #18356. Co-authored-by: Bo Anderson <[email protected]>
30e25c5
to
c8d1644
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
I'll get to this late next week (or in the first half of the week following that). |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?Closes #18356.