devops: introduce goma infrastructure for Chromium builds (#5377)
This patch adds `//browser_patches/chromium/goma.sh` script that manages goma to build chromium.
This commit is contained in:
parent
0871a9cfd9
commit
ad557dc6da
1
browser_patches/chromium/.gitignore
vendored
1
browser_patches/chromium/.gitignore
vendored
|
|
@ -1,2 +1,3 @@
|
||||||
/output
|
/output
|
||||||
/depot_tools
|
/depot_tools
|
||||||
|
/electron-build-tools
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ trap "cd $(pwd -P)" EXIT
|
||||||
cd "$(dirname $0)"
|
cd "$(dirname $0)"
|
||||||
|
|
||||||
USAGE=$(cat<<EOF
|
USAGE=$(cat<<EOF
|
||||||
usage: $(basename $0) [--mirror|--mirror-linux|--mirror-win32|--mirror-win64|--mirror-mac|--compile-mac-arm64]
|
usage: $(basename $0) [--mirror|--mirror-linux|--mirror-win32|--mirror-win64|--mirror-mac|--compile-mac-arm64|--compile-linux|--compile-win32|--compile-win64|--compile-mac]
|
||||||
|
|
||||||
Either compiles chromium or mirrors it from Chromium Continuous Builds CDN.
|
Either compiles chromium or mirrors it from Chromium Continuous Builds CDN.
|
||||||
EOF
|
EOF
|
||||||
|
|
@ -121,6 +121,9 @@ compile_chromium() {
|
||||||
"swiftshader"
|
"swiftshader"
|
||||||
"v8_context_snapshot.bin"
|
"v8_context_snapshot.bin"
|
||||||
)
|
)
|
||||||
|
else
|
||||||
|
echo "ERROR: unknown command, use --help for details"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get chromium SHA from the build revision.
|
# Get chromium SHA from the build revision.
|
||||||
|
|
@ -163,15 +166,29 @@ EOF
|
||||||
echo 'target_cpu = "x86"' >> ./out/Default/args.gn
|
echo 'target_cpu = "x86"' >> ./out/Default/args.gn
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $1 == "--compile-win"* ]]; then
|
if [[ ! -z "$USE_GOMA" ]]; then
|
||||||
/c/Windows/System32/cmd.exe "/c $(cygpath -w ${SCRIPT_PATH}/buildwin.bat)"
|
echo 'use_goma = true' >> ./out/Default/args.gn
|
||||||
else
|
echo "goma_dir = '${SCRIPT_PATH}/electron-build-tools/third_party/goma'" >> ./out/Default/args.gn
|
||||||
gn gen out/Default
|
|
||||||
autoninja -C out/Default chrome
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $1 == "--compile-linux" ]]; then
|
if [[ $1 == "--compile-win"* ]]; then
|
||||||
autoninja -C out/Default chrome_sandbox clear_key_cdm
|
if [[ -z "$USE_GOMA" ]]; then
|
||||||
|
/c/Windows/System32/cmd.exe "/c $(cygpath -w ${SCRIPT_PATH}/buildwin.bat)"
|
||||||
|
else
|
||||||
|
/c/Windows/System32/cmd.exe "/c $(cygpath -w ${SCRIPT_PATH}/buildwingoma.bat)"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
gn gen out/Default
|
||||||
|
if [[ $1 == "--compile-linux" ]]; then
|
||||||
|
TARGETS="chrome chrome_sandbox clear_key_cdm"
|
||||||
|
else
|
||||||
|
TARGETS="chrome"
|
||||||
|
fi
|
||||||
|
if [[ -z "$USE_GOMA" ]]; then
|
||||||
|
autoninja -C out/Default $TARGETS
|
||||||
|
else
|
||||||
|
ninja -j 200 -C out/Default $TARGETS
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Prepare resulting archive.
|
# Prepare resulting archive.
|
||||||
|
|
|
||||||
2
browser_patches/chromium/buildwingoma.bat
Normal file
2
browser_patches/chromium/buildwingoma.bat
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
CALL gn gen out/Default
|
||||||
|
CALL ninja -j 200 -C out/Default chrome
|
||||||
41
browser_patches/chromium/goma.sh
Executable file
41
browser_patches/chromium/goma.sh
Executable file
|
|
@ -0,0 +1,41 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
set +x
|
||||||
|
|
||||||
|
trap "cd $(pwd -P)" EXIT
|
||||||
|
cd "$(dirname $0)"
|
||||||
|
|
||||||
|
if [[ ! -d ./electron-build-tools ]]; then
|
||||||
|
git clone --single-branch --branch msft-goma https://github.com/electron/build-tools/ electron-build-tools
|
||||||
|
cd electron-build-tools
|
||||||
|
npm install
|
||||||
|
mkdir -p third_party
|
||||||
|
./src/e update-goma msftGoma
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd electron-build-tools
|
||||||
|
|
||||||
|
if [[ $1 == "--help" ]]; then
|
||||||
|
echo "$(basename $0) [login|start|stop|--help]"
|
||||||
|
exit 0
|
||||||
|
elif [[ $1 == "login" ]]; then
|
||||||
|
python ./third_party/goma/goma_auth.py login
|
||||||
|
elif [[ $1 == "start" ]]; then
|
||||||
|
if [[ ! -z "$GOMA_LOGIN_COOKIE" ]]; then
|
||||||
|
echo "$GOMA_LOGIN_COOKIE" > "$HOME/.goma_oauth2_config"
|
||||||
|
fi
|
||||||
|
if [[ ! -f "$HOME/.goma_oauth2_config" ]]; then
|
||||||
|
echo "ERROR: goma is not logged in!"
|
||||||
|
echo "run '$(basename $0) login'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
python ./third_party/goma/goma_ctl.py ensure_start
|
||||||
|
elif [[ $1 == "stop" ]]; then
|
||||||
|
python ./third_party/goma/goma_ctl.py stop
|
||||||
|
else
|
||||||
|
echo "ERROR: unknown command - $1"
|
||||||
|
echo "Use --help to list all available commands"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
Loading…
Reference in a new issue