Merge pull request #189 from atom/linux-symbols

Dump breakpad symbols on Linux
This commit is contained in:
Cheng Zhao 2014-03-03 11:45:45 +00:00
commit f3103e9b00
6 changed files with 80 additions and 7 deletions

View file

@ -488,7 +488,7 @@
],
'action': [
'python',
'tools/mac/generate_breakpad_symbols.py',
'tools/posix/generate_breakpad_symbols.py',
'--build-dir=<(PRODUCT_DIR)',
'--binary=<(PRODUCT_DIR)/<(product_name).app/Contents/MacOS/<(product_name)',
'--symbols-dir=<(PRODUCT_DIR)/Atom-Shell.breakpad.syms',
@ -520,6 +520,49 @@
},
],
}], # OS=="win"
['OS=="linux"', {
'dependencies': [
'vendor/breakpad/breakpad.gyp:dump_syms',
],
'actions': [
{
'action_name': 'Dump Symbols',
'inputs': [
'<(PRODUCT_DIR)/<(project_name)',
],
'outputs': [
'<(PRODUCT_DIR)/Atom-Shell.breakpad.syms',
],
'action': [
'python',
'tools/posix/generate_breakpad_symbols.py',
'--build-dir=<(PRODUCT_DIR)',
'--binary=<(PRODUCT_DIR)/<(project_name)',
'--symbols-dir=<(PRODUCT_DIR)/Atom-Shell.breakpad.syms',
'--libchromiumcontent-dir=<(libchromiumcontent_library_dir)',
'--clear',
'--jobs=16',
],
},
{
'action_name': 'Strip Binary',
'inputs': [
'<(PRODUCT_DIR)/libchromiumcontent.so',
'<(PRODUCT_DIR)/libffmpegsumo.so',
'<(PRODUCT_DIR)/<(project_name)',
# Add the syms folder as input would force this action to run
# after the 'Dump Symbols' action. And since it is a folder,
# it would be ignored by the 'strip' command.
'<(PRODUCT_DIR)/Atom-Shell.breakpad.syms',
],
'outputs': [
# Gyp action requires a output file, add a fake one here.
'<(PRODUCT_DIR)/dummy_file',
],
'action': [ 'strip', '<@(_inputs)' ],
},
],
}], # OS=="linux"
],
}, # target <(project_name>_dump_symbols
],

View file

@ -244,5 +244,24 @@
},
},
}], # OS=="mac"
# The breakpad on Linux needs the binary to be built with -g to generate
# unmangled symbols.
['OS=="linux"', {
'target_defaults': {
'cflags': [ '-g' ],
'conditions': [
['target_arch=="ia32"', {
'target_conditions': [
['_toolset=="target"', {
'ldflags': [
# Workaround for linker OOM.
'-Wl,--no-keep-memory',
],
}],
],
}],
],
},
}],
],
}

View file

@ -21,7 +21,8 @@ def main():
run_script('bootstrap.py')
run_script('cpplint.py')
run_script('pylint.py')
if sys.platform != 'win32':
run_script('pylint.py')
run_script('coffeelint.py')
run_script('build.py')
run_script('test.py', ['--ci'])

View file

@ -9,7 +9,7 @@ import tarfile
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, NODE_VERSION
from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \
safe_mkdir, execute
safe_mkdir, safe_unlink, execute
ATOM_SHELL_VRESION = get_atom_shell_version()
@ -81,10 +81,12 @@ def main():
args = parse_args()
if TARGET_PLATFORM == 'linux':
clean_build()
force_build()
if TARGET_PLATFORM != 'linux':
download_libchromiumcontent_symbols(args.url)
create_symbols()
create_symbols()
copy_binaries()
copy_headers()
copy_license()
@ -105,6 +107,16 @@ def parse_args():
return parser.parse_args()
def clean_build():
# On Linux stripping binary would cause them to be rebuilt next time, which
# would make create-dist create symbols from stripped binary if it has been
# ran for twice.
# So in order to make sure we built correct symbols everytime, we have to
# force a rebuild of the binaries.
for binary in TARGET_BINARIES[TARGET_PLATFORM]:
safe_unlink(os.path.join(OUT_DIR, binary))
def force_build():
build = os.path.join(SOURCE_ROOT, 'script', 'build.py')
execute([sys.executable, build, '-c', 'Release'])
@ -205,8 +217,6 @@ def create_symbols_zip():
with scoped_cwd(DIST_DIR):
files = ['LICENSE', 'version']
dirs = ['Atom-Shell.breakpad.syms']
if TARGET_PLATFORM == 'linux':
dirs = []
make_zip(zip_file, files, dirs)

View file

@ -2,4 +2,4 @@
NODE_VERSION = 'v0.11.10'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'aa4874a6bcc51fdd87ca7ae0928514ce83645988'
LIBCHROMIUMCONTENT_COMMIT = '9c654df782c77449e7d8fa741843143145260aeb'