Merge pull request #14868 from electron/fix-win-dump-syms

chore: fix windows dump syms
This commit is contained in:
Samuel Attard 2018-09-29 13:11:03 +10:00 committed by GitHub
commit 531a4c5b8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 52 additions and 23 deletions

View file

@ -179,6 +179,21 @@ step-nodejs-headers-build: &step-nodejs-headers-build
cd src
ninja -C out/Default third_party/electron_node:headers
step-electron-publish: &step-electron-publish
run:
name: Publish Electron Dist
command: |
cd src/electron
if [ "$ELECTRON_RELEASE" == "1" ]; then
if [ "$UPLOAD_TO_S3" != "1" ]; then
echo 'Uploading Electron release distribution to github releases'
script/upload.py
else
echo 'Uploading Electron release distribution to s3'
script/upload.py --upload_to_s3
fi
fi
step-persist-data-for-tests: &step-persist-data-for-tests
persist_to_workspace:
root: .
@ -411,6 +426,9 @@ steps-electron-build-for-publish: &steps-electron-build-for-publish
# Node.js headers
- *step-nodejs-headers-build
# Publish
- *step-electron-publish
steps-native-mksnapshot-build: &steps-native-mksnapshot-build
steps:

View file

@ -31,6 +31,7 @@ build_script:
- ninja -C out/Default electron:electron_dist_zip
- ninja -C out/Default electron:electron_mksnapshot_zip
- ninja -C out/Default electron:electron_chromedriver_zip
- ninja -C out/Default third_party/electron_node:headers
- appveyor PushArtifact out/Default/dist.zip
- appveyor PushArtifact out/Default/chromedriver.zip
@ -38,15 +39,17 @@ build_script:
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
ninja -C out/Default third_party/breakpad:dump_syms
python electron\script\dump-symbols.py -d %cd%/out/Default/electron.breakpad.syms
}
- if "%GN_CONFIG%"=="release" ( python electron\script\dump-symbols.py -d %cd%\out\Default\electron.breakpad.syms -v)
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
python electron\script\zip-symbols.py
appveyor PushArtifact out/Default/electron.breakpad.syms
appveyor PushArtifact out/Default/symbols.zip
}
test_script:
- if "%GN_CONFIG%"=="testing" ( echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg )
- ps: >-
if ($env:GN_CONFIG -eq 'testing') {
ninja -C out/Default third_party/electron_node:headers
New-Item .\out\Default\gen\node_headers\Release -Type directory
Copy-Item -path .\out\Default\electron.lib -destination .\out\Default\gen\node_headers\Release\node.lib
} else {
@ -66,4 +69,4 @@ deploy_script:
Write-Output "Uploading Electron release distribution to github releases"
& python script\upload.py
}
}
}

View file

@ -5,7 +5,8 @@ import os
import sys
from lib.config import PLATFORM, enable_verbose_mode, is_verbose_mode
from lib.util import get_electron_branding, execute, rm_rf, get_out_dir
from lib.util import get_electron_branding, execute, rm_rf, get_out_dir, \
GN_SRC_DIR
ELECTRON_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
SOURCE_ROOT = os.path.abspath(os.path.dirname(ELECTRON_ROOT))
@ -30,12 +31,12 @@ def main():
helper_app = os.path.join(build_path, '{0}.app'.format(helper_name),
'Contents', 'MacOS', product_name + " Helper")
binaries = [main_app, helper_app]
for binary in binaries:
generate_posix_symbols(binary, source_root, build_path,
for binary in binaries:
generate_posix_symbols(binary, source_root, build_path,
args.destination)
else:
binary = os.path.join(build_path, project_name)
generate_posix_symbols(binary, source_root, build_path,
generate_posix_symbols(binary, source_root, build_path,
args.destination)
else:
@ -45,8 +46,16 @@ def main():
'--symbols-dir={0}'.format(args.destination),
'--jobs=16',
os.path.relpath(build_path),
]
execute([sys.executable, generate_breakpad_symbols] + args)
]
if is_verbose_mode():
args += ['-v']
#Make sure msdia140.dll is in the path (needed for dump_syms.exe)
env = os.environ.copy()
msdia140_dll_path = os.path.join(GN_SRC_DIR, 'third_party', 'llvm-build',
'Release+Asserts', 'bin')
env['PATH'] = os.path.pathsep.join(
[env.get('PATH', '')] + [msdia140_dll_path])
execute([sys.executable, generate_breakpad_symbols] + args, env)
def get_names_from_branding():
variables = get_electron_branding()
@ -62,9 +71,9 @@ def generate_posix_symbols(binary, source_root, build_dir, destination):
'--jobs=16',
'--binary={0}'.format(binary),
]
if is_verbose_mode():
if is_verbose_mode():
args += ['-v']
execute([sys.executable, generate_breakpad_symbols] + args)
execute([sys.executable, generate_breakpad_symbols] + args)
def parse_args():
parser = argparse.ArgumentParser(description='Create breakpad symbols')
@ -83,7 +92,7 @@ def parse_args():
required=False)
parser.add_argument('-v', '--verbose',
action='store_true',
help='Prints the output of the subprocesses')
help='Prints the output of the subprocesses')
return parser.parse_args()
if __name__ == '__main__':

