-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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?
# `#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 | ||
deploy_new_x86_64_runner = @all_supported || deploy_new_x86_64_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.
If it's slow: be worth putting this in the loop lazily evaluated as late as possible and memoized so that we can avoid more cases where it might not need to be called at all e.g. for the last possible next
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?Closes #18356.