From f2fb8f4935f2d15e700241caa44cd5aa1abff48e Mon Sep 17 00:00:00 2001 From: Michka Popoff Date: Mon, 3 Feb 2025 18:06:05 +0100 Subject: [PATCH] linux: make ubuntu 24.04 the latest version --- .github/workflows/docker.yml | 6 +++--- .github/workflows/tests.yml | 5 ++++- Dockerfile | 2 +- Library/Homebrew/dev-cmd/dispatch-build-bottle.rb | 2 +- Library/Homebrew/dev-cmd/tap-new.rb | 4 ++-- Library/Homebrew/github_runner_matrix.rb | 2 +- Library/Homebrew/os.rb | 10 +++++----- .../test/dev-cmd/determine-test-runners_spec.rb | 2 +- Library/Homebrew/test/linux_runner_spec_spec.rb | 2 +- Library/Homebrew/test/unpack_strategy/zstd_spec.rb | 2 +- docs/Linux-CI.md | 12 +++--------- 11 files changed, 23 insertions(+), 26 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1db26e8391a07..a2a071cb96e87 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -66,7 +66,7 @@ jobs: "homebrew/ubuntu${{matrix.version}}:${brew_version}" "homebrew/ubuntu${{matrix.version}}:latest" ) - if [[ "${{ matrix.version }}" == "22.04" ]]; then + if [[ "${{ matrix.version }}" == "24.04" ]]; then tags+=( "ghcr.io/homebrew/brew:${brew_version}" "ghcr.io/homebrew/brew:latest" @@ -76,7 +76,7 @@ jobs: fi elif [[ "${GITHUB_EVENT_NAME}" == "merge_group" && "${GITHUB_REF}" == "refs/heads/master" && - "${{ matrix.version }}" == "22.04" ]]; then + "${{ matrix.version }}" == "24.04" ]]; then tags+=( "ghcr.io/homebrew/brew:master" "ghcr.io/homebrew/ubuntu${{ matrix.version }}:master" @@ -86,7 +86,7 @@ jobs: fi if [[ "${{ matrix.version }}" == "18.04" ]]; then # odeprecated: remove this in Homebrew >=4.5 - echo "The homebrew/ubuntu18.04 image is deprecated and will soon be retired. Use homebrew/ubuntu22.04 or homebrew/ubuntu24.04 or homebrew/ubuntu20.04 or homebrew/brew." > .docker-deprecate + echo "The homebrew/ubuntu18.04 image is deprecated and will soon be retired. Use homebrew/ubuntu24.04 or homebrew/ubuntu22.04 or homebrew/ubuntu20.04 or homebrew/brew." > .docker-deprecate fi { diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6f5050f4172b9..75184eb278dc4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -371,9 +371,12 @@ jobs: strategy: matrix: include: + - name: test default formula (Ubuntu 24.04) + runs-on: ubuntu-latest + container: ghcr.io/homebrew/ubuntu24.04:master - name: test default formula (Ubuntu 22.04) runs-on: ubuntu-latest - container: ghcr.io/homebrew/ubuntu22.04:master + container: ghcr.io/homebrew/ubuntu22.04 - name: test default formula (Ubuntu 20.04) runs-on: ubuntu-latest container: ghcr.io/homebrew/ubuntu20.04 diff --git a/Dockerfile b/Dockerfile index 64ce1a2019616..b386558626ad7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG version=22.04 +ARG version=24.04 # version is passed through by Docker. # shellcheck disable=SC2154 FROM ubuntu:"${version}" diff --git a/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb b/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb index 0a9be38c9d57d..c692c3f7afde1 100644 --- a/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb +++ b/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb @@ -65,7 +65,7 @@ def run end if args.linux? - runners << "ubuntu-22.04" + runners << "ubuntu-24.04" elsif args.linux_self_hosted? runners << "linux-self-hosted-1" end diff --git a/Library/Homebrew/dev-cmd/tap-new.rb b/Library/Homebrew/dev-cmd/tap-new.rb index 5f1423fb64cf0..5a08d2894bdc7 100644 --- a/Library/Homebrew/dev-cmd/tap-new.rb +++ b/Library/Homebrew/dev-cmd/tap-new.rb @@ -85,7 +85,7 @@ def run test-bot: strategy: matrix: - os: [ubuntu-22.04, macos-13, macos-15] + os: [ubuntu-24.04, macos-13, macos-15] runs-on: ${{ matrix.os }} steps: - name: Set up Homebrew @@ -139,7 +139,7 @@ def run jobs: pr-pull: if: contains(github.event.pull_request.labels.*.name, '#{label}') - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 permissions: #{pr_pull_permissions.sort.map { |k, v| " #{k}: #{v}" }.join("\n")} steps: diff --git a/Library/Homebrew/github_runner_matrix.rb b/Library/Homebrew/github_runner_matrix.rb index 492faf73c4eb4..3586a1e61aee7 100644 --- a/Library/Homebrew/github_runner_matrix.rb +++ b/Library/Homebrew/github_runner_matrix.rb @@ -86,7 +86,7 @@ def linux_runner_spec name: "Linux", runner: linux_runner, container: { - image: "ghcr.io/homebrew/ubuntu22.04:master", + image: "ghcr.io/homebrew/ubuntu24.04:master", options: "--user=linuxbrew -e GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED", }, workdir: "/github/home", diff --git a/Library/Homebrew/os.rb b/Library/Homebrew/os.rb index 899db97692825..59615357f1bbd 100644 --- a/Library/Homebrew/os.rb +++ b/Library/Homebrew/os.rb @@ -46,11 +46,11 @@ def self.kernel_name ::OS_VERSION = T.let(ENV.fetch("HOMEBREW_OS_VERSION").freeze, String) # See Linux-CI.md - LINUX_CI_OS_VERSION = "Ubuntu 22.04" - LINUX_GLIBC_CI_VERSION = "2.35" - LINUX_GLIBC_NEXT_CI_VERSION = "2.35" - LINUX_GCC_CI_VERSION = "11.0" - LINUX_PREFERRED_GCC_COMPILER_FORMULA = "gcc@11" # https://packages.ubuntu.com/jammy/gcc + LINUX_CI_OS_VERSION = "Ubuntu 24.04" + LINUX_GLIBC_CI_VERSION = "2.39" + LINUX_GLIBC_NEXT_CI_VERSION = "2.39" + LINUX_GCC_CI_VERSION = "13.0" + LINUX_PREFERRED_GCC_COMPILER_FORMULA = "gcc@13" # https://packages.ubuntu.com/noble/gcc LINUX_PREFERRED_GCC_RUNTIME_FORMULA = "gcc" if OS.mac? 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 0d46e31002d89..4f583491a8702 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,7 @@ def get_runners(file) FileUtils.rm_f github_output end - let(:linux_runner) { "ubuntu-22.04" } + let(:linux_runner) { "ubuntu-24.04" } # 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" } diff --git a/Library/Homebrew/test/linux_runner_spec_spec.rb b/Library/Homebrew/test/linux_runner_spec_spec.rb index 8b986c1dd46d9..2aa17f393ed5d 100644 --- a/Library/Homebrew/test/linux_runner_spec_spec.rb +++ b/Library/Homebrew/test/linux_runner_spec_spec.rb @@ -7,7 +7,7 @@ described_class.new( name: "Linux", runner: "ubuntu-latest", - container: { image: "ghcr.io/homebrew/ubuntu22.04:master", options: "--user=linuxbrew" }, + container: { image: "ghcr.io/homebrew/ubuntu24.04:master", options: "--user=linuxbrew" }, workdir: "/github/home", timeout: 360, cleanup: false, diff --git a/Library/Homebrew/test/unpack_strategy/zstd_spec.rb b/Library/Homebrew/test/unpack_strategy/zstd_spec.rb index b439ed657f262..36df6ac36b9e6 100644 --- a/Library/Homebrew/test/unpack_strategy/zstd_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/zstd_spec.rb @@ -9,7 +9,7 @@ # `UnpackStrategy.detect(path)` for a `.tar.XXX` file returns either `UnpackStrategy::Tar` if # the host's `tar` is able to extract that compressed file or `UnpackStrategy::XXX` otherwise, # such as `UnpackStrategy::Zstd`. On macOS `UnpackStrategy.detect("container.tar.zst")` - # returns `UnpackStrategy::Zstd` and on Ubuntu 22.04 it returns `UnpackStrategy::Tar`, + # returns `UnpackStrategy::Zstd` and on Ubuntu 24.04 it returns `UnpackStrategy::Tar`, # because the host's version of `tar` is recent enough and `zstd` is installed. expect(UnpackStrategy.detect(path)).to(be_a(described_class).or(be_a(UnpackStrategy::Tar))) end diff --git a/docs/Linux-CI.md b/docs/Linux-CI.md index 1e619e9925c0c..872e4dae6c5f6 100644 --- a/docs/Linux-CI.md +++ b/docs/Linux-CI.md @@ -4,7 +4,9 @@ last_review_date: "1970-01-01" # Linux CI in `homebrew/core` -We currently use Ubuntu 22.04 for bottling in `homebrew/core`. +We currently use Ubuntu 24.04 for bottling in `homebrew/core`. + +We try to use the latest Ubuntu LTS version for our CI no earlier than 3 months after its release and, ideally, no more than 12 months after its release. ## Ubuntu vs. other Linux distributions @@ -16,14 +18,6 @@ Our bottles are compatible with other distributions like Debian/CentOS, even whe ## Past and next versions -We have moved our CI to Ubuntu 22.04 - -Moving from Ubuntu 16.04 to Ubuntu 22.04 (and thus skipping version 18.04 and 20.04) took longer than expected. - -We plan to proceed with regular updates from 2022 onwards. We aim to use the latest Ubuntu LTS version for our CI. - -We will start using the latest Ubuntu LTS version for our CI no earlier than 3 months after its release and, ideally, no more than 12 months after its release. - | Distribution | Glibc | GCC | LTS standard security maintenance | |---|---|---|---| | Ubuntu 14.04 | 2.19 | 4 | From 2014 to 2017 |