diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /taskcluster/scripts/misc/build-custom-car-linux.sh | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'taskcluster/scripts/misc/build-custom-car-linux.sh')
-rwxr-xr-x | taskcluster/scripts/misc/build-custom-car-linux.sh | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/taskcluster/scripts/misc/build-custom-car-linux.sh b/taskcluster/scripts/misc/build-custom-car-linux.sh new file mode 100755 index 0000000000..c92b696e28 --- /dev/null +++ b/taskcluster/scripts/misc/build-custom-car-linux.sh @@ -0,0 +1,65 @@ +#!/bin/bash +set -x -e -v + +# This script is for building a custom version of chromium-as-release on Linux + +# First argument must be the artifact name +ARTIFACT_NAME=$(basename $TOOLCHAIN_ARTIFACT) +shift + +# Use the rest of the arguments as the build config +CONFIG=$(echo $* | tr -d "'") + + +mkdir custom_car +cd custom_car +CUSTOM_CAR_DIR=$PWD + +# Setup depot_tools +git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git +export PATH=$PATH:$CUSTOM_CAR_DIR/depot_tools + + +# Get chromium source code and dependencies +mkdir chromium +cd chromium +fetch --no-history --nohooks chromium + +# setup the .gclient file to ensure pgo profiles are downloaded +# for some reason we need to set --name flag even though it already exists. +# currently the gclient.py file does NOT recognize --custom-var as it's own argument +gclient config --name src "https://chromium.googlesource.com/chromium/src.git" --custom-var="checkout_pgo_profiles=True" --unmanaged + +cd src + +# now we can run hooks and fetch PGO + everything else +gclient runhooks + +# PGO data should be in src/chrome/build/pgo_profiles/ +# with a name like "chrome-{OS}-<some unique identifier>" +export PGO_DATA_DIR="$CUSTOM_CAR_DIR/chromium/src/chrome/build/pgo_profiles" +for entry in "$PGO_DATA_DIR"/* +do + if [ -f "$entry" ];then + export PGO_DATA_PATH="$entry" + fi +done +CONFIG=$(echo $CONFIG pgo_data_path='"'$PGO_DATA_PATH'"') + + +# set up then build chrome +gn gen out/Default --args="$CONFIG" +autoninja -C out/Default chrome # skips test binaries + + +# Gather binary and related files into a zip, and upload it +cd .. +mkdir chromium + +mv src/out/Default chromium +chmod -R +x chromium + +tar caf $ARTIFACT_NAME chromium + +mkdir -p $UPLOAD_DIR +mv $ARTIFACT_NAME $UPLOAD_DIR |