View file

@ -10,16 +10,13 @@ from lib.util import get_electron_branding, execute, rm_rf, safe_mkdir, s3put, \
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
RELEASE_DIR = get_out_dir()
GEN_DIR = os.path.join(RELEASE_DIR, 'gen')
PROJECT_NAME = get_electron_branding()['project_name']
PRODUCT_NAME = get_electron_branding()['product_name']
if PLATFORM == 'win32':
SYMBOLS_DIR = os.path.join(GEN_DIR, 'symbols')
else:
SYMBOLS_DIR = os.path.join(GEN_DIR, '{0}.breakpad.syms'.format(PROJECT_NAME))
SYMBOLS_DIR = os.path.join(
RELEASE_DIR, '{0}.breakpad.syms'.format(PROJECT_NAME)
)
PDB_LIST = [
os.path.join(RELEASE_DIR, '{0}.exe.pdb'.format(PROJECT_NAME))

View file

@ -65,7 +65,7 @@ def main():
upload_electron(release, electron_zip, args)
if get_target_arch() != 'mips64el':
symbols_zip = os.path.join(OUT_DIR, SYMBOLS_NAME)
shutil.copy2(os.path.join(OUT_DIR, 'symobls.zip'), symbols_zip)
shutil.copy2(os.path.join(OUT_DIR, 'symbols.zip'), symbols_zip)
upload_electron(release, symbols_zip, args)
if PLATFORM == 'darwin':
api_path = os.path.join(OUT_DIR, 'electron-api.json')
@ -77,12 +77,15 @@ def main():
shutil.copy2(os.path.join(OUT_DIR, 'dsym.zip'), dsym_zip)
upload_electron(release, dsym_zip, args)
elif PLATFORM == 'win32':
upload_electron(release, os.path.join(OUT_DIR, PDB_NAME), args)
pdb_zip = os.path.join(OUT_DIR, PDB_NAME)
shutil.copy2(os.path.join(OUT_DIR, 'pdb.zip'), pdb_zip)
upload_electron(release, pdb_zip, args)
# Upload free version of ffmpeg.
ffmpeg = get_zip_name('ffmpeg', ELECTRON_VERSION)
ffmpeg_zip = os.path.join(OUT_DIR, ffmpeg)
shutil.copy2(os.path.join(OUT_DIR, 'ffmpeg.zip'), ffmpeg_zip)
ffmpeg_build_path = os.path.join(GN_SRC_DIR, 'out', 'ffmpeg', 'ffmpeg.zip')
shutil.copy2(ffmpeg_build_path, ffmpeg_zip)
upload_electron(release, ffmpeg_zip, args)
chromedriver = get_zip_name('chromedriver', ELECTRON_VERSION)

View file

@ -56,7 +56,6 @@ jobs:
cd src
ninja -C out/Default third_party/electron_node:headers
displayName: Build Node.js headers for testing
condition: and(succeeded(), eq(variables['RUN_TESTS'], '1'))
- bash: |
cd src