Skip to content

Commit

Permalink
Change default Homebrew/core CI runners
Browse files Browse the repository at this point in the history
We will now build on Ventura (macOS 13) to Sequoia (macOS 15).
  • Loading branch information
carlocab committed Sep 12, 2024
1 parent 9141bb0 commit 8dab515
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
4 changes: 0 additions & 4 deletions Library/Homebrew/github_runner_matrix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ def create_runner(platform, arch, spec, macos_version = nil)
runner.freeze
end

NEWEST_HOMEBREW_CORE_MACOS_RUNNER = :sequoia
OLDEST_HOMEBREW_CORE_MACOS_RUNNER = :monterey
NEWEST_HOMEBREW_CORE_INTEL_MACOS_RUNNER = :sonoma

sig { params(macos_version: MacOSVersion).returns(T::Boolean) }
def runner_enabled?(macos_version)
macos_version <= NEWEST_HOMEBREW_CORE_MACOS_RUNNER && macos_version >= OLDEST_HOMEBREW_CORE_MACOS_RUNNER
Expand Down
4 changes: 4 additions & 0 deletions Library/Homebrew/global.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
%r[https://github\.com/([\w-]+)/([\w-]+)?/(?:pull/(\d+)|commit/[0-9a-fA-F]{4,40})]
HOMEBREW_BOTTLES_EXTNAME_REGEX = /\.([a-z0-9_]+)\.bottle\.(?:(\d+)\.)?tar\.gz$/

NEWEST_HOMEBREW_CORE_MACOS_RUNNER = :sequoia
OLDEST_HOMEBREW_CORE_MACOS_RUNNER = :ventura
NEWEST_HOMEBREW_CORE_INTEL_MACOS_RUNNER = :sonoma

module Homebrew
extend FileUtils

Expand Down
8 changes: 5 additions & 3 deletions Library/Homebrew/test/dev-cmd/determine-test-runners_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ def get_runners(file)
out = []
MacOSVersion::SYMBOLS.each_value do |v|
macos_version = MacOSVersion.new(v)
next if macos_version < :monterey
next if macos_version > :sonoma
next if macos_version < OLDEST_HOMEBREW_CORE_MACOS_RUNNER
next if macos_version > NEWEST_HOMEBREW_CORE_MACOS_RUNNER

out << "#{v}-x86_64"
out << "#{v}-arm64"
next if macos_version > NEWEST_HOMEBREW_CORE_INTEL_MACOS_RUNNER

out << "#{v}-x86_64"
end

out << linux_runner
Expand Down
3 changes: 1 addition & 2 deletions Library/Homebrew/test/github_runner_matrix_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
allow(ENV).to receive(:fetch).with("GITHUB_RUN_ID").and_return("12345")
end

# FIXME: Avoid changing this every time we change Homebrew/core CI runner macOS versions.
let(:newest_supported_macos) do
MacOSVersion::SYMBOLS.find { |k, _| k == :sonoma }
MacOSVersion::SYMBOLS.find { |k, _| k == NEWEST_HOMEBREW_CORE_MACOS_RUNNER }
end

let(:testball) { TestRunnerFormula.new(Testball.new) }
Expand Down
5 changes: 0 additions & 5 deletions Library/Homebrew/test_runner_formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ def versioned_macos_requirement

sig { params(macos_version: MacOSVersion).returns(T::Boolean) }
def compatible_with?(macos_version)
# Require a Sequoia bottle before deploying a Sequoia runner.
tag = Utils::Bottles::Tag.new(arch: :arm64, system: :sequoia)
# Comparision should be `==` and not `>=`, but Sorbet doesn't like it.
return false if macos_version >= :sequoia && !formula.bottle_specification.tag?(tag, no_older_versions: true)

# Assign to a variable to assist type-checking.
requirement = versioned_macos_requirement
return true if requirement.blank?
Expand Down

0 comments on commit 8dab515

Please sign in to comment.