diff --git a/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb b/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb index 3b24be6e31e47..0e1336687f778 100644 --- a/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb +++ b/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb @@ -68,12 +68,12 @@ def run end if args.linux? - runners << "ubuntu-22.04" + runners << "ubuntu-latest" elsif args.linux_self_hosted? runners << "linux-self-hosted-1" end - runners << "ubuntu-22.04-arm" if args.linux_arm64? + runners << OS::LINUX_CI_ARM_RUNNER if args.linux_arm64? if runners.empty? raise UsageError, "Must specify `--macos`, `--linux`, `--linux-arm64`, or `--linux-self-hosted` option." diff --git a/Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb b/Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb index f7238fdfd0e03..96a1c97a39add 100644 --- a/Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb +++ b/Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb @@ -17,7 +17,7 @@ class GenerateCaskCiMatrix < AbstractCommand { symbol: :sequoia, name: "macos-15-intel", arch: :intel } => 1.0, }.freeze, T::Hash[T::Hash[Symbol, T.any(Symbol, String)], Float]) X86_LINUX_RUNNERS = T.let({ - { symbol: :linux, name: "ubuntu-22.04", arch: :intel } => 1.0, + { symbol: :linux, name: "ubuntu-latest", arch: :intel } => 1.0, }.freeze, T::Hash[T::Hash[Symbol, T.any(Symbol, String)], Float]) ARM_MACOS_RUNNERS = T.let({ { symbol: :sonoma, name: "macos-14", arch: :arm } => 0.0, @@ -25,7 +25,7 @@ class GenerateCaskCiMatrix < AbstractCommand { symbol: :tahoe, name: "macos-26", arch: :arm } => 1.0, }.freeze, T::Hash[T::Hash[Symbol, T.any(Symbol, String)], Float]) ARM_LINUX_RUNNERS = T.let({ - { symbol: :linux, name: "ubuntu-22.04-arm", arch: :arm } => 1.0, + { symbol: :linux, name: OS::LINUX_CI_ARM_RUNNER, arch: :arm } => 1.0, }.freeze, T::Hash[T::Hash[Symbol, T.any(Symbol, String)], Float]) MACOS_RUNNERS = T.let(X86_MACOS_RUNNERS.merge(ARM_MACOS_RUNNERS).freeze, T::Hash[T::Hash[Symbol, T.any(Symbol, String)], Float]) diff --git a/Library/Homebrew/github_runner_matrix.rb b/Library/Homebrew/github_runner_matrix.rb index ab25108b0d43d..b9346ca3dafd0 100644 --- a/Library/Homebrew/github_runner_matrix.rb +++ b/Library/Homebrew/github_runner_matrix.rb @@ -90,7 +90,7 @@ def active_runner_specs_hash sig { params(arch: Symbol).returns(LinuxRunnerSpec) } def linux_runner_spec(arch) linux_runner = case arch - when :arm64 then "ubuntu-22.04-arm" + when :arm64 then OS::LINUX_CI_ARM_RUNNER when :x86_64 then ENV.fetch("HOMEBREW_LINUX_RUNNER", "ubuntu-latest") else raise "Unknown Linux architecture: #{arch}" end diff --git a/Library/Homebrew/os.rb b/Library/Homebrew/os.rb index 79d2851a51b27..c8be3389d7356 100644 --- a/Library/Homebrew/os.rb +++ b/Library/Homebrew/os.rb @@ -47,6 +47,7 @@ def self.kernel_name # See Linux-CI.md LINUX_CI_OS_VERSION = "Ubuntu 22.04" + LINUX_CI_ARM_RUNNER = "ubuntu-22.04-arm" LINUX_GLIBC_CI_VERSION = "2.35" LINUX_GLIBC_NEXT_CI_VERSION = "2.39" # users below this version will be warned by `brew doctor` LINUX_GCC_CI_VERSION = "12" # https://packages.ubuntu.com/jammy/gcc-12 diff --git a/Library/Homebrew/test/dev-cmd/determine-test-runners_spec.rb b/Library/Homebrew/test/dev-cmd/determine-test-runners_spec.rb index 498ad3a79d8f4..b39e7e356b49e 100644 --- a/Library/Homebrew/test/dev-cmd/determine-test-runners_spec.rb +++ b/Library/Homebrew/test/dev-cmd/determine-test-runners_spec.rb @@ -16,7 +16,8 @@ def get_runners(file) FileUtils.rm_f github_output end - let(:linux_runner) { "ubuntu-22.04" } + let(:arm_linux_runner) { OS::LINUX_CI_ARM_RUNNER } + let(:linux_runner) { "ubuntu-latest" } # We need to make sure we write to a different path for each example. let(:github_output) { "#{TEST_TMPDIR}/github_output#{DetermineRunnerTestHelper.new.number}" } let(:ephemeral_suffix) { "-12345" } @@ -41,7 +42,7 @@ def get_runners(file) end out << linux_runner - out << "#{linux_runner}-arm" + out << arm_linux_runner out end diff --git a/Library/Homebrew/test/dev-cmd/generate-cask-ci-matrix_spec.rb b/Library/Homebrew/test/dev-cmd/generate-cask-ci-matrix_spec.rb index d2ccb110d4521..497ab56bbf29e 100644 --- a/Library/Homebrew/test/dev-cmd/generate-cask-ci-matrix_spec.rb +++ b/Library/Homebrew/test/dev-cmd/generate-cask-ci-matrix_spec.rb @@ -142,6 +142,7 @@ it_behaves_like "parseable arguments" describe "::filter_runners" do + let(:arm_linux_runner) { OS::LINUX_CI_ARM_RUNNER } # We simulate a macOS version older than the newest, as the method will use # the host macOS version instead of the default (the newest macOS version). let(:older_macos) { :big_sur } @@ -153,9 +154,9 @@ { arch: :arm, name: "macos-14", symbol: :sonoma } => 0.0, { arch: :arm, name: "macos-15", symbol: :sequoia } => 0.0, { arch: :arm, name: "macos-26", symbol: :tahoe } => 1.0, - { arch: :arm, name: "ubuntu-22.04-arm", symbol: :linux } => 1.0, + { arch: :arm, name: arm_linux_runner, symbol: :linux } => 1.0, { arch: :intel, name: "macos-15-intel", symbol: :sequoia } => 1.0, - { arch: :intel, name: "ubuntu-22.04", symbol: :linux } => 1.0, + { arch: :intel, name: "ubuntu-latest", symbol: :linux } => 1.0, }) expect(generate_matrix.filter_runners(c_app_only_macos)) @@ -163,9 +164,9 @@ { arch: :arm, name: "macos-14", symbol: :sonoma } => 0.0, { arch: :arm, name: "macos-15", symbol: :sequoia } => 0.0, { arch: :arm, name: "macos-26", symbol: :tahoe } => 1.0, - { arch: :arm, name: "ubuntu-22.04-arm", symbol: :linux } => 1.0, + { arch: :arm, name: arm_linux_runner, symbol: :linux } => 1.0, { arch: :intel, name: "macos-15-intel", symbol: :sequoia } => 1.0, - { arch: :intel, name: "ubuntu-22.04", symbol: :linux } => 1.0, + { arch: :intel, name: "ubuntu-latest", symbol: :linux } => 1.0, }) end end @@ -196,9 +197,9 @@ { arch: :arm, name: "macos-14", symbol: :sonoma } => 0.0, { arch: :arm, name: "macos-15", symbol: :sequoia } => 0.0, { arch: :arm, name: "macos-26", symbol: :tahoe } => 1.0, - { arch: :arm, name: "ubuntu-22.04-arm", symbol: :linux } => 1.0, + { arch: :arm, name: arm_linux_runner, symbol: :linux } => 1.0, { arch: :intel, name: "macos-15-intel", symbol: :sequoia } => 1.0, - { arch: :intel, name: "ubuntu-22.04", symbol: :linux } => 1.0, + { arch: :intel, name: "ubuntu-latest", symbol: :linux } => 1.0, }) end end @@ -208,7 +209,7 @@ expect(generate_matrix.filter_runners(c_on_system_depends_on_intel)) .to eq({ { arch: :intel, name: "macos-15-intel", symbol: :sequoia } => 1.0, - { arch: :intel, name: "ubuntu-22.04", symbol: :linux } => 1.0, + { arch: :intel, name: "ubuntu-latest", symbol: :linux } => 1.0, }) expect(generate_matrix.filter_runners(c_on_linux_depends_on_intel)) @@ -217,19 +218,19 @@ { arch: :arm, name: "macos-15", symbol: :sequoia } => 0.0, { arch: :arm, name: "macos-26", symbol: :tahoe } => 1.0, { arch: :intel, name: "macos-15-intel", symbol: :sequoia } => 1.0, - { arch: :intel, name: "ubuntu-22.04", symbol: :linux } => 1.0, + { arch: :intel, name: "ubuntu-latest", symbol: :linux } => 1.0, }) expect(generate_matrix.filter_runners(c_on_macos_depends_on_intel)) .to eq({ { arch: :intel, name: "macos-15-intel", symbol: :sequoia } => 1.0, - { arch: :intel, name: "ubuntu-22.04", symbol: :linux } => 1.0, - { arch: :arm, name: "ubuntu-22.04-arm", symbol: :linux } => 1.0, + { arch: :intel, name: "ubuntu-latest", symbol: :linux } => 1.0, + { arch: :arm, name: arm_linux_runner, symbol: :linux } => 1.0, }) expect(generate_matrix.filter_runners(c_on_system_depends_on_mixed)) .to eq({ - { arch: :arm, name: "ubuntu-22.04-arm", symbol: :linux } => 1.0, + { arch: :arm, name: arm_linux_runner, symbol: :linux } => 1.0, { arch: :intel, name: "macos-15-intel", symbol: :sequoia } => 1.0, }) end