Truly independent web browser
CI: Build release packages for each supported Linux distribution
Jelle Raaijmakersc742cd0b624d
diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.ymlindex 60bf4103cf6..c0b6a3f1153 100644--- a/.github/workflows/build-release.yml+++ b/.github/workflows/build-release.yml@@ -61,27 +61,66 @@ jobs:Build:if: github.repository == 'LadybirdBrowser/ladybird'- name: ${{ matrix.os_name }}, ${{ matrix.arch }}, Distribution, Clang+ name: ${{ matrix.system }}, ${{ matrix.arch }}, Distribution, Clangneeds: Sourceruns-on: ${{ fromJSON(matrix.runner_labels) }}container: ${{ fromJSON(matrix.container) }}+ # Ladybird links Qt's private API on Linux, so each distribution version builds its packages against its own Qt.strategy:fail-fast: falsematrix:include:- - os_name: 'macOS'+ - system: 'macOS'+ os_name: 'macOS'arch: 'arm64'runner_labels: '["blacksmith-12vcpu-macos-26"]'container: 'null'- - os_name: 'Linux'+ archives: true++ - system: 'Ubuntu 26.04'+ os_name: 'Linux'arch: 'x86_64'runner_labels: '["blacksmith-16vcpu-ubuntu-2404"]'container: &ci_container '{"image":"ghcr.io/ladybirdbrowser/ladybird-ci:2026.10.29","options":"--ulimit core=1"}'- - os_name: 'Linux'+ archives: true+ packages: 'DEB'++ - system: 'Ubuntu 26.04'+ os_name: 'Linux'arch: 'arm64'runner_labels: '["blacksmith-16vcpu-ubuntu-2404-arm"]'container: *ci_container+ archives: true+ packages: 'DEB'++ - system: 'Ubuntu 26.10'+ os_name: 'Linux'+ arch: 'x86_64'+ runner_labels: '["blacksmith-16vcpu-ubuntu-2404"]'+ container: '{"image":"docker.io/library/ubuntu:26.10","options":"--ulimit core=1"}'+ packages: 'DEB'++ - system: 'Ubuntu 26.10'+ os_name: 'Linux'+ arch: 'arm64'+ runner_labels: '["blacksmith-16vcpu-ubuntu-2404-arm"]'+ container: '{"image":"docker.io/library/ubuntu:26.10","options":"--ulimit core=1"}'+ packages: 'DEB'++ - system: 'Fedora 44'+ os_name: 'Linux'+ arch: 'x86_64'+ runner_labels: '["blacksmith-16vcpu-ubuntu-2404"]'+ container: '{"image":"docker.io/library/fedora:44","options":"--ulimit core=1"}'+ packages: 'RPM'++ - system: 'Fedora 44'+ os_name: 'Linux'+ arch: 'arm64'+ runner_labels: '["blacksmith-16vcpu-ubuntu-2404-arm"]'+ container: '{"image":"docker.io/library/fedora:44","options":"--ulimit core=1"}'+ packages: 'RPM'permissions:contents: read@@ -95,11 +134,21 @@ jobs:with:artifact-ids: ${{ needs.Source.outputs.artifact-id }}+ - name: Install xz to unpack the source+ if: ${{ startsWith(matrix.system, 'Ubuntu') && !contains(matrix.container, 'ladybird-ci') }}+ run: |+ apt-get update -o APT::Update::Error-Mode=any+ apt-get install -y --no-install-recommends xz-utils+- name: Unpack the sourcerun: |tar -xf ./*-source.tar.xz --strip-components=1rm ./*-source.tar.xz+ - name: Install the build dependencies+ if: ${{ matrix.os_name == 'Linux' && !contains(matrix.container, 'ladybird-ci') }}+ run: ./Meta/Docker/ci/install-build-dependencies.sh+- name: Builduses: ./.github/actions/buildwith:@@ -109,7 +158,7 @@ jobs:build_preset: 'Distribution'version: ${{ inputs.version }}vcpkg_cache_sas: ${{ secrets.VCPKG_CACHE_SAS }}- use_caches: ${{ inputs.version == '' }}+ use_caches: false- name: Start PulseAudioif: ${{ matrix.os_name == 'Linux' }}@@ -127,28 +176,23 @@ jobs:if: ${{ failure() }}uses: actions/upload-artifact@v7with:- name: libweb-test-artifacts-${{ matrix.os_name }}-${{ matrix.arch }}-Distribution+ name: libweb-test-artifacts-${{ matrix.system }}-${{ matrix.arch }}-Distributionpath: Build/Tests/LibWeb/test-web/test-dumps/retention-days: 0if-no-files-found: ignore- name: Package+ if: ${{ matrix.archives }}working-directory: ${{ github.workspace }}/Buildrun: |cpack -G TXZ -B packages -D CPACK_COMPONENTS_ALL="ladybird_Runtime;ladybird_Symbols" \-D CPACK_ARCHIVE_COMPRESSION_LEVEL=9 -D CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY=ON- - name: Install rpmbuild- if: ${{ matrix.os_name == 'Linux' }}- run: |- apt-get update -o APT::Update::Error-Mode=any- apt-get install -y --no-install-recommends rpm-- - name: Package for Linux distributions- if: ${{ matrix.os_name == 'Linux' }}+ - name: Package for ${{ matrix.system }}+ if: ${{ matrix.packages }}working-directory: ${{ github.workspace }}/Buildrun: |- cpack -G "DEB;RPM" -B packages \+ cpack -G "${{ matrix.packages }}" -B packages \-D CPACK_COMPONENTS_ALL="ladybird_Runtime;ladybird_SystemIntegration;ladybird_SystemSymbols"- name: Attest@@ -161,6 +205,7 @@ jobs:Build/packages/*.rpm- name: Upload+ if: ${{ matrix.archives }}uses: actions/upload-artifact@v7with:path: |@@ -170,6 +215,7 @@ jobs:if-no-files-found: error- name: Upload debug symbols+ if: ${{ matrix.archives }}uses: actions/upload-artifact@v7with:path: Build/packages/ladybird-symbols-*.tar.xz@@ -177,7 +223,7 @@ jobs:if-no-files-found: error- name: Upload the Debian package- if: ${{ matrix.os_name == 'Linux' }}+ if: ${{ matrix.packages == 'DEB' }}uses: actions/upload-artifact@v7with:path: Build/packages/ladybird_*.deb@@ -185,7 +231,7 @@ jobs:if-no-files-found: error- name: Upload the Debian debug symbols- if: ${{ matrix.os_name == 'Linux' }}+ if: ${{ matrix.packages == 'DEB' }}uses: actions/upload-artifact@v7with:path: Build/packages/ladybird-dbgsym_*.deb@@ -193,7 +239,7 @@ jobs:if-no-files-found: error- name: Upload the RPM package- if: ${{ matrix.os_name == 'Linux' }}+ if: ${{ matrix.packages == 'RPM' }}uses: actions/upload-artifact@v7with:path: |@@ -203,7 +249,7 @@ jobs:if-no-files-found: error- name: Upload the RPM debug symbols- if: ${{ matrix.os_name == 'Linux' }}+ if: ${{ matrix.packages == 'RPM' }}uses: actions/upload-artifact@v7with:path: Build/packages/ladybird-debuginfo-*.rpmdiff --git a/Meta/CMake/cpack_project_config.cmake b/Meta/CMake/cpack_project_config.cmakeindex 3f1097605d3..b806a281284 100644--- a/Meta/CMake/cpack_project_config.cmake+++ b/Meta/CMake/cpack_project_config.cmake@@ -7,3 +7,19 @@ if (CPACK_GENERATOR MATCHES "^(DEB|RPM)$")set(CPACK_COMPONENT_LADYBIRD_SYSTEMINTEGRATION_GROUP Browser)set(CPACK_COMPONENT_LADYBIRD_SYSTEMSYMBOLS_GROUP DebugSymbols)endif()++# A Linux package links the Qt of the distribution version that built it, so its version names that distribution+# version: Debian packages like Ubuntu's backports do, RPM packages with the dist tag of rpmbuild. Builds for several+# versions of a distribution can then share a repository, and upgrading the distribution also moves Ladybird to the+# build for it.+if (CPACK_GENERATOR STREQUAL "DEB")+ file(STRINGS /etc/os-release os_release REGEX "^(ID|VERSION_ID)=")+ foreach (line IN LISTS os_release)+ if (line MATCHES "^(ID|VERSION_ID)=\"?([^\"]*)\"?$")+ set(os_release_${CMAKE_MATCH_1} "${CMAKE_MATCH_2}")+ endif()+ endforeach()+ set(CPACK_DEBIAN_PACKAGE_RELEASE "1~${os_release_ID}${os_release_VERSION_ID}")+ set(CPACK_DEBIAN_DEBUGSYMBOLS_PACKAGE_DEPENDS+ "ladybird (= ${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE})")+endif()diff --git a/Meta/CMake/packaging.cmake b/Meta/CMake/packaging.cmakeindex 7a6d7f8be98..7310d7d83cc 100644--- a/Meta/CMake/packaging.cmake+++ b/Meta/CMake/packaging.cmake@@ -39,16 +39,16 @@ set(CPACK_DEBIAN_BROWSER_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}")set(CPACK_DEBIAN_BROWSER_PACKAGE_SHLIBDEPS ON)set(CPACK_DEBIAN_DEBUGSYMBOLS_PACKAGE_NAME ladybird-dbgsym)set(CPACK_DEBIAN_DEBUGSYMBOLS_PACKAGE_SECTION debug)-set(CPACK_DEBIAN_DEBUGSYMBOLS_PACKAGE_DEPENDS "ladybird (= ${LADYBIRD_BROWSER_VERSION})")set(CPACK_DEBIAN_DEBUGSYMBOLS_DESCRIPTION "Debug symbols for Ladybird, which debuggers find by build ID.")set(CPACK_RPM_COMPONENT_INSTALL ON)set(CPACK_RPM_FILE_NAME RPM-DEFAULT)set(CPACK_RPM_PACKAGE_LICENSE "BSD-2-Clause")+set(CPACK_RPM_PACKAGE_RELEASE_DIST ON)set(CPACK_RPM_BROWSER_PACKAGE_NAME ladybird)set(CPACK_RPM_BROWSER_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}")set(CPACK_RPM_DEBUGSYMBOLS_PACKAGE_NAME ladybird-debuginfo)-set(CPACK_RPM_DEBUGSYMBOLS_PACKAGE_REQUIRES "ladybird = ${LADYBIRD_BROWSER_VERSION}")+set(CPACK_RPM_DEBUGSYMBOLS_PACKAGE_REQUIRES "ladybird = %{version}-%{release}")set(CPACK_RPM_DEBUGSYMBOLS_PACKAGE_AUTOREQPROV OFF)set(CPACK_RPM_DEBUGSYMBOLS_PACKAGE_SUMMARY "Debug symbols for Ladybird")set(CPACK_RPM_DEBUGSYMBOLS_PACKAGE_DESCRIPTION "Debug symbols for Ladybird, which debuggers find by build ID.")diff --git a/Meta/Docker/ci/install-build-dependencies.sh b/Meta/Docker/ci/install-build-dependencies.shindex e4de5ba3fbe..4193787f0e6 100755--- a/Meta/Docker/ci/install-build-dependencies.sh+++ b/Meta/Docker/ci/install-build-dependencies.sh@@ -1,6 +1,6 @@#!/usr/bin/env bash-# Installs what building Ladybird needs into the CI image.+# Installs what building Ladybird needs, for the CI image and for the release builds in bare distribution containers.# The CI image's Dockerfile pins the versions and digests of what this installs, which its build passes in and which are# read from it otherwise.@@ -90,6 +90,51 @@ case "${ID}" inupdate-alternatives --install "/usr/bin/${tool}" "${tool}" "/usr/bin/${tool}-${LLVM_VERSION}" 100done;;+ fedora)+ dnf install -y --setopt=install_weak_deps=False \+ autoconf \+ autoconf-archive \+ automake \+ "clang(major) = ${LLVM_VERSION}" \+ cmake \+ compiler-rt \+ curl \+ file \+ findutils \+ gcc-c++ \+ git \+ glslang \+ libdrm-devel \+ liberation-sans-fonts \+ libglvnd-devel \+ libstdc++-devel \+ libtool \+ lld \+ llvm \+ nasm \+ ncurses-devel \+ ninja-build \+ patchelf \+ perl-FindBin \+ perl-IPC-Cmd \+ perl-lib \+ perl-Time-Piece \+ pulseaudio \+ pulseaudio-libs-devel \+ python3 \+ qt6-qtbase-private-devel \+ qt6-qtpositioning-devel \+ qt6-qttools-devel \+ qt6-qtwayland-devel \+ rpm-build \+ tar \+ unzip \+ which \+ xcb-util-wm-devel \+ xz \+ zip \+ zlib-ng-compat-static+ ;;*)echo "Installing the build dependencies on ${PRETTY_NAME:-${ID}} is not supported." >&2exit 1@@ -113,6 +158,13 @@ chmod +x "${rustup_init_directory}/rustup-init"rm "${rustup_init_directory}/rustup-init"rmdir "${rustup_init_directory}"rm -rf "${RUSTUP_HOME}/downloads" "${RUSTUP_HOME}/tmp" "${CARGO_HOME}/registry"+if [ -n "${GITHUB_ENV:-}" ]; then+ {+ echo "RUSTUP_HOME=${RUSTUP_HOME}"+ echo "CARGO_HOME=${CARGO_HOME}"+ } >> "${GITHUB_ENV}"+ echo "${CARGO_HOME}/bin" >> "${GITHUB_PATH}"+fi# wasm-tools is required at build time to generate the WebAssembly spec tests (INCLUDE_WASM_SPEC_TESTS). The version is# pinned for reproducible test generation.