github_runner_matrix: skip newer intel CI unless exact tag#21620
github_runner_matrix: skip newer intel CI unless exact tag#21620
Conversation
There was a problem hiding this comment.
Pull request overview
Updates GitHubRunnerMatrix runner generation to avoid scheduling newer Intel macOS runners for formulae bottled as :all, only keeping those newer Intel runners when an exact macOS bottle tag exists.
Changes:
- Refines Intel-runner skipping logic for macOS versions newer than
NEWEST_HOMEBREW_CORE_INTEL_MACOS_RUNNERby excluding:allbottles from qualifying as “tagged”. - Uses
no_older_versions: truein bottle tag checks to require exact tag matches (no older-compatible fallback).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| skip_intel_runner = !@all_supported && macos_version > NEWEST_HOMEBREW_CORE_INTEL_MACOS_RUNNER | ||
| skip_intel_runner &&= @dependent_matrix || @testing_formulae.none? do |testing_formula| | ||
| testing_formula.formula.bottle_specification.tag?(Utils::Bottles.tag(macos_version.to_sym)) | ||
| bottle_spec = testing_formula.formula.bottle_specification | ||
| bottle_spec.tag?(Utils::Bottles.tag(macos_version.to_sym), no_older_versions: true) && | ||
| !bottle_spec.tag?(Utils::Bottles.tag(:all), no_older_versions: true) | ||
| end |
There was a problem hiding this comment.
This change alters runner selection for formulae with :all bottles (and for newer macOS versions beyond NEWEST_HOMEBREW_CORE_INTEL_MACOS_RUNNER), but there doesn’t appear to be spec coverage for this branch in Library/Homebrew/test/github_runner_matrix_spec.rb. Please add tests that (1) assert newer Intel runners are skipped for an :all bottle and (2) assert they are still included when an exact macOS tag bottle exists.
| bottle_spec = testing_formula.formula.bottle_specification | ||
| bottle_spec.tag?(Utils::Bottles.tag(macos_version.to_sym), no_older_versions: true) && | ||
| !bottle_spec.tag?(Utils::Bottles.tag(:all), no_older_versions: true) |
There was a problem hiding this comment.
Utils::Bottles.tag(...) creates new Utils::Bottles::Tag objects; calling it twice per formula per macOS version here adds avoidable allocations. Consider precomputing the macos_tag (once per macos_version) and the all_tag (once outside the loop) and reusing them inside the none? block.
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Makes sense to me, thanks @cho-m!
brew lgtm(style, typechecking and tests) with your changes locally?Skips extra Intel CI runners for
:allbottle formulae. Original all bottles were created without these runners.Running CI on these formulae have higher chance of unexpected setup failures and also propagate bottles when run in same PR as other formulae. For latter part, really should improve handling and maybe add an explicit exception list for bottling (or skip bottling unless an existing bottle exists, with bottle creation restricted to dispatch workflow).
Certifi (all bottle) example:
GCC (Sequoia/Tahoe bottle) example, both before and after same:
no_older_versions: trueis mainly to get same output when run on macOS for verification purposes. CI runs command on Linux so it has no impact.Can see difference by running
brew determine-test-runners rubyon Linux vs macOS without PR changes