From 047cad1a4dd3ef96cc01931e66d3cee2c96ba36f Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Fri, 12 Oct 2018 22:02:52 -0400 Subject: [PATCH] ci: Fix timeout when generating breakpad symbols (#15126) * ci: breakup dump symbols into multiple steps. * Update step-zip-symbols --- .circleci/config.yml | 30 ++++++++++++++++++++++-------- script/dump-symbols.py | 3 +-- script/zip-symbols.py | 24 +++++++++++++++++------- 3 files changed, 40 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c3f22669d618..9ae213fb35a2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -311,20 +311,30 @@ step-mksnapshot-store: &step-mksnapshot-store path: src/out/Default/mksnapshot.zip destination: mksnapshot.zip -step-generate-breakpad-symbols: &step-generate-breakpad-symbols +step-build-dump-syms: &step-build-dump-syms run: - name: Generate breakpad symbols - environment: - # TODO(alexeykuzmin): Explicitly pass an out folder path to the scripts. - ELECTRON_OUT_DIR: Default + name: Build dump_syms binary command: | cd src - # Build needed dump_syms executable ninja -C out/Default third_party/breakpad:dump_syms - electron/script/dump-symbols.py -d "$PWD/out/Default/electron.breakpad.syms" - electron/script/zip-symbols.py +step-generate-breakpad-symbols: &step-generate-breakpad-symbols + run: + name: Generate breakpad symbols + command: | + cd src + export BUILD_PATH="$PWD/out/Default" + export DEST_PATH="$BUILD_PATH/electron.breakpad.syms" + electron/script/dump-symbols.py -b $BUILD_PATH -d $DEST_PATH -v + +step-zip-symbols: &step-zip-symbols + run: + name: Zip symbols + command: | + cd src + export BUILD_PATH="$PWD/out/Default" + electron/script/zip-symbols.py -b $BUILD_PATH step-maybe-native-mksnapshot-gn-gen: &step-maybe-native-mksnapshot-gn-gen run: @@ -458,7 +468,9 @@ steps-electron-build-for-tests: &steps-electron-build-for-tests # Breakpad symbols. # TODO(alexeykuzmin): We should do it only in nightly builds. + - *step-build-dump-syms - *step-generate-breakpad-symbols + - *step-zip-symbols # Trigger tests on arm hardware if needed - *step-maybe-trigger-arm-test @@ -479,7 +491,9 @@ steps-electron-build-for-publish: &steps-electron-build-for-publish - *step-maybe-electron-dist-strip - *step-electron-dist-build - *step-electron-dist-store + - *step-build-dump-syms - *step-generate-breakpad-symbols + - *step-zip-symbols # mksnapshot - *step-mksnapshot-build diff --git a/script/dump-symbols.py b/script/dump-symbols.py index abb49c4e7cb7..36286edf7018 100755 --- a/script/dump-symbols.py +++ b/script/dump-symbols.py @@ -78,8 +78,7 @@ def generate_posix_symbols(binary, source_root, build_dir, destination): def parse_args(): parser = argparse.ArgumentParser(description='Create breakpad symbols') parser.add_argument('-b', '--build-dir', - help='Path to an Electron build folder. \ - Relative to the --source-root.', + help='Path to an Electron build folder.', default=RELEASE_PATH, required=False) parser.add_argument('-d', '--destination', diff --git a/script/zip-symbols.py b/script/zip-symbols.py index d8caade6df55..745ef5aa2b11 100755 --- a/script/zip-symbols.py +++ b/script/zip-symbols.py @@ -1,5 +1,6 @@ #!/usr/bin/env python +import argparse import glob import os import sys @@ -17,29 +18,38 @@ def main(): if get_target_arch() == 'mips64el': return + args = parse_args() dist_name = 'symbols.zip' - zip_file = os.path.join(OUT_DIR, dist_name) + zip_file = os.path.join(args.build_dir, dist_name) licenses = ['LICENSE', 'LICENSES.chromium.html', 'version'] - with scoped_cwd(OUT_DIR): + with scoped_cwd(args.build_dir): dirs = ['{0}.breakpad.syms'.format(PROJECT_NAME)] print('Making symbol zip: ' + zip_file) make_zip(zip_file, licenses, dirs) if PLATFORM == 'darwin': dsym_name = 'dsym.zip' - with scoped_cwd(OUT_DIR): + with scoped_cwd(args.build_dir): dsyms = glob.glob('*.dSYM') - dsym_zip_file = os.path.join(OUT_DIR, dsym_name) + dsym_zip_file = os.path.join(args.build_dir, dsym_name) print('Making dsym zip: ' + dsym_zip_file) make_zip(dsym_zip_file, licenses, dsyms) elif PLATFORM == 'win32': pdb_name = 'pdb.zip' - with scoped_cwd(OUT_DIR): + with scoped_cwd(args.build_dir): pdbs = glob.glob('*.pdb') - pdb_zip_file = os.path.join(OUT_DIR, pdb_name) + pdb_zip_file = os.path.join(args.build_dir, pdb_name) print('Making pdb zip: ' + pdb_zip_file) make_zip(pdb_zip_file, pdbs + licenses, []) +def parse_args(): + parser = argparse.ArgumentParser(description='Zip symbols') + parser.add_argument('-b', '--build-dir', + help='Path to an Electron build folder.', + default=OUT_DIR, + required=False) + return parser.parse_args() + if __name__ == '__main__': - sys.exit(main()) \ No newline at end of file + sys.exit(main())