build: copy chromedriver to correct location (#22074)

* build: copy chromedriver to correct location

* build: try to free up disk space for macos releases

* get verbose mode working on strip-binaries

* Only use separate chromedriver build arm/arm64
This commit is contained in:
John Kleinschmidt 2020-02-07 13:52:36 -05:00 committed by GitHub
parent 45591e31ce
commit c6cec97287
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 22 deletions

View file

@ -406,7 +406,7 @@ step-maybe-electron-dist-strip: &step-maybe-electron-dist-strip
fi fi
cd src cd src
electron/script/copy-debug-symbols.py --target-cpu="$target_cpu" --out-dir=out/Default/debug --compress electron/script/copy-debug-symbols.py --target-cpu="$target_cpu" --out-dir=out/Default/debug --compress
electron/script/strip-binaries.py --target-cpu="$target_cpu" electron/script/strip-binaries.py -v --target-cpu="$target_cpu"
electron/script/add-debug-link.py --target-cpu="$target_cpu" --debug-dir=out/Default/debug electron/script/add-debug-link.py --target-cpu="$target_cpu" --debug-dir=out/Default/debug
fi fi
@ -446,30 +446,39 @@ step-electron-dist-store: &step-electron-dist-store
path: src/out/Default/dist.zip path: src/out/Default/dist.zip
destination: dist.zip destination: dist.zip
step-electron-chromedriver-gn-gen: &step-electron-chromedriver-gn-gen step-electron-maybe-chromedriver-gn-gen: &step-electron-maybe-chromedriver-gn-gen
run: run:
name: chromedriver GN gen name: chromedriver GN gen
command: | command: |
cd src cd src
if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
if [ "$USE_GOMA" == "true" ]; then if [ "$USE_GOMA" == "true" ]; then
gn gen out/chromedriver --args="import(\"$GN_CONFIG\") import(\"//electron/build/args/goma.gn\") is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS" gn gen out/chromedriver --args="import(\"$GN_CONFIG\") import(\"//electron/build/args/goma.gn\") is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
else else
gn gen out/chromedriver --args="import(\"$GN_CONFIG\") cc_wrapper=\"$SCCACHE_PATH\" is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS" gn gen out/chromedriver --args="import(\"$GN_CONFIG\") cc_wrapper=\"$SCCACHE_PATH\" is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
fi fi
fi
step-electron-chromedriver-build: &step-electron-chromedriver-build step-electron-chromedriver-build: &step-electron-chromedriver-build
run: run:
name: Build chromedriver.zip name: Build chromedriver.zip
command: | command: |
cd src cd src
ninja -C out/chromedriver electron:electron_chromedriver -j $NUMBER_OF_NINJA_PROCESSES if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
electron/script/strip-binaries.py --target-cpu="$TARGET_ARCH" --file $PWD/out/chromedriver/chromedriver export CHROMEDRIVER_DIR="out/chromedriver"
ninja -C out/chromedriver electron:electron_chromedriver_zip else
cp out/chromedriver/chromedriver.zip out/Default/chromedriver export CHROMEDRIVER_DIR="out/Default"
fi
ninja -C $CHROMEDRIVER_DIR electron:electron_chromedriver -j $NUMBER_OF_NINJA_PROCESSES
electron/script/strip-binaries.py -v --target-cpu="$TARGET_ARCH" --file $PWD/$CHROMEDRIVER_DIR/chromedriver
ninja -C $CHROMEDRIVER_DIR electron:electron_chromedriver_zip
if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
cp out/chromedriver/chromedriver.zip out/Default
fi
step-electron-chromedriver-store: &step-electron-chromedriver-store step-electron-chromedriver-store: &step-electron-chromedriver-store
store_artifacts: store_artifacts:
path: src/out/chromedriver/chromedriver.zip path: src/out/Default/chromedriver.zip
destination: chromedriver.zip destination: chromedriver.zip
step-nodejs-headers-build: &step-nodejs-headers-build step-nodejs-headers-build: &step-nodejs-headers-build
@ -496,6 +505,7 @@ step-electron-publish: &step-electron-publish
if [ "`uname`" == "Darwin" ]; then if [ "`uname`" == "Darwin" ]; then
rm -rf src/out/Default/obj rm -rf src/out/Default/obj
fi fi
cd src/electron cd src/electron
if [ "$UPLOAD_TO_S3" == "1" ]; then if [ "$UPLOAD_TO_S3" == "1" ]; then
echo 'Uploading Electron release distribution to S3' echo 'Uploading Electron release distribution to S3'
@ -512,7 +522,7 @@ step-persist-data-for-tests: &step-persist-data-for-tests
# Build artifacts # Build artifacts
- src/out/Default/dist.zip - src/out/Default/dist.zip
- src/out/Default/mksnapshot.zip - src/out/Default/mksnapshot.zip
- src/out/chromedriver/chromedriver.zip - src/out/Default/chromedriver.zip
- src/out/Default/shell_browser_ui_unittests - src/out/Default/shell_browser_ui_unittests
- src/out/Default/gen/node_headers - src/out/Default/gen/node_headers
- src/out/ffmpeg/ffmpeg.zip - src/out/ffmpeg/ffmpeg.zip
@ -547,7 +557,7 @@ step-chromedriver-unzip: &step-chromedriver-unzip
run: run:
name: Unzip chromedriver.zip name: Unzip chromedriver.zip
command: | command: |
cd src/out/chromedriver cd src/out/Default
unzip -o chromedriver.zip unzip -o chromedriver.zip
step-ffmpeg-gn-gen: &step-ffmpeg-gn-gen step-ffmpeg-gn-gen: &step-ffmpeg-gn-gen
@ -592,7 +602,7 @@ step-verify-chromedriver: &step-verify-chromedriver
name: Verify ChromeDriver name: Verify ChromeDriver
command: | command: |
cd src cd src
python electron/script/verify-chromedriver.py --source-root "$PWD" --build-dir out/chromedriver python electron/script/verify-chromedriver.py --source-root "$PWD" --build-dir out/Default
step-setup-linux-for-headless-testing: &step-setup-linux-for-headless-testing step-setup-linux-for-headless-testing: &step-setup-linux-for-headless-testing
run: run:
@ -622,12 +632,12 @@ step-mksnapshot-build: &step-mksnapshot-build
gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
if [ "`uname`" != "Darwin" ]; then if [ "`uname`" != "Darwin" ]; then
if [ "$TARGET_ARCH" == "arm" ]; then if [ "$TARGET_ARCH" == "arm" ]; then
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/mksnapshot electron/script/strip-binaries.py -v --file $PWD/out/Default/clang_x86_v8_arm/mksnapshot
elif [ "$TARGET_ARCH" == "arm64" ]; then elif [ "$TARGET_ARCH" == "arm64" ]; then
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x64_v8_arm64/mksnapshot electron/script/strip-binaries.py -v --file $PWD/out/Default/clang_x64_v8_arm64/mksnapshot
else else
electron/script/strip-binaries.py --file $PWD/out/Default/mksnapshot electron/script/strip-binaries.py -v --file $PWD/out/Default/mksnapshot
electron/script/strip-binaries.py --file $PWD/out/Default/v8_context_snapshot_generator electron/script/strip-binaries.py -v --file $PWD/out/Default/v8_context_snapshot_generator
fi fi
fi fi
if [ "$SKIP_DIST_ZIP" != "1" ]; then if [ "$SKIP_DIST_ZIP" != "1" ]; then
@ -1045,7 +1055,7 @@ steps-electron-build-for-publish: &steps-electron-build-for-publish
- *step-mksnapshot-store - *step-mksnapshot-store
# chromedriver # chromedriver
- *step-electron-chromedriver-gn-gen - *step-electron-maybe-chromedriver-gn-gen
- *step-electron-chromedriver-build - *step-electron-chromedriver-build
- *step-electron-chromedriver-store - *step-electron-chromedriver-store
@ -1076,7 +1086,7 @@ steps-chromedriver-build: &steps-chromedriver-build
- *step-setup-env-for-build - *step-setup-env-for-build
- *step-fix-sync-on-mac - *step-fix-sync-on-mac
- *step-electron-chromedriver-gn-gen - *step-electron-maybe-chromedriver-gn-gen
- *step-electron-chromedriver-build - *step-electron-chromedriver-build
- *step-electron-chromedriver-store - *step-electron-chromedriver-store
@ -1381,7 +1391,7 @@ commands:
- *step-maybe-cross-arch-snapshot-store - *step-maybe-cross-arch-snapshot-store
# chromedriver # chromedriver
- *step-electron-chromedriver-gn-gen - *step-electron-maybe-chromedriver-gn-gen
- *step-electron-chromedriver-build - *step-electron-chromedriver-build
- *step-electron-chromedriver-store - *step-electron-chromedriver-store

View file

@ -4,7 +4,7 @@ import argparse
import os import os
import sys import sys
from lib.config import LINUX_BINARIES from lib.config import LINUX_BINARIES, enable_verbose_mode
from lib.util import execute, get_out_dir from lib.util import execute, get_out_dir
def strip_binaries(directory, target_cpu): def strip_binaries(directory, target_cpu):
@ -26,6 +26,8 @@ def strip_binary(binary_path, target_cpu):
def main(): def main():
args = parse_args() args = parse_args()
if args.verbose:
enable_verbose_mode()
if args.file: if args.file:
strip_binary(args.file, args.target_cpu) strip_binary(args.file, args.target_cpu)
else: else: