devops: infra to automate chromium builds (#5347)

This commit is contained in:
Andrey Lushnikov 2021-02-07 23:54:10 -08:00 коммит произвёл GitHub
Родитель 32ba29a143
Коммит f3a5bba2c4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 58 добавлений и 6 удалений

Просмотреть файл

@ -66,6 +66,16 @@ elif [[ "$BUILD_FLAVOR" == "ffmpeg-cross-compile-win64" ]]; then
EXPECTED_HOST_OS="Ubuntu"
EXPECTED_HOST_OS_VERSION="20.04"
BUILD_BLOB_NAME="ffmpeg-win64.zip"
elif [[ "$BUILD_FLAVOR" == "chromium-win32" ]]; then
BROWSER_NAME="chromium"
EXTRA_BUILD_ARGS="--compile-win32"
EXPECTED_HOST_OS="MINGW"
BUILD_BLOB_NAME="chromium-win32.zip"
elif [[ "$BUILD_FLAVOR" == "chromium-win64" ]]; then
BROWSER_NAME="chromium"
EXTRA_BUILD_ARGS="--compile-win64"
EXPECTED_HOST_OS="MINGW"
BUILD_BLOB_NAME="chromium-win64.zip"
elif [[ "$BUILD_FLAVOR" == "chromium-mac" ]]; then
BROWSER_NAME="chromium"
EXTRA_BUILD_ARGS="--compile-mac"

Просмотреть файл

@ -35,10 +35,15 @@ compile_chromium() {
exit 1
fi
if [[ ! -d "${SCRIPT_PATH}/depot_tools" ]]; then
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git "${SCRIPT_PATH}/depot_tools"
# install depot_tools if they are not in system
# NOTE: as of Feb 8, 2021, windows requires manual and separate
# installation of depot_tools.
if ! command -v autoninja >/dev/null; then
if [[ ! -d "${SCRIPT_PATH}/depot_tools" ]]; then
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git "${SCRIPT_PATH}/depot_tools"
fi
export PATH="${SCRIPT_PATH}/depot_tools:$PATH"
fi
export PATH="${SCRIPT_PATH}/depot_tools:$PATH"
CHROMIUM_FOLDER_NAME=""
CHROMIUM_FILES_TO_ARCHIVE=()
@ -90,6 +95,32 @@ compile_chromium() {
"xdg-mime"
"xdg-settings"
)
elif [[ $1 == "--compile-win"* ]]; then
CHROMIUM_FOLDER_NAME="chrome-win"
CHROMIUM_FILES_TO_ARCHIVE=(
"chrome.dll"
"chrome.exe"
"chrome_100_percent.pak"
"chrome_200_percent.pak"
"chrome_elf.dll"
"chrome_proxy.exe"
"chrome_pwa_launcher.exe"
"D3DCompiler_47.dll"
"elevation_service.exe"
"eventlog_provider.dll"
"First Run"
"icudtl.dat"
"libEGL.dll"
"libGLESv2.dll"
"locales"
"MEIPreload"
"mojo_core.dll"
"nacl_irt_x86_64.nexe"
"notification_helper.exe"
"resources.pak"
"swiftshader"
"v8_context_snapshot.bin"
)
fi
# Get chromium SHA from the build revision.
@ -128,11 +159,16 @@ EOF
if [[ $1 == "--compile-mac-arm64" ]]; then
echo 'target_cpu = "arm64"' >> ./out/Default/args.gn
elif [[ $1 == "--compile-win32" ]]; then
echo 'target_cpu = "x86"' >> ./out/Default/args.gn
fi
# Compile Chromium with correct Xcode version.
gn gen out/Default
autoninja -C out/Default chrome
if [[ $1 == "--compile-win"* ]]; then
/c/Windows/System32/cmd.exe "/c $(cygpath -w ${SCRIPT_PATH}/buildwin.bat)"
else
gn gen out/Default
autoninja -C out/Default chrome
fi
if [[ $1 == "--compile-linux" ]]; then
autoninja -C out/Default chrome_sandbox clear_key_cdm
@ -151,6 +187,10 @@ EOF
for file in ${CHROMIUM_FILES_TO_ARCHIVE[@]}; do
$COPY_COMMAND "${CR_CHECKOUT_PATH}/src/out/Default/${file}" "output/${CHROMIUM_FOLDER_NAME}/${file}"
done
if [[ $1 == "--compile-win"* ]]; then
$COPY_COMMAND "${CR_CHECKOUT_PATH}/src/out/Default/"*.manifest "output/${CHROMIUM_FOLDER_NAME}/"
fi
cd output
zip --symlinks -r build.zip "${CHROMIUM_FOLDER_NAME}"
}

Просмотреть файл

@ -0,0 +1,2 @@
CALL gn gen out/Default
CALL autoninja -C out/Default chrome