From 2d2fbaaa4aa4a5dc0908b7b9c923b046b5c0585a Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 3 Mar 2014 09:44:16 +0800 Subject: [PATCH 1/8] linux: Dump symbols in create-dist.py. --- atom.gyp | 26 ++++++++++++++++++++++++++ script/create-dist.py | 4 +--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/atom.gyp b/atom.gyp index 803c0ec4b3f..a1158315942 100644 --- a/atom.gyp +++ b/atom.gyp @@ -520,6 +520,32 @@ }, ], }], # 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/mac/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', + ], + }, + ], + }], # OS=="linux" ], }, # target <(project_name>_dump_symbols ], diff --git a/script/create-dist.py b/script/create-dist.py index 604cd69d02d..bacb1deeab9 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -84,7 +84,7 @@ def main(): force_build() if TARGET_PLATFORM != 'linux': download_libchromiumcontent_symbols(args.url) - create_symbols() + create_symbols() copy_binaries() copy_headers() copy_license() @@ -205,8 +205,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) From 95e1ea65993f64662587cc696c1572a13b5649fc Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 3 Mar 2014 09:50:48 +0800 Subject: [PATCH 2/8] Move the generate_breakpad_symbols to tools/posix. --- atom.gyp | 4 ++-- tools/{mac => posix}/generate_breakpad_symbols.py | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename tools/{mac => posix}/generate_breakpad_symbols.py (100%) diff --git a/atom.gyp b/atom.gyp index a1158315942..9ff58a6ddbf 100644 --- a/atom.gyp +++ b/atom.gyp @@ -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', @@ -535,7 +535,7 @@ ], 'action': [ 'python', - 'tools/mac/generate_breakpad_symbols.py', + 'tools/posix/generate_breakpad_symbols.py', '--build-dir=<(PRODUCT_DIR)', '--binary=<(PRODUCT_DIR)/<(project_name)', '--symbols-dir=<(PRODUCT_DIR)/Atom-Shell.breakpad.syms', diff --git a/tools/mac/generate_breakpad_symbols.py b/tools/posix/generate_breakpad_symbols.py similarity index 100% rename from tools/mac/generate_breakpad_symbols.py rename to tools/posix/generate_breakpad_symbols.py From de21a164ea360edcca4a76c8cbb6774f0bf7adb0 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 3 Mar 2014 12:35:52 +0800 Subject: [PATCH 3/8] Build with -g on Linux. --- common.gypi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/common.gypi b/common.gypi index 984c1dd86ed..116dce1578f 100644 --- a/common.gypi +++ b/common.gypi @@ -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', + ], + }], + ], + }], + ], + }, + }], ], } From b8e75df8f0a22439133e2b7270439e00796c7a9a Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 3 Mar 2014 12:55:04 +0800 Subject: [PATCH 4/8] linux: Add strip binary action. --- atom.gyp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/atom.gyp b/atom.gyp index 9ff58a6ddbf..578b020cae5 100644 --- a/atom.gyp +++ b/atom.gyp @@ -544,6 +544,21 @@ '--jobs=16', ], }, + { + 'action_name': 'Strip Binary', + 'inputs': [ + '<(PRODUCT_DIR)/libchromiumcontent.so', + '<(PRODUCT_DIR)/libffmpegsumo.so', + '<(PRODUCT_DIR)/<(project_name)', + ], + 'outputs': [ + '<(PRODUCT_DIR)/dummy_file', + ], + 'action': [ + 'strip', + '<@(_inputs)' + ], + }, ], }], # OS=="linux" ], From 51f0090555d8936a71c4d0a3ff336fdb329a1210 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 3 Mar 2014 14:14:02 +0800 Subject: [PATCH 5/8] Make sure symbol is dumped from unstripped binary. --- script/create-dist.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/script/create-dist.py b/script/create-dist.py index bacb1deeab9..ef3f9a9bbaf 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -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,6 +81,8 @@ def main(): args = parse_args() + if TARGET_PLATFORM == 'linux': + clean_build() force_build() if TARGET_PLATFORM != 'linux': download_libchromiumcontent_symbols(args.url) @@ -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']) From 88dde07bf142edf47418755d19491d31ffa247ea Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 3 Mar 2014 14:17:48 +0800 Subject: [PATCH 6/8] Make sure we dump symbols before stripping binary. --- atom.gyp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/atom.gyp b/atom.gyp index 578b020cae5..19eef43c06a 100644 --- a/atom.gyp +++ b/atom.gyp @@ -550,14 +550,16 @@ '<(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)' - ], + 'action': [ 'strip', '<@(_inputs)' ], }, ], }], # OS=="linux" From 6833865ff35d451a8215803b9fa74cd57167ed82 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 3 Mar 2014 11:12:22 +0000 Subject: [PATCH 7/8] Update libchromiumcontent: Contain linux symbols. --- script/lib/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/lib/config.py b/script/lib/config.py index c2b9d9fe03f..2fa2034455c 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -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' From e89737787918375fbeda350879086a2096106ff4 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 3 Mar 2014 11:31:45 +0000 Subject: [PATCH 8/8] win: Disable pylint in cibuildbuild. --- script/cibuild | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/cibuild b/script/cibuild index dd2dfc5e99c..5625caa09a1 100755 --- a/script/cibuild +++ b/script/cibuild @@ -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'])