From 13edb480c417ca9370a050aae39ce8d6e529b42a Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Sun, 16 Aug 2026 02:05:45 +0200 Subject: [PATCH] gh-9649: Start cross-compiling macos builds from linux (gh-14978) --- .github/workflows/build.yml | 38 +++- .github/workflows/macos-profile-build.yml | 111 ++++++++++ .github/workflows/macos-release-build.yml | 191 +++++++++--------- .../macos-universal-release-build.yml | 15 +- .github/workflows/windows-release-build.yml | 44 ++-- configs/macos/mozconfig | 26 ++- prefs/firefox/browser.yaml | 4 + src/browser/base/content/aboutDialog-js.patch | 8 +- .../base/content/aboutDialog-xhtml.patch | 19 +- src/zen/split-view/ZenViewSplitter.mjs | 3 +- src/zen/tabs/zen-tabs/vertical-tabs.css | 2 +- 11 files changed, 302 insertions(+), 159 deletions(-) create mode 100644 .github/workflows/macos-profile-build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 095a91134..5cd9cd53a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -287,7 +287,7 @@ jobs: with: use-sccache: ${{ inputs.use-sccache }} build-version: ${{ needs.build-data.outputs.version }} - generate-gpo: true + generate-pgo: true profile-data-path-archive: zen-windows-profile-data-and-jarlog.zip release-branch: ${{ inputs.update_branch }} MOZ_BUILD_DATE: ${{needs.buildid.outputs.buildids}} @@ -313,7 +313,7 @@ jobs: needs: [build-data, windows-step-2, start-self-host, buildid] with: build-version: ${{ needs.build-data.outputs.version }} - generate-gpo: false + generate-pgo: false release-branch: ${{ inputs.update_branch }} MOZ_BUILD_DATE: ${{needs.buildid.outputs.buildids}} use-sccache: ${{ inputs.use-sccache }} @@ -331,15 +331,41 @@ jobs: MOZ_BUILD_DATE: ${{needs.buildid.outputs.buildids}} use-sccache: ${{ inputs.use-sccache }} - mac: - name: macOS build + mac-step-1: + name: macOS build step 1 (PGO build) + uses: ./.github/workflows/macos-release-build.yml + needs: [build-data, buildid] + permissions: + contents: write + secrets: inherit + with: + use-sccache: ${{ inputs.use-sccache }} + build-version: ${{ needs.build-data.outputs.version }} + generate-pgo: true + release-branch: ${{ inputs.update_branch }} + MOZ_BUILD_DATE: ${{needs.buildid.outputs.buildids}} + + mac-step-2: + name: macOS build step 2 (Generate profile data) + uses: ./.github/workflows/macos-profile-build.yml + permissions: + contents: write + secrets: inherit + needs: [mac-step-1, build-data] + with: + build-version: ${{ needs.build-data.outputs.version }} + release-branch: ${{ inputs.update_branch }} + + mac-step-3: + name: macOS build step 3 (build with profile data) uses: ./.github/workflows/macos-release-build.yml permissions: contents: write secrets: inherit - needs: [build-data, buildid] + needs: [build-data, mac-step-2, start-self-host, buildid] with: build-version: ${{ needs.build-data.outputs.version }} + generate-pgo: false release-branch: ${{ inputs.update_branch }} MOZ_BUILD_DATE: ${{needs.buildid.outputs.buildids}} use-sccache: ${{ inputs.use-sccache }} @@ -350,7 +376,7 @@ jobs: permissions: contents: write secrets: inherit - needs: [build-data, mac] + needs: [build-data, mac-step-3] with: build-version: ${{ needs.build-data.outputs.version }} release-branch: ${{ inputs.update_branch }} diff --git a/.github/workflows/macos-profile-build.yml b/.github/workflows/macos-profile-build.yml new file mode 100644 index 000000000..43aa552b2 --- /dev/null +++ b/.github/workflows/macos-profile-build.yml @@ -0,0 +1,111 @@ +name: macOS PGO Builds + +permissions: + contents: read + +on: + workflow_call: + inputs: + build-version: + description: "The version to build" + required: true + type: string + release-branch: + description: "The branch to build" + required: true + type: string + +jobs: + macos-profile-build: + name: | + macOS Profile Build - ${{ matrix.arch }} + strategy: + fail-fast: false + matrix: + arch: [x86_64, aarch64] + + runs-on: ${{ matrix.arch == 'x86_64' && 'macos-15-intel' || 'macos-26' }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + + - name: Setup Python + uses: actions/setup-python@v5 + + - name: Setup Git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Setup Rust + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain $(cat .rust-toolchain) + + - name: Install dependencies + run: npm ci + + - name: Load Surfer CI setup + run: npm run surfer -- ci --brand ${{ inputs.release-branch }} --display-version ${{ inputs.build-version }} + + - name: Download instrumented app + uses: actions/download-artifact@v4 + with: + path: ~/instrumented + name: macos-pgo-stage1-${{ matrix.arch }} + + - name: Download Firefox and dependencies + run: npm run download + + - name: Import patches + env: + SURFER_NO_BRANDING_PATCH: true + run: | + . "$HOME/.cargo/env" + npm run import + + - name: Bootstrap + run: | + cd engine + export SURFER_PLATFORM="darwin" + ./mach --no-interactive bootstrap --application-choice browser --exclude macos-sdk || true + + - name: Extract instrumented app + run: | + set -ex + cd engine + ./mach python -m mozbuild.action.unpack_dmg \ + "$HOME/instrumented/zen-macos-pgo-stage1-${{ matrix.arch }}.dmg" \ + "$HOME/instrumented/app" + APP=$(find "$HOME/instrumented/app" -maxdepth 1 -name "*.app" -type d | head -1) + codesign --force --deep --sign - "$APP" || true + + - name: Generate profile data + run: | + set -ex + export LLVM_PROFDATA="$HOME/.mozbuild/clang/bin/llvm-profdata" + export JARLOG_FILE=en-US.log + BINARY=$(find "$HOME/instrumented" -type f -path "*/Contents/MacOS/zen" | head -1) + test -n "$BINARY" + cd engine + ./mach python ../scripts/download_pgo_extended_corpus.py + ./mach python build/pgo/profileserver.py --binary "$BINARY" --extended-corpus ./pgo-extended-corpus + + - name: Move profile data + run: | + mv engine/merged.profdata merged.profdata + mv engine/en-US.log en-US.log + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + retention-days: 1 + path: | + merged.profdata + en-US.log + name: macos-profdata-${{ matrix.arch }} diff --git a/.github/workflows/macos-release-build.yml b/.github/workflows/macos-release-build.yml index b3395f0f1..514e323cb 100644 --- a/.github/workflows/macos-release-build.yml +++ b/.github/workflows/macos-release-build.yml @@ -1,10 +1,15 @@ name: macOS Release Build + permissions: contents: read on: workflow_call: inputs: + generate-pgo: + required: true + type: boolean + default: false build-version: description: "The version to build" required: true @@ -26,17 +31,22 @@ on: jobs: mac-build: name: Build macOS - ${{ matrix.arch }} - runs-on: ${{ (inputs.release-branch == 'release') && 'blacksmith-6vcpu-macos-latest' || 'macos-26' }} - - strategy: - fail-fast: false - matrix: - arch: [x86_64, aarch64] + runs-on: 'blacksmith-8vcpu-ubuntu-2404' env: SCCACHE_GHA_ENABLED: ${{ inputs.use-sccache && 'true' || 'false' }} CARGO_TERM_COLOR: always CARGO_INCREMENTAL: 0 + strategy: + fail-fast: false + matrix: + arch: [x86_64, aarch64] + steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + tool-cache: false + - name: Checkout repository uses: actions/checkout@v4 with: @@ -44,16 +54,10 @@ jobs: token: ${{ secrets.DEPLOY_KEY }} - name: Setup Node.js - uses: actions/setup-node@v4 + uses: useblacksmith/setup-node@v5 with: node-version-file: ".nvmrc" - - name: Log SDK versions - run: | - ls /Library/Developer/CommandLineTools/SDKs/ - xcrun --show-sdk-version - xcrun --show-sdk-path - - name: Run sccache-cache uses: mozilla-actions/sccache-action@main if: ${{ inputs.use-sccache }} @@ -67,157 +71,156 @@ jobs: core.exportVariable('ACTIONS_CACHE_URL', process.env['ACTIONS_CACHE_URL']) core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env['ACTIONS_RUNTIME_TOKEN']) - - name: Setup Python - uses: actions/setup-python@v5 - # note: This will use the version defined in '.python-version' by default - - name: Setup Git run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" - - name: Install system dependencies + - name: Install dependencies run: | - brew update - brew install cairo gnu-tar mercurial - sudo pip install setuptools + npm ci + sudo apt-get update + sudo apt-get install -y python3 python3-pip zstd yasm nasm build-essential libgtk2.0-dev libpython3-dev m4 uuid libasound2-dev libcurl4-openssl-dev libdbus-1-dev libdrm-dev libdbus-glib-1-dev libgtk-3-dev libpulse-dev libx11-xcb-dev libxt-dev xvfb --fix-missing - brew uninstall --ignore-dependencies python3.12 -f + - name: Load Surfer CI setup + run: npm run surfer -- ci --brand ${{ inputs.release-branch }} --display-version ${{ inputs.build-version }} - export PATH="$(python3 -m site --user-base)/bin":$PATH - python3 -m pip install --user mercurial + - name: Download Firefox and dependencies + run: npm run download - rm '/usr/local/bin/2to3-3.11' '/usr/local/bin/2to3-3.12' '/usr/local/bin/2to3' - rm '/usr/local/bin/idle3.11' '/usr/local/bin/idle3.12' '/usr/local/bin/idle3' - rm '/usr/local/bin/pydoc3.11' '/usr/local/bin/pydoc3.12' '/usr/local/bin/pydoc3' - rm '/usr/local/bin/python3.11' '/usr/local/bin/python3.12' '/usr/local/bin/python3' - rm '/usr/local/bin/python3.11-config' '/usr/local/bin/python3.12-config' '/usr/local/bin/python3-config' + - name: mac-cross Cache + env: + SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5 + id: cache-mac-cross + uses: useblacksmith/cache@v5 + with: + path: ${HOME}/mac-cross + key: mac-cross - brew install watchman + - name: Setup for macOS (cctools and DMG tools) + if: steps.cache-mac-cross.outputs.cache-hit != 'true' + run: | + set -ex + mkdir -p ~/mac-cross + cd engine/ + ./mach artifact toolchain --from-build linux64-cctools-port linux64-libdmg linux64-hfsplus + mv cctools dmg hfsplus ~/mac-cross/ + ls ~/mac-cross/cctools/bin/x86_64-apple-darwin-ld ~/mac-cross/cctools/bin/aarch64-apple-darwin-ld ~/mac-cross/dmg/dmg ~/mac-cross/hfsplus/newfs_hfs + - name: Setup Rust + run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain $(cat .rust-toolchain) source $HOME/.cargo/env - if test "${{ matrix.arch }}" = "aarch64"; then rustup target add aarch64-apple-darwin else rustup target add x86_64-apple-darwin fi - - name: Force usage of gnu-tar - run: | - echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.bash_profile - echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.zsh - source ~/.bash_profile - - - name: Install dependencies - run: | - npm ci - - - name: Load surfer CI setup - run: npm run surfer -- ci --brand ${{ inputs.release-branch }} --display-version ${{ inputs.build-version }} - - - name: Download Firefox source and dependencies - run: npm run download - - name: Import env: SURFER_COMPAT: ${{ matrix.arch }} SURFER_CERT_PATCH_ISSUER: ${{ secrets.SURFER_CERT_PATCH_ISSUER }} SURFER_CERT_PATCH_NAME: ${{ secrets.SURFER_CERT_PATCH_NAME }} - run: npm run import + SURFER_PLATFORM: darwin + run: | + . "$HOME/.cargo/env" + npm run import -- --verbose - name: Bootstrap run: | - cd engine + set -x export SURFER_PLATFORM="darwin" - export PATH="$(python3 -m site --user-base)/bin":$PATH - # Always exist with 0, even if bootstrap fails - ./mach --no-interactive bootstrap --application-choice browser --exclude macos-sdk || true - cd .. + npm run bootstrap - name: Build language packs run: sh scripts/download-language-packs.sh - - name: Build Zen (PGO stage 1 - generate) + - name: Download artifact (if use profdata) + uses: actions/download-artifact@v4 + if: ${{ !inputs.generate-pgo }} + with: + path: ~/artifact + name: macos-profdata-${{ matrix.arch }} + + - name: Show artifact info + if: ${{ !inputs.generate-pgo }} + run: | + ls ~/artifact + ls ~/artifact/en-US.log + ls ~/artifact/merged.profdata + + - name: Build env: SURFER_COMPAT: ${{ matrix.arch }} ZEN_RELEASE_BRANCH: ${{ inputs.release-branch }} - ZEN_GA_GENERATE_PROFILE: 1 ZEN_SAFEBROWSING_API_KEY: ${{ secrets.ZEN_SAFEBROWSING_API_KEY }} ZEN_MOZILLA_API_KEY: ${{ secrets.ZEN_MOZILLA_API_KEY }} ZEN_GOOGLE_LOCATION_SERVICE_API_KEY: ${{ secrets.ZEN_GOOGLE_LOCATION_SERVICE_API_KEY }} - run: | - export SURFER_PLATFORM="darwin" - if [[ -n ${{ inputs.MOZ_BUILD_DATE }} ]];then - export MOZ_BUILD_DATE=${{ inputs.MOZ_BUILD_DATE }} - fi - bash .github/workflows/src/release-build.sh - - - name: Generate PGO profile data - env: - SURFER_COMPAT: ${{ matrix.arch }} run: | set -x - export LLVM_PROFDATA="$HOME/.mozbuild/clang/bin/llvm-profdata" - export JARLOG_FILE=en-US.log - mkdir -p "$HOME/artifact" - cd engine - ./mach python ../scripts/download_pgo_extended_corpus.py - ./mach package - ./mach python build/pgo/profileserver.py --extended-corpus ./pgo-extended-corpus - mv merged.profdata "$HOME/artifact/merged.profdata" - mv en-US.log "$HOME/artifact/en-US.log" - - - name: Build Zen - env: - SURFER_COMPAT: ${{ matrix.arch }} - ZEN_RELEASE_BRANCH: ${{ inputs.release-branch }} - ZEN_SAFEBROWSING_API_KEY: ${{ secrets.ZEN_SAFEBROWSING_API_KEY }} - ZEN_MOZILLA_API_KEY: ${{ secrets.ZEN_MOZILLA_API_KEY }} - ZEN_GOOGLE_LOCATION_SERVICE_API_KEY: ${{ secrets.ZEN_GOOGLE_LOCATION_SERVICE_API_KEY }} - run: | export SURFER_PLATFORM="darwin" + export ZEN_CROSS_COMPILING=1 + if test ${{ inputs.generate-pgo }} = true; then + export ZEN_GA_GENERATE_PROFILE=1 + fi if [[ -n ${{ inputs.MOZ_BUILD_DATE }} ]];then export MOZ_BUILD_DATE=${{ inputs.MOZ_BUILD_DATE }} fi bash .github/workflows/src/release-build.sh + - name: Package instrumented app (PGO stage 1) + if: ${{ inputs.generate-pgo }} + env: + SURFER_COMPAT: ${{ matrix.arch }} + ZEN_RELEASE: 1 + SURFER_PLATFORM: darwin + ZEN_CROSS_COMPILING: 1 + ZEN_GA_GENERATE_PROFILE: 1 + run: | + set -ex + cd engine + ./mach package + mv obj-${{ matrix.arch }}-apple-darwin/dist/*.dmg "$GITHUB_WORKSPACE/zen-macos-pgo-stage1-${{ matrix.arch }}.dmg" + + - name: Upload artifact (PGO stage 1) + uses: actions/upload-artifact@v4 + if: ${{ inputs.generate-pgo }} + with: + retention-days: 2 + name: macos-pgo-stage1-${{ matrix.arch }} + path: ./zen-macos-pgo-stage1-${{ matrix.arch }}.dmg + - name: Package + if: ${{ !inputs.generate-pgo }} env: SURFER_COMPAT: ${{ matrix.arch }} ZEN_GA_DISABLE_PGO: true run: | + set -x export SURFER_PLATFORM="darwin" + export ZEN_CROSS_COMPILING=1 export ZEN_RELEASE=1 npm run package - name: Rename artifacts + if: ${{ !inputs.generate-pgo }} run: | - echo "Tarballing DMG" set -ex mv ./dist/*.dmg ./zen-${{ matrix.arch }}-apple-darwin-dist.dmg - mv ./engine/obj-${{ matrix.arch }}-apple-darwin/dist/host/bin/mar ./zen-macos-host-mar mv ./engine/obj-${{ matrix.arch }}-apple-darwin/dist/bin/platform.ini ./platform.ini - name: Upload dist dmg uses: actions/upload-artifact@v4 + if: ${{ !inputs.generate-pgo }} with: retention-days: 1 name: zen-${{ matrix.arch }}-apple-darwin-dist.dmg path: ./zen-${{ matrix.arch }}-apple-darwin-dist.dmg - - name: Upload host mar - uses: actions/upload-artifact@v4 - if: matrix.arch == 'aarch64' - with: - retention-days: 1 - name: zen-macos-host-mar - path: ./zen-macos-host-mar - - name: Upload platform.ini uses: actions/upload-artifact@v4 - if: matrix.arch == 'x86_64' + if: ${{ !inputs.generate-pgo && matrix.arch == 'x86_64' }} with: retention-days: 1 name: platform.ini diff --git a/.github/workflows/macos-universal-release-build.yml b/.github/workflows/macos-universal-release-build.yml index 762a92a6d..101d39738 100644 --- a/.github/workflows/macos-universal-release-build.yml +++ b/.github/workflows/macos-universal-release-build.yml @@ -99,6 +99,16 @@ jobs: cd engine ./mach configure + - name: Build host mar tool + run: | + set -ex + cd engine + echo "ac_add_options --enable-project=tools/update-packaging" > mar-mozconfig + echo "mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-mar-tools" >> mar-mozconfig + MOZCONFIG=$PWD/mar-mozconfig ./mach build -v + cp obj-mar-tools/dist/host/bin/mar ../zen-macos-host-mar + rm -rf obj-mar-tools mar-mozconfig + - name: Download x86_64 DMG from artifacts uses: actions/download-artifact@v4 with: @@ -213,11 +223,6 @@ jobs: --wait xcrun stapler staple "zen.macos-universal.dmg" - - name: Download host mar - uses: actions/download-artifact@v4 - with: - name: zen-macos-host-mar - - name: Upload build artifact uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/windows-release-build.yml b/.github/workflows/windows-release-build.yml index 56bd977a0..cd993d4e7 100644 --- a/.github/workflows/windows-release-build.yml +++ b/.github/workflows/windows-release-build.yml @@ -6,7 +6,7 @@ permissions: on: workflow_call: inputs: - generate-gpo: + generate-pgo: required: true type: boolean default: false @@ -35,7 +35,7 @@ jobs: windows-build: name: Build Windows - ${{ matrix.arch }} # aarch64 does not need full 16x, and we also dont use full LTO when generating GPO - runs-on: ${{ (inputs.release-branch == 'release' && !inputs.generate-gpo && matrix.arch == 'x86_64') && 'self-hosted' || 'blacksmith-8vcpu-ubuntu-2404' }} + runs-on: ${{ (inputs.release-branch == 'release' && !inputs.generate-pgo && matrix.arch == 'x86_64') && 'self-hosted' || 'blacksmith-8vcpu-ubuntu-2404' }} env: SCCACHE_GHA_ENABLED: ${{ inputs.use-sccache && 'true' || 'false' }} CARGO_TERM_COLOR: always @@ -48,7 +48,7 @@ jobs: steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main - if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} + if: ${{ !(inputs.generate-pgo && matrix.arch == 'aarch64') }} with: tool-cache: false @@ -91,7 +91,7 @@ jobs: run: npm run surfer -- ci --brand ${{ inputs.release-branch }} --display-version ${{ inputs.build-version }} - name: Download Firefox and dependencies - if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} + if: ${{ !(inputs.generate-pgo && matrix.arch == 'aarch64') }} run: npm run download - name: win-cross Cache @@ -104,7 +104,7 @@ jobs: key: win-cross - name: Setup for Windows - if: steps.cache-win-cross.outputs.cache-hit != 'true' && !(inputs.generate-gpo && matrix.arch == 'aarch64') + if: steps.cache-win-cross.outputs.cache-hit != 'true' && !(inputs.generate-pgo && matrix.arch == 'aarch64') run: | set -x mkdir -p ~/win-cross @@ -161,7 +161,7 @@ jobs: ./mach python --virtualenv build taskcluster/scripts/misc/get_vs.py build/vs/vs2026.yaml ~/win-cross/vs2026 - name: Import - if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} + if: ${{ !(inputs.generate-pgo && matrix.arch == 'aarch64') }} env: SURFER_COMPAT: ${{ matrix.arch }} SURFER_CERT_PATCH_ISSUER: ${{ secrets.SURFER_CERT_PATCH_ISSUER }} @@ -171,7 +171,7 @@ jobs: npm run import -- --verbose - name: Bootstrap - if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} + if: ${{ !(inputs.generate-pgo && matrix.arch == 'aarch64') }} run: | set -x cd engine/ @@ -189,7 +189,7 @@ jobs: ls ~/win-cross/vs2026 || true - name: Setup Rust - if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} + if: ${{ !(inputs.generate-pgo && matrix.arch == 'aarch64') }} run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain $(cat .rust-toolchain) source $HOME/.cargo/env @@ -208,18 +208,18 @@ jobs: echo "export MOZ_WINDOWS_RS_DIR=$(pwd)/windows-$WINDOWS_RS_VERSION" >> ../configs/common/mozconfig - name: Build language packs - if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} + if: ${{ !(inputs.generate-pgo && matrix.arch == 'aarch64') }} run: sh scripts/download-language-packs.sh - name: Download artifact (if use profdata) uses: actions/download-artifact@v4 - if: ${{ !inputs.generate-gpo && matrix.arch == 'x86_64' }} + if: ${{ !inputs.generate-pgo && matrix.arch == 'x86_64' }} with: path: ~/artifact name: windows-profdata-${{ matrix.arch == 'aarch64' && 'arm64' || matrix.arch }} - name: Show artifact info - if: ${{ !inputs.generate-gpo && matrix.arch == 'x86_64' }} + if: ${{ !inputs.generate-pgo && matrix.arch == 'x86_64' }} run: | ls ~/artifact ls ~/artifact/en-US.log @@ -228,7 +228,7 @@ jobs: chmod +x ~/artifact/merged.profdata - name: Build - if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} + if: ${{ !(inputs.generate-pgo && matrix.arch == 'aarch64') }} env: SURFER_COMPAT: ${{ matrix.arch }} ZEN_RELEASE_BRANCH: ${{ inputs.release-branch }} @@ -241,7 +241,7 @@ jobs: dos2unix configs/windows/mozconfig export SURFER_PLATFORM="win32" export ZEN_CROSS_COMPILING=1 - if test ${{ inputs.generate-gpo }} = true; then + if test ${{ inputs.generate-pgo }} = true; then export ZEN_GA_GENERATE_PROFILE=1 fi if [[ -n ${{ inputs.MOZ_BUILD_DATE }} ]];then @@ -250,7 +250,7 @@ jobs: bash .github/workflows/src/release-build.sh - name: Package - if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} + if: ${{ !(inputs.generate-pgo && matrix.arch == 'aarch64') }} env: SURFER_COMPAT: ${{ matrix.arch }} ZEN_GA_DISABLE_PGO: true @@ -265,13 +265,13 @@ jobs: ls . - name: Move package for PGO upload - if: ${{ inputs.generate-gpo && matrix.arch == 'x86_64' }} + if: ${{ inputs.generate-pgo && matrix.arch == 'x86_64' }} run: | set -x mv ./zen.win64.zip ./zen.win64-pgo-stage-1.zip - name: Rename artifacts - if: ${{ !inputs.generate-gpo }} + if: ${{ !inputs.generate-pgo }} run: | mv ./zen.win64.zip zen.win-${{ matrix.arch == 'aarch64' && 'arm64' || matrix.arch }}.zip mv ./dist/output.mar windows${{ matrix.arch == 'aarch64' && '-arm64' || '' }}.mar @@ -279,14 +279,14 @@ jobs: - name: Upload artifact (PGO) uses: actions/upload-artifact@v4 - if: ${{ inputs.generate-gpo && matrix.arch == 'x86_64' }} + if: ${{ inputs.generate-pgo && matrix.arch == 'x86_64' }} with: retention-days: 2 name: ${{ matrix.arch == 'aarch64' && 'arm64' || matrix.arch }}-${{ inputs.profile-data-path-archive }} path: ./zen.win64-pgo-stage-1.zip - name: Remove unnecessary files from obj - if: ${{ !inputs.generate-gpo }} + if: ${{ !inputs.generate-pgo }} run: | set -x mkdir obj-${{ matrix.arch }}-pc-windows-msvc/ @@ -301,7 +301,7 @@ jobs: cp -r --no-dereference engine/obj-${{ matrix.arch }}-pc-windows-msvc/* obj-${{ matrix.arch }}-pc-windows-msvc/ || true - name: Upload dist object - if: ${{ !inputs.generate-gpo }} + if: ${{ !inputs.generate-pgo }} uses: actions/upload-artifact@v4 with: retention-days: 2 @@ -309,7 +309,7 @@ jobs: path: obj-${{ matrix.arch }}-pc-windows-msvc - name: Upload artifact (if Twilight branch, installer) - if: ${{ inputs.release-branch == 'twilight' && !inputs.generate-gpo }} + if: ${{ inputs.release-branch == 'twilight' && !inputs.generate-pgo }} uses: actions/upload-artifact@v4 with: retention-days: 5 @@ -317,7 +317,7 @@ jobs: path: ./zen.installer${{ matrix.arch == 'aarch64' && '-arm64' || '' }}.exe - name: Upload artifact (if Twilight branch, .mar) - if: ${{ inputs.release-branch == 'twilight' && !inputs.generate-gpo }} + if: ${{ inputs.release-branch == 'twilight' && !inputs.generate-pgo }} uses: actions/upload-artifact@v4 with: retention-days: 5 @@ -325,7 +325,7 @@ jobs: path: ./windows${{ matrix.arch == 'aarch64' && '-arm64' || '' }}.mar - name: Upload artifact (if Twilight branch, update manifests) - if: ${{ inputs.release-branch == 'twilight' && !inputs.generate-gpo }} + if: ${{ inputs.release-branch == 'twilight' && !inputs.generate-pgo }} uses: actions/upload-artifact@v4 with: retention-days: 5 diff --git a/configs/macos/mozconfig b/configs/macos/mozconfig index c838095cd..889f89e74 100644 --- a/configs/macos/mozconfig +++ b/configs/macos/mozconfig @@ -7,7 +7,21 @@ unset MOZ_STDCXX_COMPAT ac_add_options --disable-dmd ac_add_options --enable-eme=widevine -if test "$ZEN_RELEASE"; then +if test "$ZEN_CROSS_COMPILING"; then + ZEN_MAC_CROSS="$HOME/mac-cross" + + mk_add_options "export PATH=$ZEN_MAC_CROSS/cctools/bin:$PATH" + mk_add_options "export LD_LIBRARY_PATH=$HOME/.mozbuild/clang/lib:$LD_LIBRARY_PATH" + + export MKFSHFS=$ZEN_MAC_CROSS/hfsplus/newfs_hfs + export DMG_TOOL=$ZEN_MAC_CROSS/dmg/dmg + export HFS_TOOL=$ZEN_MAC_CROSS/dmg/hfsplus + + if test "$ZEN_RELEASE"; then + export MOZ_LD64_KNOWN_GOOD=1 + ac_add_options --enable-linker=ld64 + fi +elif test "$ZEN_RELEASE"; then ALLOWED_SDKS="26.5 26.4" for SDK in $ALLOWED_SDKS; do if [ -d "/Library/Developer/CommandLineTools/SDKs/MacOSX${SDK}.sdk" ]; then @@ -52,13 +66,3 @@ else export CXXFLAGS="$CXXFLAGS -mcpu=apple-m1" fi fi - -# Keep using ld64 on PGO/LTO builds because of performance regressions when using lld. -# Mozilla sets "MOZ_LD64_KNOWN_GOOD" to true when they do automated builds with PGO/LTO on macOS. -# See https://searchfox.org/firefox-main/rev/e61d59b5c9a651fd7bf28043f87c0dc669833496/build/moz.configure/lto-pgo.configure#261 -# export MOZ_LD64_KNOWN_GOOD=1 -# ac_add_options --enable-linker=ld64 -# -# if test "$ZEN_RELEASE"; then -# mk_add_options MOZ_MAKE_FLAGS="-j4" -# fi diff --git a/prefs/firefox/browser.yaml b/prefs/firefox/browser.yaml index f3ff0bb34..3afce41ea 100644 --- a/prefs/firefox/browser.yaml +++ b/prefs/firefox/browser.yaml @@ -102,3 +102,7 @@ - name: browser.preonboarding.enabled value: false + +- name: browser.referrals.enabled + value: false + locked: true diff --git a/src/browser/base/content/aboutDialog-js.patch b/src/browser/base/content/aboutDialog-js.patch index 5ca9f1b12..b0bf35bf5 100644 --- a/src/browser/base/content/aboutDialog-js.patch +++ b/src/browser/base/content/aboutDialog-js.patch @@ -1,8 +1,8 @@ diff --git a/browser/base/content/aboutDialog.js b/browser/base/content/aboutDialog.js -index f6e1391baf12abb91c85a95107bb3923118746c0..cac04aa288e8a305d0c8b28e0c919abce87658e5 100644 +index a2fb4433c7044e7f5681d5762285314fa3e00a5c..dac1e79e86c534247a470ae062e59f7e7cba6e38 100644 --- a/browser/base/content/aboutDialog.js +++ b/browser/base/content/aboutDialog.js -@@ -52,7 +52,7 @@ function init() { +@@ -58,7 +58,7 @@ function init() { ]); let versionIdKey = "base"; let versionAttributes = { @@ -11,7 +11,7 @@ index f6e1391baf12abb91c85a95107bb3923118746c0..cac04aa288e8a305d0c8b28e0c919abc }; let arch = Services.sysinfo.get("arch"); -@@ -64,7 +64,7 @@ function init() { +@@ -70,7 +70,7 @@ function init() { } let version = Services.appinfo.version; @@ -20,7 +20,7 @@ index f6e1391baf12abb91c85a95107bb3923118746c0..cac04aa288e8a305d0c8b28e0c919abc versionIdKey += "-nightly"; let buildID = Services.appinfo.appBuildID; let year = buildID.slice(0, 4); -@@ -125,14 +125,6 @@ function init() { +@@ -158,14 +158,6 @@ function init() { window.close(); }); if (AppConstants.MOZ_UPDATER) { diff --git a/src/browser/base/content/aboutDialog-xhtml.patch b/src/browser/base/content/aboutDialog-xhtml.patch index 90da68cd6..db0836ebf 100644 --- a/src/browser/base/content/aboutDialog-xhtml.patch +++ b/src/browser/base/content/aboutDialog-xhtml.patch @@ -1,5 +1,5 @@ diff --git a/browser/base/content/aboutDialog.xhtml b/browser/base/content/aboutDialog.xhtml -index 067eaf8d4e23f76a2423d01a1d9fa71d9ef3c65f..7a831c8ee2b73bb89bf8a82ac24958b55c16a5aa 100644 +index 067eaf8d4e23f76a2423d01a1d9fa71d9ef3c65f..e0badae05d1da7e6de43e1d517539d4b09ec90f5 100644 --- a/browser/base/content/aboutDialog.xhtml +++ b/browser/base/content/aboutDialog.xhtml @@ -102,10 +102,6 @@ @@ -13,7 +13,7 @@ index 067eaf8d4e23f76a2423d01a1d9fa71d9ef3c65f..7a831c8ee2b73bb89bf8a82ac24958b5 #endif -@@ -120,32 +116,22 @@ +@@ -120,12 +116,12 @@ - - + +@@ -144,8 +140,8 @@