From edb6dc9248d01913e13118d8b0bede4cb0a22407 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Mon, 6 Jan 2025 12:59:34 +0100 Subject: [PATCH] Update CI workflows to conditionally use optimized runners and adjust LTO settings based on release branch --- .github/workflows/linux-release-build.yml | 3 ++- .github/workflows/macos-release-build.yml | 12 ++---------- .github/workflows/windows-release-build.yml | 3 ++- configs/common/mozconfig | 10 ++++++++-- configs/linux/mozconfig | 11 ++++------- configs/macos/mozconfig | 4 ++-- configs/windows/mozconfig | 7 ++----- 7 files changed, 22 insertions(+), 28 deletions(-) diff --git a/.github/workflows/linux-release-build.yml b/.github/workflows/linux-release-build.yml index 50ce86cb8..0cf3afbf7 100644 --- a/.github/workflows/linux-release-build.yml +++ b/.github/workflows/linux-release-build.yml @@ -16,7 +16,7 @@ jobs: build-linux: permissions: contents: write - runs-on: ubuntu-latest + runs-on: ${{ inputs.release-branch == 'release' && 'warp-ubuntu-latest-x64-8x' || 'ubuntu-latest' }} strategy: fail-fast: false matrix: @@ -125,6 +125,7 @@ jobs: - name: Build env: SURFER_COMPAT: ${{ matrix.arch }} + ZEN_RELEASE_BRANCH: ${{ inputs.release-branch }} continue-on-error: true run: | export SURFER_PLATFORM="linux" diff --git a/.github/workflows/macos-release-build.yml b/.github/workflows/macos-release-build.yml index 324c70bf7..610047713 100644 --- a/.github/workflows/macos-release-build.yml +++ b/.github/workflows/macos-release-build.yml @@ -15,7 +15,7 @@ on: jobs: mac-build: name: Build macOS - ${{ matrix.arch }} - runs-on: macos-14 + runs-on: ${{ inputs.release-branch == 'release' && 'warp-macos-14-arm64-6x' || 'macos-14' }} strategy: fail-fast: false @@ -115,15 +115,7 @@ jobs: - name: Build Zen env: SURFER_COMPAT: ${{ matrix.arch }} - run: | - export SURFER_PLATFORM="darwin" - if test "${{ matrix.arch }}" = "x86_64"; then - export ZEN_DISABLE_LTO=1 - fi - sh .github/workflows/src/release-build.sh - - - name: Rebuild Zen if failed - if: failure() + ZEN_RELEASE_BRANCH: ${{ inputs.release-branch }} run: | export SURFER_PLATFORM="darwin" sh .github/workflows/src/release-build.sh diff --git a/.github/workflows/windows-release-build.yml b/.github/workflows/windows-release-build.yml index 5d78f442b..b195cdac9 100644 --- a/.github/workflows/windows-release-build.yml +++ b/.github/workflows/windows-release-build.yml @@ -22,7 +22,7 @@ on: jobs: windows-build: name: Build Windows - ${{ matrix.arch }} - runs-on: ubuntu-latest + runs-on: ${{ (inputs.release-branch == 'release' && !(inputs.generate-gpo && matrix.arch == 'aarch64')) && 'warp-ubuntu-latest-x64-8x' || 'ubuntu-latest' }} strategy: fail-fast: false @@ -156,6 +156,7 @@ jobs: if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} env: SURFER_COMPAT: ${{ matrix.arch }} + ZEN_RELEASE_BRANCH: ${{ inputs.release-branch }} run: | set -x dos2unix configs/windows/mozconfig diff --git a/configs/common/mozconfig b/configs/common/mozconfig index a01e78de6..a5956b9dd 100644 --- a/configs/common/mozconfig +++ b/configs/common/mozconfig @@ -54,8 +54,14 @@ if test "$ZEN_RELEASE"; then ac_add_options --disable-default-browser-agent if ! test "$ZEN_DISABLE_LTO"; then - export MOZ_LTO=cross,thin - ac_add_options --enable-lto=cross,thin + # only enable full LTO when ZEN_RELEASE_BRANCH is 'release' + if test "$ZEN_RELEASE_BRANCH" = "release"; then + export MOZ_LTO=cross,full + ac_add_options --enable-lto=cross,full + else + export MOZ_LTO=cross,thin + ac_add_options --enable-lto=cross,thin + fi fi ac_add_options --enable-jemalloc diff --git a/configs/linux/mozconfig b/configs/linux/mozconfig index 90382e702..024972c0c 100644 --- a/configs/linux/mozconfig +++ b/configs/linux/mozconfig @@ -16,13 +16,10 @@ if test "$SURFER_COMPAT" = "x86_64"; then ac_add_options MOZ_PGO=1 # Optimization flags for SURFER_COMPAT - ac_add_options --enable-optimize="-O3 -march=x86-64" + ac_add_options --enable-optimize="-O3 -w -ftree-vectorize -Qvec -mfpmath=sse -mprfchw -msse3 -mcx16 -msahf" - export CFLAGS="$CFLAGS -O3 -ffp-contract=fast -march=x86-64" - export CPPFLAGS="$CPPFLAGS -O3 -ffp-contract=fast -march=x86-64" - export CXXFLAGS="$CXXFLAGS -O3 -flto=thin -ffp-contract=fast -march=x86-64" - export LDFLAGS="$LDFLAGS -Wl,-O3 -Wl,-mllvm,-fp-contract=fast -march=x86-64" - export RUSTFLAGS="$RUSTFLAGS -C target-cpu=x86-64 -C codegen-units=1 -Clink-args=--icf=safe" + export LDFLAGS="$LDFLAGS -Wl,-O3" + export RUSTFLAGS="$RUSTFLAGS -Clink-args=--icf=safe" elif test "$SURFER_COMPAT" = "aarch64"; then ac_add_options --target=aarch64-linux-gnu @@ -32,7 +29,7 @@ elif test "$SURFER_COMPAT" = "aarch64"; then export CPPFLAGS="$CPPFLAGS -O3" export CXXFLAGS="$CXXFLAGS -O3" export LDFLAGS="$LDFLAGS -Wl,-O3" - export RUSTFLAGS="$RUSTFLAGS -C codegen-units=1 -Clink-args=--icf=safe" + export RUSTFLAGS="$RUSTFLAGS -Clink-args=--icf=safe" fi export VERBOSE=1 diff --git a/configs/macos/mozconfig b/configs/macos/mozconfig index 3bed43a1c..0adf87e96 100644 --- a/configs/macos/mozconfig +++ b/configs/macos/mozconfig @@ -21,7 +21,7 @@ if test "$SURFER_COMPAT" = "x86_64"; then export CPPFLAGS="-O3 -march=nehalem" export CXXFLAGS="-O3 -march=nehalem" export LDFLAGS="-Wl,-O3 -march=nehalem" - export RUSTFLAGS="-Ctarget-cpu=nehalem -C codegen-units=1" + export RUSTFLAGS="-Ctarget-cpu=nehalem" else ac_add_options --target=aarch64-apple-darwin @@ -34,7 +34,7 @@ else export CPPFLAGS="-O3 -march=armv8.3-a+simd -mcpu=apple-m1" export CXXFLAGS="-O3 -march=armv8.3-a+simd -mcpu=apple-m1" export LDFLAGS="-Wl,-O3 -march=armv8.3-a+simd -mcpu=apple-m1" - export RUSTFLAGS="-C target-feature=+v8.3a -C codegen-units=1 -Ctarget-cpu=apple-m1" + export RUSTFLAGS="-C target-feature=+v8.3a -Ctarget-cpu=apple-m1" fi export VERBOSE=1 diff --git a/configs/windows/mozconfig b/configs/windows/mozconfig index aa4336271..b7331b26e 100644 --- a/configs/windows/mozconfig +++ b/configs/windows/mozconfig @@ -32,11 +32,8 @@ if test "$SURFER_COMPAT" = "x86_64"; then ac_add_options --target=x86_64-pc-windows-msvc ac_add_options --enable-eme=widevine - ac_add_options --enable-optimize="-O3 -w -ftree-vectorize" + ac_add_options --enable-optimize="-O3 -w -ftree-vectorize -Qvec -mfpmath=sse -mprfchw -msse3 -mcx16 -msahf" - export CFLAGS="-O3 -Qvec -w" - export CPPFLAGS="-O3 -Qvec -w" - export CXXFLAGS="-O3 -Qvec -w" export LDFLAGS="-Wl,-O3" export RUSTFLAGS="-Clink-args=--icf=safe" elif test "$SURFER_COMPAT" = "aarch64"; then @@ -49,7 +46,7 @@ elif test "$SURFER_COMPAT" = "aarch64"; then export CPPFLAGS="-O2 -march=armv8.2-a+simd -mtune=cortex-a55" export CXXFLAGS="-O2 -march=armv8.2-a+simd -mtune=cortex-a55" export LDFLAGS="-Wl,-O2 -march=armv8.2-a+simd -mtune=cortex-a55" - export RUSTFLAGS="-C target-feature=+v8.2a -C codegen-units=1 -Ctarget-cpu=cortex-a55" + export RUSTFLAGS="-C target-feature=+v8.2a -Ctarget-cpu=cortex-a55" fi #export POLLY="-mllvm -polly -mllvm -polly-2nd-level-tiling -mllvm -polly-loopfusion-greedy -mllvm -polly-pattern-matching-based-opts -mllvm -polly-position=before-vectorizer -mllvm -polly-vectorizer=stripmine"