From 14de7ddea8903aec1f45f6d4118705a776d83385 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 2 Apr 2015 13:46:41 +0800 Subject: [PATCH 01/89] Upgrade brightray for component build --- vendor/brightray | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/brightray b/vendor/brightray index f71216bd730..de08e6575b4 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit f71216bd73014199df70425a01dd269ba2dd0c6c +Subproject commit de08e6575b405c151f7941150c5c9a6bcf5d053c From 736afb32a0c1ca6c8e30a3bc1ef1ffe2cd1297bb Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 2 Apr 2015 14:06:23 +0800 Subject: [PATCH 02/89] Link with component build shared libraries --- atom.gyp | 2 +- common.gypi | 6 +++--- vendor/brightray | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/atom.gyp b/atom.gyp index 7ccdcf6daa1..af0692dd95f 100644 --- a/atom.gyp +++ b/atom.gyp @@ -878,8 +878,8 @@ { 'destination': '<(PRODUCT_DIR)/<(product_name) Framework.framework/Versions/A/Libraries', 'files': [ + '<@(libchromiumcontent_shared_libraries)', '<(libchromiumcontent_library_dir)/ffmpegsumo.so', - '<(libchromiumcontent_library_dir)/libchromiumcontent.dylib', '<(PRODUCT_DIR)/libnode.dylib', ], }, diff --git a/common.gypi b/common.gypi index d39d20ec457..7aaa4aa35f8 100644 --- a/common.gypi +++ b/common.gypi @@ -110,17 +110,17 @@ 'conditions': [ ['OS=="linux"', { 'libraries': [ - '<(libchromiumcontent_library_dir)/libchromiumcontent.so', + '<(libchromiumcontent_library_dir)/libv8.so', ], }], ['OS=="win"', { 'libraries': [ - '<(libchromiumcontent_library_dir)/chromiumcontent.dll.lib', + '<(libchromiumcontent_library_dir)/v8.dll.lib', ], }], ['OS=="mac"', { 'libraries': [ - '<(libchromiumcontent_library_dir)/libchromiumcontent.dylib', + '<(libchromiumcontent_library_dir)/libv8.dylib', ], }], ], diff --git a/vendor/brightray b/vendor/brightray index de08e6575b4..a430d8f6536 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit de08e6575b405c151f7941150c5c9a6bcf5d053c +Subproject commit a430d8f653602fd108094398b2ef79dc7126c819 From ca161e29cec4004b0ad157abed226de75f87730c Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 2 Apr 2015 23:02:22 +0800 Subject: [PATCH 03/89] Fix calling our new APIs in patch --- atom/browser/native_window.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index 7d54af028e5..34fd2325ee4 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -54,8 +54,9 @@ #include "ui/gfx/geometry/size_conversions.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/rect.h" -#include "ui/gfx/screen.h" #include "ui/gfx/geometry/size.h" +#include "ui/gfx/screen.h" +#include "ui/gl/gpu_switching_manager.h" #if defined(OS_WIN) #include "ui/gfx/switches.h" @@ -65,10 +66,6 @@ using content::NavigationEntry; using content::RenderWidgetHostView; using content::RenderWidgetHost; -namespace content { -CONTENT_EXPORT extern bool g_use_transparent_window; -} - namespace atom { namespace { @@ -115,7 +112,7 @@ NativeWindow::NativeWindow(content::WebContents* web_contents, // Tell the content module to initialize renderer widget with transparent // mode. - content::g_use_transparent_window = transparent_; + ui::GpuSwitchingManager::SetTransparent(transparent_); // Read icon before window is created. options.Get(switches::kIcon, &icon_); From dab9e9be671528216a8dddf6b58f9414d3710ae5 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 2 Apr 2015 23:03:23 +0800 Subject: [PATCH 04/89] Also build with static_library version of libchromiumcontent --- atom.gyp | 70 +++++++++++++++++++++++++----------------------- common.gypi | 53 ++++++++++++++++++++++++------------ script/build.py | 2 +- script/update.py | 44 ++++++++++++++++++------------ vendor/brightray | 2 +- 5 files changed, 102 insertions(+), 69 deletions(-) diff --git a/atom.gyp b/atom.gyp index af0692dd95f..76daadfcb62 100644 --- a/atom.gyp +++ b/atom.gyp @@ -392,12 +392,16 @@ # Rules for excluding e.g. foo_win.cc from the build on non-Windows. 'filename_rules.gypi', ], - 'configurations': { - 'Debug': { - 'defines': [ 'DEBUG' ], - 'cflags': [ '-g', '-O0' ], - }, - }, + 'conditions': [ + ['libchromiumcontent_component', { + 'configurations': { + 'Debug': { + 'defines': [ 'DEBUG' ], + 'cflags': [ '-g', '-O0' ], + }, + }, + }], + ], }, 'targets': [ { @@ -494,16 +498,16 @@ { 'destination': '<(PRODUCT_DIR)', 'files': [ - '<(libchromiumcontent_library_dir)/chromiumcontent.dll', - '<(libchromiumcontent_library_dir)/ffmpegsumo.dll', - '<(libchromiumcontent_library_dir)/libEGL.dll', - '<(libchromiumcontent_library_dir)/libGLESv2.dll', - '<(libchromiumcontent_resources_dir)/icudtl.dat', - '<(libchromiumcontent_resources_dir)/content_resources_200_percent.pak', - '<(libchromiumcontent_resources_dir)/content_shell.pak', - '<(libchromiumcontent_resources_dir)/ui_resources_200_percent.pak', - '<(libchromiumcontent_resources_dir)/natives_blob.bin', - '<(libchromiumcontent_resources_dir)/snapshot_blob.bin', + '<(libchromiumcontent_dir)/chromiumcontent.dll', + '<(libchromiumcontent_dir)/ffmpegsumo.dll', + '<(libchromiumcontent_dir)/libEGL.dll', + '<(libchromiumcontent_dir)/libGLESv2.dll', + '<(libchromiumcontent_dir)/icudtl.dat', + '<(libchromiumcontent_dir)/content_resources_200_percent.pak', + '<(libchromiumcontent_dir)/content_shell.pak', + '<(libchromiumcontent_dir)/ui_resources_200_percent.pak', + '<(libchromiumcontent_dir)/natives_blob.bin', + '<(libchromiumcontent_dir)/snapshot_blob.bin', 'external_binaries/d3dcompiler_47.dll', 'external_binaries/msvcp120.dll', 'external_binaries/msvcr120.dll', @@ -524,12 +528,12 @@ { 'destination': '<(PRODUCT_DIR)', 'files': [ - '<(libchromiumcontent_library_dir)/libchromiumcontent.so', - '<(libchromiumcontent_library_dir)/libffmpegsumo.so', - '<(libchromiumcontent_resources_dir)/icudtl.dat', - '<(libchromiumcontent_resources_dir)/content_shell.pak', - '<(libchromiumcontent_resources_dir)/natives_blob.bin', - '<(libchromiumcontent_resources_dir)/snapshot_blob.bin', + '<(libchromiumcontent_dir)/libchromiumcontent.so', + '<(libchromiumcontent_dir)/libffmpegsumo.so', + '<(libchromiumcontent_dir)/icudtl.dat', + '<(libchromiumcontent_dir)/content_shell.pak', + '<(libchromiumcontent_dir)/natives_blob.bin', + '<(libchromiumcontent_dir)/snapshot_blob.bin', ], }, { @@ -716,7 +720,7 @@ '--build-dir=<(PRODUCT_DIR)', '--binary=<(PRODUCT_DIR)/<(product_name).app/Contents/MacOS/<(product_name)', '--symbols-dir=<(PRODUCT_DIR)/Atom-Shell.breakpad.syms', - '--libchromiumcontent-dir=<(libchromiumcontent_library_dir)', + '--libchromiumcontent-dir=<(libchromiumcontent_dir)', '--clear', '--jobs=16', ], @@ -739,7 +743,7 @@ '--symbols-dir=<(PRODUCT_DIR)/Atom-Shell.breakpad.syms', '--jobs=16', '<(PRODUCT_DIR)', - '<(libchromiumcontent_library_dir)', + '<(libchromiumcontent_dir)', ], }, ], @@ -763,7 +767,7 @@ '--build-dir=<(PRODUCT_DIR)', '--binary=<(PRODUCT_DIR)/<(project_name)', '--symbols-dir=<(PRODUCT_DIR)/Atom-Shell.breakpad.syms', - '--libchromiumcontent-dir=<(libchromiumcontent_library_dir)', + '--libchromiumcontent-dir=<(libchromiumcontent_dir)', '--clear', '--jobs=16', ], @@ -808,7 +812,7 @@ ], }, 'inputs': [ - '<(libchromiumcontent_library_dir)/<(chromedriver_binary)', + '<(libchromiumcontent_dir)/<(chromedriver_binary)', ], 'outputs': [ '<(PRODUCT_DIR)/<(chromedriver_binary)', @@ -839,7 +843,7 @@ 'include_dirs': [ '.', 'vendor', - '<(libchromiumcontent_include_dir)', + '<(libchromiumcontent_src_dir)', ], 'defines': [ 'PRODUCT_NAME="<(product_name)"', @@ -859,10 +863,10 @@ 'mac_bundle': 1, 'mac_bundle_resources': [ 'atom/common/resources/mac/MainMenu.xib', - '<(libchromiumcontent_resources_dir)/content_shell.pak', - '<(libchromiumcontent_resources_dir)/icudtl.dat', - '<(libchromiumcontent_resources_dir)/natives_blob.bin', - '<(libchromiumcontent_resources_dir)/snapshot_blob.bin', + '<(libchromiumcontent_dir)/content_shell.pak', + '<(libchromiumcontent_dir)/icudtl.dat', + '<(libchromiumcontent_dir)/natives_blob.bin', + '<(libchromiumcontent_dir)/snapshot_blob.bin', ], 'xcode_settings': { 'INFOPLIST_FILE': 'atom/common/resources/mac/Info.plist', @@ -879,7 +883,7 @@ 'destination': '<(PRODUCT_DIR)/<(product_name) Framework.framework/Versions/A/Libraries', 'files': [ '<@(libchromiumcontent_shared_libraries)', - '<(libchromiumcontent_library_dir)/ffmpegsumo.so', + '<(libchromiumcontent_dir)/ffmpegsumo.so', '<(PRODUCT_DIR)/libnode.dylib', ], }, @@ -974,7 +978,7 @@ 'action_name': 'Create node.lib', 'inputs': [ '<(PRODUCT_DIR)/node.dll.lib', - '<(libchromiumcontent_library_dir)/chromiumcontent.dll.lib', + '<(libchromiumcontent_dir)/chromiumcontent.dll.lib', ], 'outputs': [ '<(PRODUCT_DIR)/node.lib', diff --git a/common.gypi b/common.gypi index 7aaa4aa35f8..28633effd54 100644 --- a/common.gypi +++ b/common.gypi @@ -107,23 +107,42 @@ ], }], ['_target_name=="node"', { - 'conditions': [ - ['OS=="linux"', { - 'libraries': [ - '<(libchromiumcontent_library_dir)/libv8.so', - ], - }], - ['OS=="win"', { - 'libraries': [ - '<(libchromiumcontent_library_dir)/v8.dll.lib', - ], - }], - ['OS=="mac"', { - 'libraries': [ - '<(libchromiumcontent_library_dir)/libv8.dylib', - ], - }], - ], + 'variables': { + 'conditions': [ + ['OS=="linux" and libchromiumcontent_component==1', { + 'v8_libs': ['<(libchromiumcontent_dir)/libv8.so'] + }], + ['OS=="mac" and libchromiumcontent_component==1', { + 'v8_libs': ['<(libchromiumcontent_dir)/libv8.dylib'] + }], + ['OS=="win" and libchromiumcontent_component==1', { + 'v8_libs': ['<(libchromiumcontent_dir)/v8.dll.lib'] + }], + ['OS in ["linux", "mac"] and libchromiumcontent_component==0', { + 'v8_libs': [ + '<(libchromiumcontent_dir)/libv8_base.a', + '<(libchromiumcontent_dir)/libv8_external_snapshot.a', + '<(libchromiumcontent_dir)/libv8_libbase.a', + '<(libchromiumcontent_dir)/libv8_libplatform.a', + '<(libchromiumcontent_dir)/libicudata.a', + '<(libchromiumcontent_dir)/libicui18n.a', + '<(libchromiumcontent_dir)/libicuuc.a', + ], + }], + ['OS=="win" and libchromiumcontent_component==0', { + 'v8_libs': [ + '<(libchromiumcontent_dir)/v8_base.lib', + '<(libchromiumcontent_dir)/v8_external_snapshot.lib', + '<(libchromiumcontent_dir)/v8_libbase.lib', + '<(libchromiumcontent_dir)/v8_libplatform.lib', + '<(libchromiumcontent_dir)/icudata.lib', + '<(libchromiumcontent_dir)/icui18n.lib', + '<(libchromiumcontent_dir)/icuuc.lib', + ], + }], + ], + }, + 'libraries': ['<@(v8_libs)'] }], ['_target_name=="libuv"', { 'conditions': [ diff --git a/script/build.py b/script/build.py index 1dd60deffe1..52d4cc5fd80 100755 --- a/script/build.py +++ b/script/build.py @@ -19,7 +19,7 @@ def main(): args = parse_args() for config in args.configuration: - build_path = os.path.join('out', config) + build_path = os.path.join('out', 'Real' + config) ret = subprocess.call([ninja, '-C', build_path, args.target]) if ret != 0: sys.exit(ret) diff --git a/script/update.py b/script/update.py index 2fe52e7f3a6..67a0c2b5002 100755 --- a/script/update.py +++ b/script/update.py @@ -14,7 +14,7 @@ def main(): os.chdir(SOURCE_ROOT) update_external_binaries() - update_gyp() + return update_gyp() def update_external_binaries(): @@ -23,27 +23,37 @@ def update_external_binaries(): def update_gyp(): - gyp = os.path.join('vendor', 'brightray', 'vendor', 'gyp', 'gyp_main.py') - python = sys.executable - arch = DIST_ARCH + target_arch = DIST_ARCH if sys.platform == 'darwin': # Only have 64bit build on OS X. - arch = 'x64' + target_arch = 'x64' elif sys.platform in ['cygwin', 'win32']: # Only have 32bit build on Windows. - arch = 'ia32' - if sys.platform == 'cygwin': - # Force using win32 python on cygwin. - python = os.path.join('vendor', 'python_26', 'python.exe') + target_arch = 'ia32' - ret = subprocess.call([python, gyp, - '-f', 'ninja', '--depth', '.', 'atom.gyp', - '-Icommon.gypi', - '-Dlinux_clang=0', # Disable brightray's clang setting - '-Dtarget_arch={0}'.format(arch), - '-Dlibrary=static_library']) - if ret != 0: - sys.exit(ret) + # Since gyp doesn't support specify link_settings for each configuration, + # we are not able to link to different libraries in "Debug" and "Release" + # configurations. + # In order to work around this, we decided to generate the configuration + # for twice, one is to generate "Debug" config, the other one to generate + # the "Release" config. And the settings are controlled by the variable + # "libchromiumcontent_component" which is defined before running gyp. + return (run_gyp(target_arch, 0) or run_gyp(target_arch, 1)) + + +def run_gyp(target_arch, component): + python = sys.executable + if sys.platform == 'cygwin': + # Force using win32 python on cygwin. + python = os.path.join('vendor', 'python_26', 'python.exe') + gyp = os.path.join('vendor', 'brightray', 'vendor', 'gyp', 'gyp_main.py') + return subprocess.call([python, gyp, + '-f', 'ninja', '--depth', '.', 'atom.gyp', + '-Icommon.gypi', + '-Dlibchromiumcontent_component={0}'.format(component), + '-Dlinux_clang=0', # FIXME remove me. + '-Dtarget_arch={0}'.format(target_arch), + '-Dlibrary=static_library']) if __name__ == '__main__': diff --git a/vendor/brightray b/vendor/brightray index a430d8f6536..09c73a0e615 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit a430d8f653602fd108094398b2ef79dc7126c819 +Subproject commit 09c73a0e615807fe238f74b697e60696d6451bd1 From 8a91000083f313956a5358786db23eaf953d6d84 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 3 Apr 2015 11:38:04 +0800 Subject: [PATCH 05/89] Fix linking node and chromium together --- atom.gyp | 22 ++++++++++++++++++-- common.gypi | 54 +++++++++++++++--------------------------------- vendor/brightray | 2 +- 3 files changed, 38 insertions(+), 40 deletions(-) diff --git a/atom.gyp b/atom.gyp index 76daadfcb62..610fc2a0887 100644 --- a/atom.gyp +++ b/atom.gyp @@ -528,7 +528,6 @@ { 'destination': '<(PRODUCT_DIR)', 'files': [ - '<(libchromiumcontent_dir)/libchromiumcontent.so', '<(libchromiumcontent_dir)/libffmpegsumo.so', '<(libchromiumcontent_dir)/icudtl.dat', '<(libchromiumcontent_dir)/content_shell.pak', @@ -880,9 +879,18 @@ }, 'copies': [ { + 'variables': { + 'conditions': [ + ['libchromiumcontent_component', { + 'copied_libraries': '<(libchromiumcontent_shared_libraries)', + }, { + 'copied_libraries': ['<(libchromiumcontent_dir)/libboringssl.dylib'], + }], + ], + }, 'destination': '<(PRODUCT_DIR)/<(product_name) Framework.framework/Versions/A/Libraries', 'files': [ - '<@(libchromiumcontent_shared_libraries)', + '<@(copied_libraries)', '<(libchromiumcontent_dir)/ffmpegsumo.so', '<(PRODUCT_DIR)/libnode.dylib', ], @@ -906,6 +914,16 @@ '${BUILT_PRODUCTS_DIR}/<(product_name) Framework.framework/Versions/A/<(product_name) Framework', ], }, + { + 'postbuild_name': 'Fix path of libboringssl', + 'action': [ + 'install_name_tool', + '-change', + '/usr/local/lib/libboringssl.dylib', + '@rpath/libboringssl.dylib', + '${BUILT_PRODUCTS_DIR}/<(product_name) Framework.framework/Versions/A/<(product_name) Framework', + ], + }, { 'postbuild_name': 'Add symlinks for framework subdirectories', 'action': [ diff --git a/common.gypi b/common.gypi index 28633effd54..f7c0b327ba7 100644 --- a/common.gypi +++ b/common.gypi @@ -103,46 +103,26 @@ }], ['_target_name in ["node", "atom_lib"]', { 'include_dirs': [ - 'vendor/brightray/vendor/download/libchromiumcontent/src/v8/include', + '<(libchromiumcontent_src_dir)/v8/include', ], }], ['_target_name=="node"', { - 'variables': { - 'conditions': [ - ['OS=="linux" and libchromiumcontent_component==1', { - 'v8_libs': ['<(libchromiumcontent_dir)/libv8.so'] - }], - ['OS=="mac" and libchromiumcontent_component==1', { - 'v8_libs': ['<(libchromiumcontent_dir)/libv8.dylib'] - }], - ['OS=="win" and libchromiumcontent_component==1', { - 'v8_libs': ['<(libchromiumcontent_dir)/v8.dll.lib'] - }], - ['OS in ["linux", "mac"] and libchromiumcontent_component==0', { - 'v8_libs': [ - '<(libchromiumcontent_dir)/libv8_base.a', - '<(libchromiumcontent_dir)/libv8_external_snapshot.a', - '<(libchromiumcontent_dir)/libv8_libbase.a', - '<(libchromiumcontent_dir)/libv8_libplatform.a', - '<(libchromiumcontent_dir)/libicudata.a', - '<(libchromiumcontent_dir)/libicui18n.a', - '<(libchromiumcontent_dir)/libicuuc.a', - ], - }], - ['OS=="win" and libchromiumcontent_component==0', { - 'v8_libs': [ - '<(libchromiumcontent_dir)/v8_base.lib', - '<(libchromiumcontent_dir)/v8_external_snapshot.lib', - '<(libchromiumcontent_dir)/v8_libbase.lib', - '<(libchromiumcontent_dir)/v8_libplatform.lib', - '<(libchromiumcontent_dir)/icudata.lib', - '<(libchromiumcontent_dir)/icui18n.lib', - '<(libchromiumcontent_dir)/icuuc.lib', - ], - }], - ], - }, - 'libraries': ['<@(v8_libs)'] + 'conditions': [ + ['OS=="mac"', { + 'libraries': [ '-undefined dynamic_lookup' ], + 'xcode_settings': { + 'DYLIB_INSTALL_NAME_BASE': '@rpath' + }, + }], + ['OS=="win"', { + 'libraries': [ + '<(libchromiumcontent_root_dir)/shared_library/v8.dll.lib', + ], + }], + ['OS=="linux"', { + 'cflags': [ '-fPIC' ], + }], + ] }], ['_target_name=="libuv"', { 'conditions': [ diff --git a/vendor/brightray b/vendor/brightray index 09c73a0e615..ca993560286 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 09c73a0e615807fe238f74b697e60696d6451bd1 +Subproject commit ca993560286e14aa936d3cff415e2b317ba8faf0 From 8b7d875e40e6be025cfcb736eae3546586a0e2a6 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 3 Apr 2015 11:59:14 +0800 Subject: [PATCH 06/89] Use "R" and "D" as short names for config --- script/build.py | 2 +- script/create-dist.py | 4 ++-- script/lib/util.py | 2 +- script/test.py | 6 +++--- script/upload-node-headers.py | 2 +- script/upload-windows-pdb.py | 4 ++-- script/upload.py | 8 ++++---- vendor/brightray | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/script/build.py b/script/build.py index 52d4cc5fd80..9935c1b2d5d 100755 --- a/script/build.py +++ b/script/build.py @@ -19,7 +19,7 @@ def main(): args = parse_args() for config in args.configuration: - build_path = os.path.join('out', 'Real' + config) + build_path = os.path.join('out', config[0]) ret = subprocess.call([ninja, '-C', build_path, args.target]) if ret != 0: sys.exit(ret) diff --git a/script/create-dist.py b/script/create-dist.py index 49b186edb67..36cc61e5939 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -17,7 +17,7 @@ ATOM_SHELL_VERSION = get_atom_shell_version() SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DIST_DIR = os.path.join(SOURCE_ROOT, 'dist') -OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'Release') +OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R') SYMBOL_NAME = { 'darwin': 'libchromiumcontent.dylib.dSYM', @@ -162,7 +162,7 @@ def create_version(): def download_libchromiumcontent_symbols(url): brightray_dir = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor') target_dir = os.path.join(brightray_dir, 'download', 'libchromiumcontent') - symbols_path = os.path.join(target_dir, 'Release', SYMBOL_NAME) + symbols_path = os.path.join(target_dir, 'R', SYMBOL_NAME) if os.path.exists(symbols_path): return diff --git a/script/lib/util.py b/script/lib/util.py index 1c4f26b76ad..174c65a83d9 100644 --- a/script/lib/util.py +++ b/script/lib/util.py @@ -160,7 +160,7 @@ def get_atom_shell_version(): def get_chromedriver_version(): SOURCE_ROOT = os.path.abspath(os.path.join(__file__, '..', '..', '..')) - chromedriver = os.path.join(SOURCE_ROOT, 'out', 'Release', 'chromedriver') + chromedriver = os.path.join(SOURCE_ROOT, 'out', 'R', 'chromedriver') output = subprocess.check_output([chromedriver, '-v']).strip() return 'v' + output[13:] diff --git a/script/test.py b/script/test.py index c21e52ab548..21a1083cb1e 100755 --- a/script/test.py +++ b/script/test.py @@ -12,12 +12,12 @@ def main(): os.chdir(SOURCE_ROOT) if sys.platform == 'darwin': - atom_shell = os.path.join(SOURCE_ROOT, 'out', 'Debug', 'Atom.app', + atom_shell = os.path.join(SOURCE_ROOT, 'out', 'D', 'Atom.app', 'Contents', 'MacOS', 'Atom') elif sys.platform == 'win32': - atom_shell = os.path.join(SOURCE_ROOT, 'out', 'Debug', 'atom.exe') + atom_shell = os.path.join(SOURCE_ROOT, 'out', 'D', 'atom.exe') else: - atom_shell = os.path.join(SOURCE_ROOT, 'out', 'Debug', 'atom') + atom_shell = os.path.join(SOURCE_ROOT, 'out', 'D', 'atom') subprocess.check_call([atom_shell, 'spec'] + sys.argv[1:]) diff --git a/script/upload-node-headers.py b/script/upload-node-headers.py index 6734929c10e..c8998a80054 100755 --- a/script/upload-node-headers.py +++ b/script/upload-node-headers.py @@ -14,7 +14,7 @@ from lib.util import execute, safe_mkdir, scoped_cwd, s3_config, s3put SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DIST_DIR = os.path.join(SOURCE_ROOT, 'dist') NODE_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'node') -OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'Release') +OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R') HEADERS_SUFFIX = [ '.h', diff --git a/script/upload-windows-pdb.py b/script/upload-windows-pdb.py index e03e2bcfac7..99dc4101342 100755 --- a/script/upload-windows-pdb.py +++ b/script/upload-windows-pdb.py @@ -10,8 +10,8 @@ SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) SYMBOLS_DIR = 'dist\\symbols' DOWNLOAD_DIR = 'vendor\\brightray\\vendor\\download\\libchromiumcontent' PDB_LIST = [ - 'out\\Release\\atom.exe.pdb', - DOWNLOAD_DIR + '\\Release\\chromiumcontent.dll.pdb', + 'out\\R\\atom.exe.pdb', + DOWNLOAD_DIR + '\\R\\chromiumcontent.dll.pdb', ] diff --git a/script/upload.py b/script/upload.py index e066d89423d..677247a2e6e 100755 --- a/script/upload.py +++ b/script/upload.py @@ -18,7 +18,7 @@ ATOM_SHELL_VERSION = get_atom_shell_version() CHROMEDRIVER_VERSION = get_chromedriver_version() SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) -OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'Release') +OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R') DIST_DIR = os.path.join(SOURCE_ROOT, 'dist') DIST_NAME = 'atom-shell-{0}-{1}-{2}.zip'.format(ATOM_SHELL_VERSION, TARGET_PLATFORM, @@ -84,12 +84,12 @@ def parse_args(): def get_atom_shell_build_version(): if TARGET_PLATFORM == 'darwin': - atom_shell = os.path.join(SOURCE_ROOT, 'out', 'Release', 'Atom.app', + atom_shell = os.path.join(SOURCE_ROOT, 'out', 'R', 'Atom.app', 'Contents', 'MacOS', 'Atom') elif TARGET_PLATFORM == 'win32': - atom_shell = os.path.join(SOURCE_ROOT, 'out', 'Release', 'atom.exe') + atom_shell = os.path.join(SOURCE_ROOT, 'out', 'R', 'atom.exe') else: - atom_shell = os.path.join(SOURCE_ROOT, 'out', 'Release', 'atom') + atom_shell = os.path.join(SOURCE_ROOT, 'out', 'R', 'atom') return subprocess.check_output([atom_shell, '--version']).strip() diff --git a/vendor/brightray b/vendor/brightray index ca993560286..f89e3f633ec 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit ca993560286e14aa936d3cff415e2b317ba8faf0 +Subproject commit f89e3f633ec0c9ead422d0a39f7f42e693544d08 From d3abf64bd219325db543001bb250d9a7755b43fb Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 3 Apr 2015 12:06:23 +0800 Subject: [PATCH 07/89] Strip generate binaries --- common.gypi | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/common.gypi b/common.gypi index f7c0b327ba7..7e57301316d 100644 --- a/common.gypi +++ b/common.gypi @@ -154,11 +154,16 @@ ], }], ['_type in ["executable", "shared_library"]', { - # On some machines setting CLANG_CXX_LIBRARY doesn't work for linker. 'xcode_settings': { + # On some machines setting CLANG_CXX_LIBRARY doesn't work for linker. 'OTHER_LDFLAGS': [ '-stdlib=libc++' ], + # Generates symbols and strip the binary. + 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym', + 'DEPLOYMENT_POSTPROCESSING': 'YES', + 'STRIP_INSTALLED_PRODUCT': 'YES', + 'STRIPFLAGS': '-x', }, }], ], @@ -198,9 +203,6 @@ ], }, }, - 'xcode_settings': { - 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym', - }, }, 'conditions': [ # Settings to compile with clang under OS X. From 40c85f20424d107e30fedcfc470d57dd9466ea4d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 3 Apr 2015 14:33:52 +0800 Subject: [PATCH 08/89] Do not download symbols --- script/create-dist.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/script/create-dist.py b/script/create-dist.py index 36cc61e5939..9972e5738c8 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -85,7 +85,6 @@ def main(): args = parse_args() force_build() - download_libchromiumcontent_symbols(args.url) create_symbols() copy_binaries() copy_chromedriver() @@ -159,19 +158,6 @@ def create_version(): version_file.write(ATOM_SHELL_VERSION) -def download_libchromiumcontent_symbols(url): - brightray_dir = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor') - target_dir = os.path.join(brightray_dir, 'download', 'libchromiumcontent') - symbols_path = os.path.join(target_dir, 'R', SYMBOL_NAME) - if os.path.exists(symbols_path): - return - - download = os.path.join(brightray_dir, 'libchromiumcontent', 'script', - 'download') - subprocess.check_call([sys.executable, download, '-f', '-s', '-c', - LIBCHROMIUMCONTENT_COMMIT, url, target_dir]) - - def create_symbols(): directory = 'Atom-Shell.breakpad.syms' rm_rf(os.path.join(OUT_DIR, directory)) From bb7217a58ccb54d10371797c62213ab19cc51b06 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 3 Apr 2015 14:39:25 +0800 Subject: [PATCH 09/89] Move filenames to another gyp file --- atom.gyp | 386 +------------------------------------------------ filenames.gypi | 379 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 385 insertions(+), 380 deletions(-) create mode 100644 filenames.gypi diff --git a/atom.gyp b/atom.gyp index 610fc2a0887..3c6728175bc 100644 --- a/atom.gyp +++ b/atom.gyp @@ -1,389 +1,14 @@ { 'variables': { - 'includes': [ - 'vendor/native_mate/native_mate_files.gypi', - ], 'project_name%': 'atom', 'product_name%': 'Atom', - 'app_sources': [ - 'atom/app/atom_main.cc', - 'atom/app/atom_main.h', - ], - 'bundle_sources': [ - 'atom/browser/resources/mac/atom.icns', - ], - 'coffee_sources': [ - 'atom/browser/api/lib/app.coffee', - 'atom/browser/api/lib/atom-delegate.coffee', - 'atom/browser/api/lib/auto-updater.coffee', - 'atom/browser/api/lib/browser-window.coffee', - 'atom/browser/api/lib/content-tracing.coffee', - 'atom/browser/api/lib/dialog.coffee', - 'atom/browser/api/lib/global-shortcut.coffee', - 'atom/browser/api/lib/ipc.coffee', - 'atom/browser/api/lib/menu.coffee', - 'atom/browser/api/lib/menu-item.coffee', - 'atom/browser/api/lib/power-monitor.coffee', - 'atom/browser/api/lib/protocol.coffee', - 'atom/browser/api/lib/screen.coffee', - 'atom/browser/api/lib/tray.coffee', - 'atom/browser/api/lib/web-contents.coffee', - 'atom/browser/lib/chrome-extension.coffee', - 'atom/browser/lib/guest-view-manager.coffee', - 'atom/browser/lib/guest-window-manager.coffee', - 'atom/browser/lib/init.coffee', - 'atom/browser/lib/objects-registry.coffee', - 'atom/browser/lib/rpc-server.coffee', - 'atom/common/api/lib/callbacks-registry.coffee', - 'atom/common/api/lib/clipboard.coffee', - 'atom/common/api/lib/crash-reporter.coffee', - 'atom/common/api/lib/id-weak-map.coffee', - 'atom/common/api/lib/native-image.coffee', - 'atom/common/api/lib/original-fs.coffee', - 'atom/common/api/lib/shell.coffee', - 'atom/common/lib/init.coffee', - 'atom/renderer/lib/chrome-api.coffee', - 'atom/renderer/lib/init.coffee', - 'atom/renderer/lib/inspector.coffee', - 'atom/renderer/lib/override.coffee', - 'atom/renderer/lib/web-view/guest-view-internal.coffee', - 'atom/renderer/lib/web-view/web-view.coffee', - 'atom/renderer/lib/web-view/web-view-attributes.coffee', - 'atom/renderer/lib/web-view/web-view-constants.coffee', - 'atom/renderer/api/lib/ipc.coffee', - 'atom/renderer/api/lib/remote.coffee', - 'atom/renderer/api/lib/screen.coffee', - 'atom/renderer/api/lib/web-frame.coffee', - ], - 'coffee2c_sources': [ - 'atom/common/lib/asar.coffee', - 'atom/common/lib/asar_init.coffee', - ], - 'lib_sources': [ - 'atom/app/atom_content_client.cc', - 'atom/app/atom_content_client.h', - 'atom/app/atom_main_args.cc', - 'atom/app/atom_main_args.h', - 'atom/app/atom_main_delegate.cc', - 'atom/app/atom_main_delegate.h', - 'atom/app/atom_main_delegate_mac.mm', - 'atom/app/node_main.cc', - 'atom/app/node_main.h', - 'atom/browser/api/atom_api_app.cc', - 'atom/browser/api/atom_api_app.h', - 'atom/browser/api/atom_api_auto_updater.cc', - 'atom/browser/api/atom_api_auto_updater.h', - 'atom/browser/api/atom_api_content_tracing.cc', - 'atom/browser/api/atom_api_dialog.cc', - 'atom/browser/api/atom_api_global_shortcut.cc', - 'atom/browser/api/atom_api_global_shortcut.h', - 'atom/browser/api/atom_api_menu.cc', - 'atom/browser/api/atom_api_menu.h', - 'atom/browser/api/atom_api_menu_views.cc', - 'atom/browser/api/atom_api_menu_views.h', - 'atom/browser/api/atom_api_menu_mac.h', - 'atom/browser/api/atom_api_menu_mac.mm', - 'atom/browser/api/atom_api_power_monitor.cc', - 'atom/browser/api/atom_api_power_monitor.h', - 'atom/browser/api/atom_api_protocol.cc', - 'atom/browser/api/atom_api_protocol.h', - 'atom/browser/api/atom_api_screen.cc', - 'atom/browser/api/atom_api_screen.h', - 'atom/browser/api/atom_api_tray.cc', - 'atom/browser/api/atom_api_tray.h', - 'atom/browser/api/atom_api_web_contents.cc', - 'atom/browser/api/atom_api_web_contents.h', - 'atom/browser/api/atom_api_web_view_manager.cc', - 'atom/browser/api/atom_api_window.cc', - 'atom/browser/api/atom_api_window.h', - 'atom/browser/api/event.cc', - 'atom/browser/api/event.h', - 'atom/browser/api/event_emitter.cc', - 'atom/browser/api/event_emitter.h', - 'atom/browser/auto_updater.cc', - 'atom/browser/auto_updater.h', - 'atom/browser/auto_updater_delegate.h', - 'atom/browser/auto_updater_linux.cc', - 'atom/browser/auto_updater_mac.mm', - 'atom/browser/auto_updater_win.cc', - 'atom/browser/atom_access_token_store.cc', - 'atom/browser/atom_access_token_store.h', - 'atom/browser/atom_browser_client.cc', - 'atom/browser/atom_browser_client.h', - 'atom/browser/atom_browser_context.cc', - 'atom/browser/atom_browser_context.h', - 'atom/browser/atom_browser_main_parts.cc', - 'atom/browser/atom_browser_main_parts.h', - 'atom/browser/atom_browser_main_parts_linux.cc', - 'atom/browser/atom_browser_main_parts_mac.mm', - 'atom/browser/atom_javascript_dialog_manager.cc', - 'atom/browser/atom_javascript_dialog_manager.h', - 'atom/browser/atom_resource_dispatcher_host_delegate.cc', - 'atom/browser/atom_resource_dispatcher_host_delegate.h', - 'atom/browser/atom_speech_recognition_manager_delegate.cc', - 'atom/browser/atom_speech_recognition_manager_delegate.h', - 'atom/browser/browser.cc', - 'atom/browser/browser.h', - 'atom/browser/browser_linux.cc', - 'atom/browser/browser_mac.mm', - 'atom/browser/browser_win.cc', - 'atom/browser/browser_observer.h', - 'atom/browser/javascript_environment.cc', - 'atom/browser/javascript_environment.h', - 'atom/browser/mac/atom_application.h', - 'atom/browser/mac/atom_application.mm', - 'atom/browser/mac/atom_application_delegate.h', - 'atom/browser/mac/atom_application_delegate.mm', - 'atom/browser/native_window.cc', - 'atom/browser/native_window.h', - 'atom/browser/native_window_views.cc', - 'atom/browser/native_window_views.h', - 'atom/browser/native_window_mac.h', - 'atom/browser/native_window_mac.mm', - 'atom/browser/native_window_observer.h', - 'atom/browser/net/adapter_request_job.cc', - 'atom/browser/net/adapter_request_job.h', - 'atom/browser/net/asar/asar_protocol_handler.cc', - 'atom/browser/net/asar/asar_protocol_handler.h', - 'atom/browser/net/asar/url_request_asar_job.cc', - 'atom/browser/net/asar/url_request_asar_job.h', - 'atom/browser/net/atom_url_request_job_factory.cc', - 'atom/browser/net/atom_url_request_job_factory.h', - 'atom/browser/net/url_request_string_job.cc', - 'atom/browser/net/url_request_string_job.h', - 'atom/browser/net/url_request_buffer_job.cc', - 'atom/browser/net/url_request_buffer_job.h', - 'atom/browser/node_debugger.cc', - 'atom/browser/node_debugger.h', - 'atom/browser/ui/accelerator_util.cc', - 'atom/browser/ui/accelerator_util.h', - 'atom/browser/ui/accelerator_util_mac.mm', - 'atom/browser/ui/accelerator_util_views.cc', - 'atom/browser/ui/cocoa/atom_menu_controller.h', - 'atom/browser/ui/cocoa/atom_menu_controller.mm', - 'atom/browser/ui/cocoa/event_processing_window.h', - 'atom/browser/ui/cocoa/event_processing_window.mm', - 'atom/browser/ui/file_dialog.h', - 'atom/browser/ui/file_dialog_gtk.cc', - 'atom/browser/ui/file_dialog_mac.mm', - 'atom/browser/ui/file_dialog_win.cc', - 'atom/browser/ui/message_box.h', - 'atom/browser/ui/message_box_mac.mm', - 'atom/browser/ui/message_box_views.cc', - 'atom/browser/ui/tray_icon.cc', - 'atom/browser/ui/tray_icon.h', - 'atom/browser/ui/tray_icon_gtk.cc', - 'atom/browser/ui/tray_icon_gtk.h', - 'atom/browser/ui/tray_icon_cocoa.h', - 'atom/browser/ui/tray_icon_cocoa.mm', - 'atom/browser/ui/tray_icon_observer.h', - 'atom/browser/ui/tray_icon_win.cc', - 'atom/browser/ui/views/frameless_view.cc', - 'atom/browser/ui/views/frameless_view.h', - 'atom/browser/ui/views/global_menu_bar_x11.cc', - 'atom/browser/ui/views/global_menu_bar_x11.h', - 'atom/browser/ui/views/menu_bar.cc', - 'atom/browser/ui/views/menu_bar.h', - 'atom/browser/ui/views/menu_delegate.cc', - 'atom/browser/ui/views/menu_delegate.h', - 'atom/browser/ui/views/menu_layout.cc', - 'atom/browser/ui/views/menu_layout.h', - 'atom/browser/ui/views/submenu_button.cc', - 'atom/browser/ui/views/submenu_button.h', - 'atom/browser/ui/views/win_frame_view.cc', - 'atom/browser/ui/views/win_frame_view.h', - 'atom/browser/ui/win/notify_icon_host.cc', - 'atom/browser/ui/win/notify_icon_host.h', - 'atom/browser/ui/win/notify_icon.cc', - 'atom/browser/ui/win/notify_icon.h', - 'atom/browser/ui/x/window_state_watcher.cc', - 'atom/browser/ui/x/window_state_watcher.h', - 'atom/browser/ui/x/x_window_utils.cc', - 'atom/browser/ui/x/x_window_utils.h', - 'atom/browser/web_view_manager.cc', - 'atom/browser/web_view_manager.h', - 'atom/browser/web_dialog_helper.cc', - 'atom/browser/web_dialog_helper.h', - 'atom/browser/window_list.cc', - 'atom/browser/window_list.h', - 'atom/browser/window_list_observer.h', - 'atom/common/api/api_messages.h', - 'atom/common/api/atom_api_asar.cc', - 'atom/common/api/atom_api_clipboard.cc', - 'atom/common/api/atom_api_crash_reporter.cc', - 'atom/common/api/atom_api_id_weak_map.cc', - 'atom/common/api/atom_api_id_weak_map.h', - 'atom/common/api/atom_api_native_image.cc', - 'atom/common/api/atom_api_native_image.h', - 'atom/common/api/atom_api_native_image_mac.mm', - 'atom/common/api/atom_api_shell.cc', - 'atom/common/api/atom_api_v8_util.cc', - 'atom/common/api/atom_bindings.cc', - 'atom/common/api/atom_bindings.h', - 'atom/common/api/object_life_monitor.cc', - 'atom/common/api/object_life_monitor.h', - 'atom/common/asar/archive.cc', - 'atom/common/asar/archive.h', - 'atom/common/asar/asar_util.cc', - 'atom/common/asar/asar_util.h', - 'atom/common/asar/scoped_temporary_file.cc', - 'atom/common/asar/scoped_temporary_file.h', - 'atom/common/common_message_generator.cc', - 'atom/common/common_message_generator.h', - 'atom/common/crash_reporter/crash_reporter.cc', - 'atom/common/crash_reporter/crash_reporter.h', - 'atom/common/crash_reporter/crash_reporter_linux.cc', - 'atom/common/crash_reporter/crash_reporter_linux.h', - 'atom/common/crash_reporter/crash_reporter_mac.h', - 'atom/common/crash_reporter/crash_reporter_mac.mm', - 'atom/common/crash_reporter/crash_reporter_win.cc', - 'atom/common/crash_reporter/crash_reporter_win.h', - 'atom/common/crash_reporter/linux/crash_dump_handler.cc', - 'atom/common/crash_reporter/linux/crash_dump_handler.h', - 'atom/common/crash_reporter/win/crash_service.cc', - 'atom/common/crash_reporter/win/crash_service.h', - 'atom/common/crash_reporter/win/crash_service_main.cc', - 'atom/common/crash_reporter/win/crash_service_main.h', - 'atom/common/draggable_region.cc', - 'atom/common/draggable_region.h', - 'atom/common/google_api_key.h', - 'atom/common/linux/application_info.cc', - 'atom/common/native_mate_converters/accelerator_converter.cc', - 'atom/common/native_mate_converters/accelerator_converter.h', - 'atom/common/native_mate_converters/file_path_converter.h', - 'atom/common/native_mate_converters/gfx_converter.cc', - 'atom/common/native_mate_converters/gfx_converter.h', - 'atom/common/native_mate_converters/gurl_converter.h', - 'atom/common/native_mate_converters/image_converter.cc', - 'atom/common/native_mate_converters/image_converter.h', - 'atom/common/native_mate_converters/string16_converter.h', - 'atom/common/native_mate_converters/v8_value_converter.cc', - 'atom/common/native_mate_converters/v8_value_converter.h', - 'atom/common/native_mate_converters/value_converter.cc', - 'atom/common/native_mate_converters/value_converter.h', - 'atom/common/node_bindings.cc', - 'atom/common/node_bindings.h', - 'atom/common/node_bindings_linux.cc', - 'atom/common/node_bindings_linux.h', - 'atom/common/node_bindings_mac.cc', - 'atom/common/node_bindings_mac.h', - 'atom/common/node_bindings_win.cc', - 'atom/common/node_bindings_win.h', - 'atom/common/node_includes.h', - 'atom/common/options_switches.cc', - 'atom/common/options_switches.h', - 'atom/common/platform_util.h', - 'atom/common/platform_util_linux.cc', - 'atom/common/platform_util_mac.mm', - 'atom/common/platform_util_win.cc', - 'atom/renderer/api/atom_api_renderer_ipc.cc', - 'atom/renderer/api/atom_api_spell_check_client.cc', - 'atom/renderer/api/atom_api_spell_check_client.h', - 'atom/renderer/api/atom_api_web_frame.cc', - 'atom/renderer/api/atom_api_web_frame.h', - 'atom/renderer/atom_render_view_observer.cc', - 'atom/renderer/atom_render_view_observer.h', - 'atom/renderer/atom_renderer_client.cc', - 'atom/renderer/atom_renderer_client.h', - 'atom/renderer/guest_view_container.cc', - 'atom/renderer/guest_view_container.h', - 'chromium_src/chrome/browser/browser_process.cc', - 'chromium_src/chrome/browser/browser_process.h', - 'chromium_src/chrome/browser/chrome_notification_types.h', - 'chromium_src/chrome/browser/extensions/global_shortcut_listener.cc', - 'chromium_src/chrome/browser/extensions/global_shortcut_listener.h', - 'chromium_src/chrome/browser/extensions/global_shortcut_listener_mac.mm', - 'chromium_src/chrome/browser/extensions/global_shortcut_listener_mac.h', - 'chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.cc', - 'chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.h', - 'chromium_src/chrome/browser/extensions/global_shortcut_listener_win.cc', - 'chromium_src/chrome/browser/extensions/global_shortcut_listener_win.h', - 'chromium_src/chrome/browser/printing/print_job.cc', - 'chromium_src/chrome/browser/printing/print_job.h', - 'chromium_src/chrome/browser/printing/print_job_manager.cc', - 'chromium_src/chrome/browser/printing/print_job_manager.h', - 'chromium_src/chrome/browser/printing/print_job_worker.cc', - 'chromium_src/chrome/browser/printing/print_job_worker.h', - 'chromium_src/chrome/browser/printing/print_job_worker_owner.cc', - 'chromium_src/chrome/browser/printing/print_job_worker_owner.h', - 'chromium_src/chrome/browser/printing/print_view_manager_base.cc', - 'chromium_src/chrome/browser/printing/print_view_manager_base.h', - 'chromium_src/chrome/browser/printing/print_view_manager_basic.cc', - 'chromium_src/chrome/browser/printing/print_view_manager_basic.h', - 'chromium_src/chrome/browser/printing/print_view_manager_observer.h', - 'chromium_src/chrome/browser/printing/printer_query.cc', - 'chromium_src/chrome/browser/printing/printer_query.h', - 'chromium_src/chrome/browser/printing/printing_message_filter.cc', - 'chromium_src/chrome/browser/printing/printing_message_filter.h', - 'chromium_src/chrome/browser/speech/tts_controller.h', - 'chromium_src/chrome/browser/speech/tts_controller_impl.cc', - 'chromium_src/chrome/browser/speech/tts_controller_impl.h', - 'chromium_src/chrome/browser/speech/tts_linux.cc', - 'chromium_src/chrome/browser/speech/tts_mac.mm', - 'chromium_src/chrome/browser/speech/tts_message_filter.cc', - 'chromium_src/chrome/browser/speech/tts_message_filter.h', - 'chromium_src/chrome/browser/speech/tts_platform.cc', - 'chromium_src/chrome/browser/speech/tts_platform.h', - 'chromium_src/chrome/browser/speech/tts_win.cc', - 'chromium_src/chrome/browser/ui/browser_dialogs.h', - 'chromium_src/chrome/browser/ui/cocoa/color_chooser_mac.mm', - 'chromium_src/chrome/browser/ui/views/color_chooser_aura.cc', - 'chromium_src/chrome/browser/ui/views/color_chooser_aura.h', - 'chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.cc', - 'chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.h', - 'chromium_src/chrome/common/print_messages.cc', - 'chromium_src/chrome/common/print_messages.h', - 'chromium_src/chrome/common/tts_messages.h', - 'chromium_src/chrome/common/tts_utterance_request.cc', - 'chromium_src/chrome/common/tts_utterance_request.h', - 'chromium_src/chrome/renderer/printing/print_web_view_helper.cc', - 'chromium_src/chrome/renderer/printing/print_web_view_helper_linux.cc', - 'chromium_src/chrome/renderer/printing/print_web_view_helper_mac.mm', - 'chromium_src/chrome/renderer/printing/print_web_view_helper_pdf_win.cc', - 'chromium_src/chrome/renderer/printing/print_web_view_helper.h', - 'chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.cc', - 'chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.h', - 'chromium_src/chrome/renderer/tts_dispatcher.cc', - 'chromium_src/chrome/renderer/tts_dispatcher.h', - 'chromium_src/library_loaders/libgio_loader.cc', - 'chromium_src/library_loaders/libgio.h', - 'chromium_src/library_loaders/libspeechd_loader.cc', - 'chromium_src/library_loaders/libspeechd.h', - '<@(native_mate_files)', - '<(SHARED_INTERMEDIATE_DIR)/atom_natives.h', - ], - 'lib_sources_win': [ - 'chromium_src/chrome/browser/ui/views/color_chooser_dialog.cc', - 'chromium_src/chrome/browser/ui/views/color_chooser_dialog.h', - 'chromium_src/chrome/browser/ui/views/color_chooser_win.cc', - ], - 'framework_sources': [ - 'atom/app/atom_library_main.h', - 'atom/app/atom_library_main.mm', - ], - 'locales': [ - 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', - 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he', - 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv', - 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru', - 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk', - 'vi', 'zh-CN', 'zh-TW', - ], + 'atom_source_root': '!@(<(apply_locales_cmd) -d ZZLOCALE.lproj <(locales))', ], diff --git a/filenames.gypi b/filenames.gypi new file mode 100644 index 00000000000..5866511faa7 --- /dev/null +++ b/filenames.gypi @@ -0,0 +1,379 @@ +{ + 'variables': { + 'app_sources': [ + 'atom/app/atom_main.cc', + 'atom/app/atom_main.h', + ], + 'bundle_sources': [ + 'atom/browser/resources/mac/atom.icns', + ], + 'coffee_sources': [ + 'atom/browser/api/lib/app.coffee', + 'atom/browser/api/lib/atom-delegate.coffee', + 'atom/browser/api/lib/auto-updater.coffee', + 'atom/browser/api/lib/browser-window.coffee', + 'atom/browser/api/lib/content-tracing.coffee', + 'atom/browser/api/lib/dialog.coffee', + 'atom/browser/api/lib/global-shortcut.coffee', + 'atom/browser/api/lib/ipc.coffee', + 'atom/browser/api/lib/menu.coffee', + 'atom/browser/api/lib/menu-item.coffee', + 'atom/browser/api/lib/power-monitor.coffee', + 'atom/browser/api/lib/protocol.coffee', + 'atom/browser/api/lib/screen.coffee', + 'atom/browser/api/lib/tray.coffee', + 'atom/browser/api/lib/web-contents.coffee', + 'atom/browser/lib/chrome-extension.coffee', + 'atom/browser/lib/guest-view-manager.coffee', + 'atom/browser/lib/guest-window-manager.coffee', + 'atom/browser/lib/init.coffee', + 'atom/browser/lib/objects-registry.coffee', + 'atom/browser/lib/rpc-server.coffee', + 'atom/common/api/lib/callbacks-registry.coffee', + 'atom/common/api/lib/clipboard.coffee', + 'atom/common/api/lib/crash-reporter.coffee', + 'atom/common/api/lib/id-weak-map.coffee', + 'atom/common/api/lib/native-image.coffee', + 'atom/common/api/lib/original-fs.coffee', + 'atom/common/api/lib/shell.coffee', + 'atom/common/lib/init.coffee', + 'atom/renderer/lib/chrome-api.coffee', + 'atom/renderer/lib/init.coffee', + 'atom/renderer/lib/inspector.coffee', + 'atom/renderer/lib/override.coffee', + 'atom/renderer/lib/web-view/guest-view-internal.coffee', + 'atom/renderer/lib/web-view/web-view.coffee', + 'atom/renderer/lib/web-view/web-view-attributes.coffee', + 'atom/renderer/lib/web-view/web-view-constants.coffee', + 'atom/renderer/api/lib/ipc.coffee', + 'atom/renderer/api/lib/remote.coffee', + 'atom/renderer/api/lib/screen.coffee', + 'atom/renderer/api/lib/web-frame.coffee', + ], + 'coffee2c_sources': [ + 'atom/common/lib/asar.coffee', + 'atom/common/lib/asar_init.coffee', + ], + 'lib_sources': [ + 'atom/app/atom_content_client.cc', + 'atom/app/atom_content_client.h', + 'atom/app/atom_main_args.cc', + 'atom/app/atom_main_args.h', + 'atom/app/atom_main_delegate.cc', + 'atom/app/atom_main_delegate.h', + 'atom/app/atom_main_delegate_mac.mm', + 'atom/app/node_main.cc', + 'atom/app/node_main.h', + 'atom/browser/api/atom_api_app.cc', + 'atom/browser/api/atom_api_app.h', + 'atom/browser/api/atom_api_auto_updater.cc', + 'atom/browser/api/atom_api_auto_updater.h', + 'atom/browser/api/atom_api_content_tracing.cc', + 'atom/browser/api/atom_api_dialog.cc', + 'atom/browser/api/atom_api_global_shortcut.cc', + 'atom/browser/api/atom_api_global_shortcut.h', + 'atom/browser/api/atom_api_menu.cc', + 'atom/browser/api/atom_api_menu.h', + 'atom/browser/api/atom_api_menu_views.cc', + 'atom/browser/api/atom_api_menu_views.h', + 'atom/browser/api/atom_api_menu_mac.h', + 'atom/browser/api/atom_api_menu_mac.mm', + 'atom/browser/api/atom_api_power_monitor.cc', + 'atom/browser/api/atom_api_power_monitor.h', + 'atom/browser/api/atom_api_protocol.cc', + 'atom/browser/api/atom_api_protocol.h', + 'atom/browser/api/atom_api_screen.cc', + 'atom/browser/api/atom_api_screen.h', + 'atom/browser/api/atom_api_tray.cc', + 'atom/browser/api/atom_api_tray.h', + 'atom/browser/api/atom_api_web_contents.cc', + 'atom/browser/api/atom_api_web_contents.h', + 'atom/browser/api/atom_api_web_view_manager.cc', + 'atom/browser/api/atom_api_window.cc', + 'atom/browser/api/atom_api_window.h', + 'atom/browser/api/event.cc', + 'atom/browser/api/event.h', + 'atom/browser/api/event_emitter.cc', + 'atom/browser/api/event_emitter.h', + 'atom/browser/auto_updater.cc', + 'atom/browser/auto_updater.h', + 'atom/browser/auto_updater_delegate.h', + 'atom/browser/auto_updater_linux.cc', + 'atom/browser/auto_updater_mac.mm', + 'atom/browser/auto_updater_win.cc', + 'atom/browser/atom_access_token_store.cc', + 'atom/browser/atom_access_token_store.h', + 'atom/browser/atom_browser_client.cc', + 'atom/browser/atom_browser_client.h', + 'atom/browser/atom_browser_context.cc', + 'atom/browser/atom_browser_context.h', + 'atom/browser/atom_browser_main_parts.cc', + 'atom/browser/atom_browser_main_parts.h', + 'atom/browser/atom_browser_main_parts_linux.cc', + 'atom/browser/atom_browser_main_parts_mac.mm', + 'atom/browser/atom_javascript_dialog_manager.cc', + 'atom/browser/atom_javascript_dialog_manager.h', + 'atom/browser/atom_resource_dispatcher_host_delegate.cc', + 'atom/browser/atom_resource_dispatcher_host_delegate.h', + 'atom/browser/atom_speech_recognition_manager_delegate.cc', + 'atom/browser/atom_speech_recognition_manager_delegate.h', + 'atom/browser/browser.cc', + 'atom/browser/browser.h', + 'atom/browser/browser_linux.cc', + 'atom/browser/browser_mac.mm', + 'atom/browser/browser_win.cc', + 'atom/browser/browser_observer.h', + 'atom/browser/javascript_environment.cc', + 'atom/browser/javascript_environment.h', + 'atom/browser/mac/atom_application.h', + 'atom/browser/mac/atom_application.mm', + 'atom/browser/mac/atom_application_delegate.h', + 'atom/browser/mac/atom_application_delegate.mm', + 'atom/browser/native_window.cc', + 'atom/browser/native_window.h', + 'atom/browser/native_window_views.cc', + 'atom/browser/native_window_views.h', + 'atom/browser/native_window_mac.h', + 'atom/browser/native_window_mac.mm', + 'atom/browser/native_window_observer.h', + 'atom/browser/net/adapter_request_job.cc', + 'atom/browser/net/adapter_request_job.h', + 'atom/browser/net/asar/asar_protocol_handler.cc', + 'atom/browser/net/asar/asar_protocol_handler.h', + 'atom/browser/net/asar/url_request_asar_job.cc', + 'atom/browser/net/asar/url_request_asar_job.h', + 'atom/browser/net/atom_url_request_job_factory.cc', + 'atom/browser/net/atom_url_request_job_factory.h', + 'atom/browser/net/url_request_string_job.cc', + 'atom/browser/net/url_request_string_job.h', + 'atom/browser/net/url_request_buffer_job.cc', + 'atom/browser/net/url_request_buffer_job.h', + 'atom/browser/node_debugger.cc', + 'atom/browser/node_debugger.h', + 'atom/browser/ui/accelerator_util.cc', + 'atom/browser/ui/accelerator_util.h', + 'atom/browser/ui/accelerator_util_mac.mm', + 'atom/browser/ui/accelerator_util_views.cc', + 'atom/browser/ui/cocoa/atom_menu_controller.h', + 'atom/browser/ui/cocoa/atom_menu_controller.mm', + 'atom/browser/ui/cocoa/event_processing_window.h', + 'atom/browser/ui/cocoa/event_processing_window.mm', + 'atom/browser/ui/file_dialog.h', + 'atom/browser/ui/file_dialog_gtk.cc', + 'atom/browser/ui/file_dialog_mac.mm', + 'atom/browser/ui/file_dialog_win.cc', + 'atom/browser/ui/message_box.h', + 'atom/browser/ui/message_box_mac.mm', + 'atom/browser/ui/message_box_views.cc', + 'atom/browser/ui/tray_icon.cc', + 'atom/browser/ui/tray_icon.h', + 'atom/browser/ui/tray_icon_gtk.cc', + 'atom/browser/ui/tray_icon_gtk.h', + 'atom/browser/ui/tray_icon_cocoa.h', + 'atom/browser/ui/tray_icon_cocoa.mm', + 'atom/browser/ui/tray_icon_observer.h', + 'atom/browser/ui/tray_icon_win.cc', + 'atom/browser/ui/views/frameless_view.cc', + 'atom/browser/ui/views/frameless_view.h', + 'atom/browser/ui/views/global_menu_bar_x11.cc', + 'atom/browser/ui/views/global_menu_bar_x11.h', + 'atom/browser/ui/views/menu_bar.cc', + 'atom/browser/ui/views/menu_bar.h', + 'atom/browser/ui/views/menu_delegate.cc', + 'atom/browser/ui/views/menu_delegate.h', + 'atom/browser/ui/views/menu_layout.cc', + 'atom/browser/ui/views/menu_layout.h', + 'atom/browser/ui/views/submenu_button.cc', + 'atom/browser/ui/views/submenu_button.h', + 'atom/browser/ui/views/win_frame_view.cc', + 'atom/browser/ui/views/win_frame_view.h', + 'atom/browser/ui/win/notify_icon_host.cc', + 'atom/browser/ui/win/notify_icon_host.h', + 'atom/browser/ui/win/notify_icon.cc', + 'atom/browser/ui/win/notify_icon.h', + 'atom/browser/ui/x/window_state_watcher.cc', + 'atom/browser/ui/x/window_state_watcher.h', + 'atom/browser/ui/x/x_window_utils.cc', + 'atom/browser/ui/x/x_window_utils.h', + 'atom/browser/web_view_manager.cc', + 'atom/browser/web_view_manager.h', + 'atom/browser/web_dialog_helper.cc', + 'atom/browser/web_dialog_helper.h', + 'atom/browser/window_list.cc', + 'atom/browser/window_list.h', + 'atom/browser/window_list_observer.h', + 'atom/common/api/api_messages.h', + 'atom/common/api/atom_api_asar.cc', + 'atom/common/api/atom_api_clipboard.cc', + 'atom/common/api/atom_api_crash_reporter.cc', + 'atom/common/api/atom_api_id_weak_map.cc', + 'atom/common/api/atom_api_id_weak_map.h', + 'atom/common/api/atom_api_native_image.cc', + 'atom/common/api/atom_api_native_image.h', + 'atom/common/api/atom_api_native_image_mac.mm', + 'atom/common/api/atom_api_shell.cc', + 'atom/common/api/atom_api_v8_util.cc', + 'atom/common/api/atom_bindings.cc', + 'atom/common/api/atom_bindings.h', + 'atom/common/api/object_life_monitor.cc', + 'atom/common/api/object_life_monitor.h', + 'atom/common/asar/archive.cc', + 'atom/common/asar/archive.h', + 'atom/common/asar/asar_util.cc', + 'atom/common/asar/asar_util.h', + 'atom/common/asar/scoped_temporary_file.cc', + 'atom/common/asar/scoped_temporary_file.h', + 'atom/common/common_message_generator.cc', + 'atom/common/common_message_generator.h', + 'atom/common/crash_reporter/crash_reporter.cc', + 'atom/common/crash_reporter/crash_reporter.h', + 'atom/common/crash_reporter/crash_reporter_linux.cc', + 'atom/common/crash_reporter/crash_reporter_linux.h', + 'atom/common/crash_reporter/crash_reporter_mac.h', + 'atom/common/crash_reporter/crash_reporter_mac.mm', + 'atom/common/crash_reporter/crash_reporter_win.cc', + 'atom/common/crash_reporter/crash_reporter_win.h', + 'atom/common/crash_reporter/linux/crash_dump_handler.cc', + 'atom/common/crash_reporter/linux/crash_dump_handler.h', + 'atom/common/crash_reporter/win/crash_service.cc', + 'atom/common/crash_reporter/win/crash_service.h', + 'atom/common/crash_reporter/win/crash_service_main.cc', + 'atom/common/crash_reporter/win/crash_service_main.h', + 'atom/common/draggable_region.cc', + 'atom/common/draggable_region.h', + 'atom/common/google_api_key.h', + 'atom/common/linux/application_info.cc', + 'atom/common/native_mate_converters/accelerator_converter.cc', + 'atom/common/native_mate_converters/accelerator_converter.h', + 'atom/common/native_mate_converters/file_path_converter.h', + 'atom/common/native_mate_converters/gfx_converter.cc', + 'atom/common/native_mate_converters/gfx_converter.h', + 'atom/common/native_mate_converters/gurl_converter.h', + 'atom/common/native_mate_converters/image_converter.cc', + 'atom/common/native_mate_converters/image_converter.h', + 'atom/common/native_mate_converters/string16_converter.h', + 'atom/common/native_mate_converters/v8_value_converter.cc', + 'atom/common/native_mate_converters/v8_value_converter.h', + 'atom/common/native_mate_converters/value_converter.cc', + 'atom/common/native_mate_converters/value_converter.h', + 'atom/common/node_bindings.cc', + 'atom/common/node_bindings.h', + 'atom/common/node_bindings_linux.cc', + 'atom/common/node_bindings_linux.h', + 'atom/common/node_bindings_mac.cc', + 'atom/common/node_bindings_mac.h', + 'atom/common/node_bindings_win.cc', + 'atom/common/node_bindings_win.h', + 'atom/common/node_includes.h', + 'atom/common/options_switches.cc', + 'atom/common/options_switches.h', + 'atom/common/platform_util.h', + 'atom/common/platform_util_linux.cc', + 'atom/common/platform_util_mac.mm', + 'atom/common/platform_util_win.cc', + 'atom/renderer/api/atom_api_renderer_ipc.cc', + 'atom/renderer/api/atom_api_spell_check_client.cc', + 'atom/renderer/api/atom_api_spell_check_client.h', + 'atom/renderer/api/atom_api_web_frame.cc', + 'atom/renderer/api/atom_api_web_frame.h', + 'atom/renderer/atom_render_view_observer.cc', + 'atom/renderer/atom_render_view_observer.h', + 'atom/renderer/atom_renderer_client.cc', + 'atom/renderer/atom_renderer_client.h', + 'atom/renderer/guest_view_container.cc', + 'atom/renderer/guest_view_container.h', + 'chromium_src/chrome/browser/browser_process.cc', + 'chromium_src/chrome/browser/browser_process.h', + 'chromium_src/chrome/browser/chrome_notification_types.h', + 'chromium_src/chrome/browser/extensions/global_shortcut_listener.cc', + 'chromium_src/chrome/browser/extensions/global_shortcut_listener.h', + 'chromium_src/chrome/browser/extensions/global_shortcut_listener_mac.mm', + 'chromium_src/chrome/browser/extensions/global_shortcut_listener_mac.h', + 'chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.cc', + 'chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.h', + 'chromium_src/chrome/browser/extensions/global_shortcut_listener_win.cc', + 'chromium_src/chrome/browser/extensions/global_shortcut_listener_win.h', + 'chromium_src/chrome/browser/printing/print_job.cc', + 'chromium_src/chrome/browser/printing/print_job.h', + 'chromium_src/chrome/browser/printing/print_job_manager.cc', + 'chromium_src/chrome/browser/printing/print_job_manager.h', + 'chromium_src/chrome/browser/printing/print_job_worker.cc', + 'chromium_src/chrome/browser/printing/print_job_worker.h', + 'chromium_src/chrome/browser/printing/print_job_worker_owner.cc', + 'chromium_src/chrome/browser/printing/print_job_worker_owner.h', + 'chromium_src/chrome/browser/printing/print_view_manager_base.cc', + 'chromium_src/chrome/browser/printing/print_view_manager_base.h', + 'chromium_src/chrome/browser/printing/print_view_manager_basic.cc', + 'chromium_src/chrome/browser/printing/print_view_manager_basic.h', + 'chromium_src/chrome/browser/printing/print_view_manager_observer.h', + 'chromium_src/chrome/browser/printing/printer_query.cc', + 'chromium_src/chrome/browser/printing/printer_query.h', + 'chromium_src/chrome/browser/printing/printing_message_filter.cc', + 'chromium_src/chrome/browser/printing/printing_message_filter.h', + 'chromium_src/chrome/browser/speech/tts_controller.h', + 'chromium_src/chrome/browser/speech/tts_controller_impl.cc', + 'chromium_src/chrome/browser/speech/tts_controller_impl.h', + 'chromium_src/chrome/browser/speech/tts_linux.cc', + 'chromium_src/chrome/browser/speech/tts_mac.mm', + 'chromium_src/chrome/browser/speech/tts_message_filter.cc', + 'chromium_src/chrome/browser/speech/tts_message_filter.h', + 'chromium_src/chrome/browser/speech/tts_platform.cc', + 'chromium_src/chrome/browser/speech/tts_platform.h', + 'chromium_src/chrome/browser/speech/tts_win.cc', + 'chromium_src/chrome/browser/ui/browser_dialogs.h', + 'chromium_src/chrome/browser/ui/cocoa/color_chooser_mac.mm', + 'chromium_src/chrome/browser/ui/views/color_chooser_aura.cc', + 'chromium_src/chrome/browser/ui/views/color_chooser_aura.h', + 'chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.cc', + 'chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.h', + 'chromium_src/chrome/common/print_messages.cc', + 'chromium_src/chrome/common/print_messages.h', + 'chromium_src/chrome/common/tts_messages.h', + 'chromium_src/chrome/common/tts_utterance_request.cc', + 'chromium_src/chrome/common/tts_utterance_request.h', + 'chromium_src/chrome/renderer/printing/print_web_view_helper.cc', + 'chromium_src/chrome/renderer/printing/print_web_view_helper_linux.cc', + 'chromium_src/chrome/renderer/printing/print_web_view_helper_mac.mm', + 'chromium_src/chrome/renderer/printing/print_web_view_helper_pdf_win.cc', + 'chromium_src/chrome/renderer/printing/print_web_view_helper.h', + 'chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.cc', + 'chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.h', + 'chromium_src/chrome/renderer/tts_dispatcher.cc', + 'chromium_src/chrome/renderer/tts_dispatcher.h', + 'chromium_src/library_loaders/libgio_loader.cc', + 'chromium_src/library_loaders/libgio.h', + 'chromium_src/library_loaders/libspeechd_loader.cc', + 'chromium_src/library_loaders/libspeechd.h', + '<@(native_mate_files)', + '<(SHARED_INTERMEDIATE_DIR)/atom_natives.h', + ], + 'lib_sources_win': [ + 'chromium_src/chrome/browser/ui/views/color_chooser_dialog.cc', + 'chromium_src/chrome/browser/ui/views/color_chooser_dialog.h', + 'chromium_src/chrome/browser/ui/views/color_chooser_win.cc', + ], + 'framework_sources': [ + 'atom/app/atom_library_main.h', + 'atom/app/atom_library_main.mm', + ], + 'locales': [ + 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', + 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he', + 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv', + 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru', + 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk', + 'vi', 'zh-CN', 'zh-TW', + ], + 'atom_source_root': ' Date: Sun, 5 Apr 2015 22:28:51 +0800 Subject: [PATCH 10/89] Download static_library build of libchromiumcontent --- vendor/brightray | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/brightray b/vendor/brightray index f89e3f633ec..5c1141338e1 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit f89e3f633ec0c9ead422d0a39f7f42e693544d08 +Subproject commit 5c1141338e1a6abee87583f708e61236ac2a9c35 From e64101e31fadaf54f8c1d7a6acb9b302060efefc Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 5 Apr 2015 22:30:03 +0800 Subject: [PATCH 11/89] Upgrade libchromiumcontent to use the static_library build --- 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 b39b22eee29..48ed65ce9eb 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -4,7 +4,7 @@ import platform import sys BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent' -LIBCHROMIUMCONTENT_COMMIT = 'c01b10faf0d478e48f537210ec263fabd551578d' +LIBCHROMIUMCONTENT_COMMIT = 'e0213676879061470efe50720368bce9b99aaa12' ARCH = { 'cygwin': '32bit', From 938069a389ea5f5cdb7ffc12418fc27b10d4a611 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 6 Apr 2015 14:21:21 +0800 Subject: [PATCH 12/89] win: Fix linking --- atom.gyp | 12 +++++++++--- atom/common/node_bindings.cc | 26 ++++++++++++++++++++++++++ atom/common/node_includes.h | 2 -- common.gypi | 4 +--- vendor/brightray | 2 +- 5 files changed, 37 insertions(+), 9 deletions(-) diff --git a/atom.gyp b/atom.gyp index 3c6728175bc..3e152660a67 100644 --- a/atom.gyp +++ b/atom.gyp @@ -124,7 +124,6 @@ { 'destination': '<(PRODUCT_DIR)', 'files': [ - '<(libchromiumcontent_dir)/chromiumcontent.dll', '<(libchromiumcontent_dir)/ffmpegsumo.dll', '<(libchromiumcontent_dir)/libEGL.dll', '<(libchromiumcontent_dir)/libGLESv2.dll', @@ -232,6 +231,14 @@ ], }, 'dependencies': [ + # Node is built as static_library on Windows, so we also need to + # include its dependencies here. + 'vendor/node/deps/cares/cares.gyp:cares', + 'vendor/node/deps/http_parser/http_parser.gyp:http_parser', + 'vendor/node/deps/openssl/openssl.gyp:openssl', + 'vendor/node/deps/uv/uv.gyp:libuv', + 'vendor/node/deps/zlib/zlib.gyp:zlib', + # Build with breakpad support. 'vendor/breakpad/breakpad.gyp:breakpad_handler', 'vendor/breakpad/breakpad.gyp:breakpad_sender', ], @@ -621,8 +628,7 @@ { 'action_name': 'Create node.lib', 'inputs': [ - '<(PRODUCT_DIR)/node.dll.lib', - '<(libchromiumcontent_dir)/chromiumcontent.dll.lib', + '<(PRODUCT_DIR)/<(project_name).lib', ], 'outputs': [ '<(PRODUCT_DIR)/node.lib', diff --git a/atom/common/node_bindings.cc b/atom/common/node_bindings.cc index 1ff9c1685c4..05cdbe3c2ec 100644 --- a/atom/common/node_bindings.cc +++ b/atom/common/node_bindings.cc @@ -27,6 +27,32 @@ using content::BrowserThread; #define REFERENCE_MODULE(name) \ extern "C" void _register_ ## name(void); \ void (*fp_register_ ## name)(void) = _register_ ## name +#if defined(OS_WIN) +// On Windows Node is built as static_library so we need to reference Node's +// builtin modules. +REFERENCE_MODULE(cares_wrap); +REFERENCE_MODULE(fs_event_wrap); +REFERENCE_MODULE(buffer); +REFERENCE_MODULE(contextify); +REFERENCE_MODULE(crypto); +REFERENCE_MODULE(fs); +REFERENCE_MODULE(http_parser); +REFERENCE_MODULE(os); +REFERENCE_MODULE(v8); +REFERENCE_MODULE(zlib); +REFERENCE_MODULE(pipe_wrap); +REFERENCE_MODULE(process_wrap); +REFERENCE_MODULE(signal_wrap); +REFERENCE_MODULE(smalloc); +REFERENCE_MODULE(spawn_sync); +REFERENCE_MODULE(tcp_wrap); +REFERENCE_MODULE(timer_wrap); +REFERENCE_MODULE(tls_wrap); +REFERENCE_MODULE(tty_wrap); +REFERENCE_MODULE(udp_wrap); +REFERENCE_MODULE(uv); +REFERENCE_MODULE(js_stream); +#endif // defined(OS_WIN) // Atom Shell's builtin modules. REFERENCE_MODULE(atom_browser_app); REFERENCE_MODULE(atom_browser_auto_updater); diff --git a/atom/common/node_includes.h b/atom/common/node_includes.h index 0c4189b2fac..80567cbd49b 100644 --- a/atom/common/node_includes.h +++ b/atom/common/node_includes.h @@ -7,8 +7,6 @@ // Include common headers for using node APIs. -#define BUILDING_NODE_EXTENSION - #undef ASSERT #undef CHECK #undef CHECK_EQ diff --git a/common.gypi b/common.gypi index 7e57301316d..c63bcd84ade 100644 --- a/common.gypi +++ b/common.gypi @@ -115,9 +115,7 @@ }, }], ['OS=="win"', { - 'libraries': [ - '<(libchromiumcontent_root_dir)/shared_library/v8.dll.lib', - ], + 'type': 'static_library', }], ['OS=="linux"', { 'cflags': [ '-fPIC' ], diff --git a/vendor/brightray b/vendor/brightray index 5c1141338e1..cd70f45a19d 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 5c1141338e1a6abee87583f708e61236ac2a9c35 +Subproject commit cd70f45a19dcb73b15d9e9567ee082330a168a85 From 0dffa0f4bb166b5bb854722d9b60b580bbd1b10c Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 6 Apr 2015 14:26:06 +0800 Subject: [PATCH 13/89] win: Copy necessary shared libraries --- atom.gyp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/atom.gyp b/atom.gyp index 3e152660a67..73c13b5dcb4 100644 --- a/atom.gyp +++ b/atom.gyp @@ -122,8 +122,18 @@ ['OS=="win"', { 'copies': [ { + 'variables': { + 'conditions': [ + ['libchromiumcontent_component', { + 'copied_libraries': '<(libchromiumcontent_shared_libraries)', + }, { + 'copied_libraries': [], + }], + ], + }, 'destination': '<(PRODUCT_DIR)', 'files': [ + '<@(copied_libraries)', '<(libchromiumcontent_dir)/ffmpegsumo.dll', '<(libchromiumcontent_dir)/libEGL.dll', '<(libchromiumcontent_dir)/libGLESv2.dll', From e334e6e82297ec1b81039e5511361ac88f0257bb Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 6 Apr 2015 16:28:52 +0800 Subject: [PATCH 14/89] win: Upgrade brightray for linking problem --- vendor/brightray | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/brightray b/vendor/brightray index cd70f45a19d..a09b6c78b76 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit cd70f45a19dcb73b15d9e9567ee082330a168a85 +Subproject commit a09b6c78b76fbbc019a9be72a0c5f2403f5c0763 From f169772031f84447461380e734512a566376d66f Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 7 Apr 2015 12:21:16 +0800 Subject: [PATCH 15/89] Link boringssl and node together in one binary --- atom.gyp | 25 +++---------------------- atom/common/node_bindings.cc | 5 +---- common.gypi | 9 +++------ script/bootstrap.py | 2 +- script/lib/config.py | 2 +- vendor/brightray | 2 +- vendor/node | 2 +- 7 files changed, 11 insertions(+), 36 deletions(-) diff --git a/atom.gyp b/atom.gyp index 73c13b5dcb4..61f49114848 100644 --- a/atom.gyp +++ b/atom.gyp @@ -197,6 +197,8 @@ # Defined in Chromium but not exposed in its gyp file. 'V8_USE_EXTERNAL_STARTUP_DATA', 'ENABLE_PLUGINS', + # Needed by Node. + 'NODE_WANT_INTERNALS=1', ], 'sources': [ '<@(lib_sources)', @@ -527,7 +529,7 @@ ['libchromiumcontent_component', { 'copied_libraries': '<(libchromiumcontent_shared_libraries)', }, { - 'copied_libraries': ['<(libchromiumcontent_dir)/libboringssl.dylib'], + 'copied_libraries': [], }], ], }, @@ -535,7 +537,6 @@ 'files': [ '<@(copied_libraries)', '<(libchromiumcontent_dir)/ffmpegsumo.so', - '<(PRODUCT_DIR)/libnode.dylib', ], }, { @@ -547,26 +548,6 @@ }, ], 'postbuilds': [ - { - 'postbuild_name': 'Fix path of libnode', - 'action': [ - 'install_name_tool', - '-change', - '/usr/local/lib/libnode.dylib', - '@rpath/libnode.dylib', - '${BUILT_PRODUCTS_DIR}/<(product_name) Framework.framework/Versions/A/<(product_name) Framework', - ], - }, - { - 'postbuild_name': 'Fix path of libboringssl', - 'action': [ - 'install_name_tool', - '-change', - '/usr/local/lib/libboringssl.dylib', - '@rpath/libboringssl.dylib', - '${BUILT_PRODUCTS_DIR}/<(product_name) Framework.framework/Versions/A/<(product_name) Framework', - ], - }, { 'postbuild_name': 'Add symlinks for framework subdirectories', 'action': [ diff --git a/atom/common/node_bindings.cc b/atom/common/node_bindings.cc index 05cdbe3c2ec..a021e92b857 100644 --- a/atom/common/node_bindings.cc +++ b/atom/common/node_bindings.cc @@ -27,9 +27,7 @@ using content::BrowserThread; #define REFERENCE_MODULE(name) \ extern "C" void _register_ ## name(void); \ void (*fp_register_ ## name)(void) = _register_ ## name -#if defined(OS_WIN) -// On Windows Node is built as static_library so we need to reference Node's -// builtin modules. +// Node's builtin modules. REFERENCE_MODULE(cares_wrap); REFERENCE_MODULE(fs_event_wrap); REFERENCE_MODULE(buffer); @@ -52,7 +50,6 @@ REFERENCE_MODULE(tty_wrap); REFERENCE_MODULE(udp_wrap); REFERENCE_MODULE(uv); REFERENCE_MODULE(js_stream); -#endif // defined(OS_WIN) // Atom Shell's builtin modules. REFERENCE_MODULE(atom_browser_app); REFERENCE_MODULE(atom_browser_auto_updater); diff --git a/common.gypi b/common.gypi index c63bcd84ade..2ca01a1e8b1 100644 --- a/common.gypi +++ b/common.gypi @@ -4,7 +4,6 @@ ], 'variables': { 'clang': 0, - 'openssl_no_asm': 1, 'conditions': [ ['OS=="mac" or OS=="linux"', { 'clang': 1, @@ -20,7 +19,7 @@ 'node_shared_cares': 'false', 'node_shared_http_parser': 'false', 'node_shared_libuv': 'false', - 'node_shared_openssl': 'false', + 'node_shared_openssl': 'true', 'node_shared_v8': 'true', 'node_shared_zlib': 'false', 'node_tag': '', @@ -40,7 +39,7 @@ # Settings to compile node under Windows. 'target_defaults': { 'target_conditions': [ - ['_target_name in ["libuv", "http_parser", "cares", "openssl", "openssl-cli", "node", "zlib"]', { + ['_target_name in ["libuv", "http_parser", "cares", "node", "zlib"]', { 'msvs_disabled_warnings': [ 4703, # potentially uninitialized local pointer variable 'req' used 4013, # 'free' undefined; assuming extern returning int @@ -104,6 +103,7 @@ ['_target_name in ["node", "atom_lib"]', { 'include_dirs': [ '<(libchromiumcontent_src_dir)/v8/include', + '<(libchromiumcontent_src_dir)/third_party/boringssl/src/include', ], }], ['_target_name=="node"', { @@ -114,9 +114,6 @@ 'DYLIB_INSTALL_NAME_BASE': '@rpath' }, }], - ['OS=="win"', { - 'type': 'static_library', - }], ['OS=="linux"', { 'cflags': [ '-fPIC' ], }], diff --git a/script/bootstrap.py b/script/bootstrap.py index fadc7a20bda..f3b2185ccf7 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -26,7 +26,7 @@ def main(): enable_verbose_mode() if sys.platform == 'cygwin': update_win32_python() - update_submodules() + # update_submodules() update_node_modules('.') bootstrap_brightray(args.url) diff --git a/script/lib/config.py b/script/lib/config.py index 48ed65ce9eb..e98e5b1c8eb 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -4,7 +4,7 @@ import platform import sys BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent' -LIBCHROMIUMCONTENT_COMMIT = 'e0213676879061470efe50720368bce9b99aaa12' +LIBCHROMIUMCONTENT_COMMIT = '2b564074393dcd3dd90e0edfc5a75099c2a72d1d' ARCH = { 'cygwin': '32bit', diff --git a/vendor/brightray b/vendor/brightray index a09b6c78b76..d4c8ac2565a 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit a09b6c78b76fbbc019a9be72a0c5f2403f5c0763 +Subproject commit d4c8ac2565a2e257c37215d9b65d6dd0267aad1b diff --git a/vendor/node b/vendor/node index 790c4a3af36..6a8c1dda355 160000 --- a/vendor/node +++ b/vendor/node @@ -1 +1 @@ -Subproject commit 790c4a3af36144fcdd5fe39d0cb6cd622f282434 +Subproject commit 6a8c1dda355e67303441afb4bb812b8428362f23 From 2f5090d667e1a759e04a9e52477bf75453c47046 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 7 Apr 2015 12:36:16 +0800 Subject: [PATCH 16/89] Fix minor typo --- script/bootstrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/bootstrap.py b/script/bootstrap.py index f3b2185ccf7..fadc7a20bda 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -26,7 +26,7 @@ def main(): enable_verbose_mode() if sys.platform == 'cygwin': update_win32_python() - # update_submodules() + update_submodules() update_node_modules('.') bootstrap_brightray(args.url) From 0f97bf03fa515a0c19b37ebfaf5468760767b9d1 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 7 Apr 2015 13:50:58 +0800 Subject: [PATCH 17/89] win: Fix Debug build --- atom.gyp | 1 - common.gypi | 7 +++++++ vendor/brightray | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/atom.gyp b/atom.gyp index 61f49114848..9c767ca3270 100644 --- a/atom.gyp +++ b/atom.gyp @@ -247,7 +247,6 @@ # include its dependencies here. 'vendor/node/deps/cares/cares.gyp:cares', 'vendor/node/deps/http_parser/http_parser.gyp:http_parser', - 'vendor/node/deps/openssl/openssl.gyp:openssl', 'vendor/node/deps/uv/uv.gyp:libuv', 'vendor/node/deps/zlib/zlib.gyp:zlib', # Build with breakpad support. diff --git a/common.gypi b/common.gypi index 2ca01a1e8b1..afed8fe2977 100644 --- a/common.gypi +++ b/common.gypi @@ -43,6 +43,7 @@ 'msvs_disabled_warnings': [ 4703, # potentially uninitialized local pointer variable 'req' used 4013, # 'free' undefined; assuming extern returning int + 4018, # signed/unsigned mismatch 4054, # 4057, # 'function' : 'volatile LONG *' differs in indirection to slightly different base types from 'unsigned long *' 4189, # @@ -146,6 +147,12 @@ '-Wno-empty-body', ], }], # OS=="linux" + ['OS=="win"', { + 'msvs_disabled_warnings': [ + # unreferenced local function has been removed. + 4505, + ], + }], # OS=="win" ], }], ['_type in ["executable", "shared_library"]', { diff --git a/vendor/brightray b/vendor/brightray index d4c8ac2565a..71a4624adf2 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit d4c8ac2565a2e257c37215d9b65d6dd0267aad1b +Subproject commit 71a4624adf2e95ee57138d6f5f1b5c469c20c4b4 From 2351c11da4a2ccf1f1ef19f759bf577db3bddc9d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 7 Apr 2015 13:51:40 +0800 Subject: [PATCH 18/89] No more need to ship vc runtime The release version now static links with vc runtime --- script/create-dist.py | 3 --- script/update-external-binaries.py | 1 - 2 files changed, 4 deletions(-) diff --git a/script/create-dist.py b/script/create-dist.py index 9972e5738c8..0b3152b8cbb 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -38,11 +38,8 @@ TARGET_BINARIES = { 'icudtl.dat', 'libEGL.dll', 'libGLESv2.dll', - 'msvcp120.dll', - 'msvcr120.dll', 'content_resources_200_percent.pak', 'ui_resources_200_percent.pak', - 'vccorlib120.dll', 'xinput1_3.dll', 'natives_blob.bin', 'snapshot_blob.bin', diff --git a/script/update-external-binaries.py b/script/update-external-binaries.py index ad4dc55fcd9..c497923e491 100755 --- a/script/update-external-binaries.py +++ b/script/update-external-binaries.py @@ -29,7 +29,6 @@ def main(): download_and_unzip('Squirrel') elif sys.platform in ['cygwin', 'win32']: download_and_unzip('directxsdk') - download_and_unzip('vs2012_crt') with open(version_file, 'w') as f: f.write(VERSION) From 0890ea716fcd7e3a38e62a69dd9b651d17b447e8 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 7 Apr 2015 14:03:16 +0800 Subject: [PATCH 19/89] win: Fix a compiler warning in Node --- common.gypi | 1 + 1 file changed, 1 insertion(+) diff --git a/common.gypi b/common.gypi index afed8fe2977..ee239488081 100644 --- a/common.gypi +++ b/common.gypi @@ -53,6 +53,7 @@ 4152, # function/data pointer conversion in expression 4206, # translation unit is empty 4204, # non-constant aggregate initializer + 4210, # nonstandard extension used : function given file scope 4214, # bit field types other than int 4232, # address of dllimport 'free' is not static, identity not guaranteed 4291, # no matching operator delete found From 21014614fc220b77e9d0509b82231f212473d4ff Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 7 Apr 2015 17:26:21 +0800 Subject: [PATCH 20/89] Link boringssl as shared_library --- atom.gyp | 25 +++++++++++++++++++++++-- common.gypi | 6 ++++-- vendor/brightray | 2 +- vendor/node | 2 +- 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/atom.gyp b/atom.gyp index 9c767ca3270..31ac253b0ff 100644 --- a/atom.gyp +++ b/atom.gyp @@ -127,7 +127,7 @@ ['libchromiumcontent_component', { 'copied_libraries': '<(libchromiumcontent_shared_libraries)', }, { - 'copied_libraries': [], + 'copied_libraries': ['<(libchromiumcontent_dir)/boringssl.dll'], }], ], }, @@ -161,8 +161,18 @@ ['OS=="linux"', { 'copies': [ { + 'variables': { + 'conditions': [ + ['libchromiumcontent_component', { + 'copied_libraries': '<(libchromiumcontent_shared_libraries)', + }, { + 'copied_libraries': ['<(libchromiumcontent_dir)/libboringssl.so'], + }], + ], + }, 'destination': '<(PRODUCT_DIR)', 'files': [ + '<@(copied_libraries)', '<(libchromiumcontent_dir)/libffmpegsumo.so', '<(libchromiumcontent_dir)/icudtl.dat', '<(libchromiumcontent_dir)/content_shell.pak', @@ -187,6 +197,7 @@ 'atom_coffee2c', 'vendor/brightray/brightray.gyp:brightray', 'vendor/node/node.gyp:node', + 'vendor/node/deps/openssl/openssl.gyp:openssl', ], 'defines': [ 'PRODUCT_NAME="<(product_name)"', @@ -528,7 +539,7 @@ ['libchromiumcontent_component', { 'copied_libraries': '<(libchromiumcontent_shared_libraries)', }, { - 'copied_libraries': [], + 'copied_libraries': ['<(libchromiumcontent_dir)/libboringssl.dylib'], }], ], }, @@ -547,6 +558,16 @@ }, ], 'postbuilds': [ + { + 'postbuild_name': 'Fix path of libboringssl', + 'action': [ + 'install_name_tool', + '-change', + '/usr/local/lib/libboringssl.dylib', + '@rpath/libboringssl.dylib', + '${BUILT_PRODUCTS_DIR}/<(product_name) Framework.framework/Versions/A/<(product_name) Framework', + ], + }, { 'postbuild_name': 'Add symlinks for framework subdirectories', 'action': [ diff --git a/common.gypi b/common.gypi index ee239488081..c737efd8be6 100644 --- a/common.gypi +++ b/common.gypi @@ -14,6 +14,7 @@ # Reflects node's config.gypi. 'component%': 'static_library', 'python': 'python', + 'openssl_no_asm': 1, 'node_install_npm': 'false', 'node_prefix': '', 'node_shared_cares': 'false', @@ -39,7 +40,7 @@ # Settings to compile node under Windows. 'target_defaults': { 'target_conditions': [ - ['_target_name in ["libuv", "http_parser", "cares", "node", "zlib"]', { + ['_target_name in ["libuv", "http_parser", "openssl", "cares", "node", "zlib"]', { 'msvs_disabled_warnings': [ 4703, # potentially uninitialized local pointer variable 'req' used 4013, # 'free' undefined; assuming extern returning int @@ -77,6 +78,7 @@ '-Wno-unused-function', '-Wno-sometimes-uninitialized', '-Wno-pointer-sign', + '-Wno-sign-compare', '-Wno-string-plus-int', '-Wno-unused-variable', '-Wno-deprecated-declarations', @@ -105,7 +107,7 @@ ['_target_name in ["node", "atom_lib"]', { 'include_dirs': [ '<(libchromiumcontent_src_dir)/v8/include', - '<(libchromiumcontent_src_dir)/third_party/boringssl/src/include', + 'vendor/node/deps/openssl/openssl/include', ], }], ['_target_name=="node"', { diff --git a/vendor/brightray b/vendor/brightray index 71a4624adf2..ae360b94fff 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 71a4624adf2e95ee57138d6f5f1b5c469c20c4b4 +Subproject commit ae360b94fff5a25222b3a535aad8bb4e7cd3b992 diff --git a/vendor/node b/vendor/node index 6a8c1dda355..b1cd6a5f5e0 160000 --- a/vendor/node +++ b/vendor/node @@ -1 +1 @@ -Subproject commit 6a8c1dda355e67303441afb4bb812b8428362f23 +Subproject commit b1cd6a5f5e0b18e666c1a27794c4f77992a96bb7 From 9a458785b6752f8971e8cfab8ca126c0d8af0213 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 7 Apr 2015 18:29:14 +0800 Subject: [PATCH 21/89] Simplify how we build node.lib --- atom.gyp | 31 ------------------------------- script/upload-node-headers.py | 8 ++++---- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/atom.gyp b/atom.gyp index 31ac253b0ff..6a4e7c861d7 100644 --- a/atom.gyp +++ b/atom.gyp @@ -627,36 +627,5 @@ }, ], }], # OS!="mac" - ['OS=="win"', { - 'targets': [ - { - 'target_name': 'generate_node_lib', - 'type': 'none', - 'dependencies': [ - '<(project_name)', - ], - 'actions': [ - { - 'action_name': 'Create node.lib', - 'inputs': [ - '<(PRODUCT_DIR)/<(project_name).lib', - ], - 'outputs': [ - '<(PRODUCT_DIR)/node.lib', - ], - 'action': [ - 'lib.exe', - '/nologo', - # We can't use <(_outputs) here because that escapes the - # backslash in the path, which confuses lib.exe. - '/OUT:<(PRODUCT_DIR)\\node.lib', - '<@(_inputs)', - ], - 'msvs_cygwin_shell': 0, - }, - ], - }, # target generate_node_lib - ], - }], # OS==win ], } diff --git a/script/upload-node-headers.py b/script/upload-node-headers.py index c8998a80054..5b452363618 100755 --- a/script/upload-node-headers.py +++ b/script/upload-node-headers.py @@ -110,12 +110,12 @@ def upload_node(bucket, access_key, secret_key, version): 'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz')) if TARGET_PLATFORM == 'win32': - # Generate the node.lib. - build = os.path.join(SOURCE_ROOT, 'script', 'build.py') - execute([sys.executable, build, '-c', 'Release', '-t', 'generate_node_lib']) + # Copy atom.lib to node.lib + node_lib = os.path.join(OUT_DIR, 'node.lib') + atom_lib = os.path.join(OUT_DIR, 'atom.lib') + shutil.copy2(atom_lib, node_lib) # Upload the 32bit node.lib. - node_lib = os.path.join(OUT_DIR, 'node.lib') s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist/{0}'.format(version), [node_lib]) From 0cc36377a57ee9b7847c2e3a301a92938e730f8d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 7 Apr 2015 22:56:21 +0800 Subject: [PATCH 22/89] win: Ignore duplicate symbols between BoringSSL and OpenSSL --- common.gypi | 3 +++ vendor/brightray | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/common.gypi b/common.gypi index c737efd8be6..cbf3d14da25 100644 --- a/common.gypi +++ b/common.gypi @@ -191,6 +191,9 @@ }, 'VCLinkerTool': { 'AdditionalOptions': [ + # Force linking even though we have duplicate symbols between + # BoringSSL and OpenSSL. + '/FORCE:MULTIPLE', # ATL 8.0 included in WDK 7.1 makes the linker to generate following # warnings: # - warning LNK4254: section 'ATL' (50000040) merged into diff --git a/vendor/brightray b/vendor/brightray index ae360b94fff..616ce9051fe 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit ae360b94fff5a25222b3a535aad8bb4e7cd3b992 +Subproject commit 616ce9051fef9896651686aa9a0b6403caa4e1a8 From 105aec4ea9cb1f96c9fda83bcd47f2f77ae9f2f0 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 7 Apr 2015 15:12:20 +0000 Subject: [PATCH 23/89] Upgrade libchromiumcontent --- 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 e98e5b1c8eb..8c476406f1b 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -4,7 +4,7 @@ import platform import sys BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent' -LIBCHROMIUMCONTENT_COMMIT = '2b564074393dcd3dd90e0edfc5a75099c2a72d1d' +LIBCHROMIUMCONTENT_COMMIT = '610f2f670249d4097c32c8e9719a26f0dc6dc4e4' ARCH = { 'cygwin': '32bit', From 1a367702869e3c71191f442f3b625b05002a257c Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 7 Apr 2015 23:40:36 +0800 Subject: [PATCH 24/89] Only build static_library version of libchromiumcontent in CI --- script/bootstrap.py | 12 ++++++++---- script/cibuild | 4 ++-- vendor/brightray | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/script/bootstrap.py b/script/bootstrap.py index fadc7a20bda..caf23ed5018 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -28,7 +28,7 @@ def main(): update_win32_python() update_submodules() update_node_modules('.') - bootstrap_brightray(args.url) + bootstrap_brightray(args.dev, args.url) create_chrome_version_h() touch_config_gypi() @@ -47,6 +47,8 @@ def parse_args(): parser.add_argument('-v', '--verbose', action='store_true', help='Prints the output of the subprocesses') + parser.add_argument('-d', '--dev', action='store_true', + help='Do not download static_library build') parser.add_argument('-y', '--yes', '--assume-yes', action='store_true', help='Run non-interactively by assuming "yes" to all ' \ @@ -66,10 +68,12 @@ def update_submodules(): execute_stdout(['git', 'submodule', 'update', '--init', '--recursive']) -def bootstrap_brightray(url): +def bootstrap_brightray(is_dev, url): bootstrap = os.path.join(VENDOR_DIR, 'brightray', 'script', 'bootstrap') - execute_stdout([sys.executable, bootstrap, '--commit', - LIBCHROMIUMCONTENT_COMMIT, url]) + args = ['--commit', LIBCHROMIUMCONTENT_COMMIT, url] + if is_dev: + args = ['--dev'] + args + execute_stdout([sys.executable, bootstrap] + args) def update_node_modules(dirname): diff --git a/script/cibuild b/script/cibuild index b71a1992522..264e1230988 100755 --- a/script/cibuild +++ b/script/cibuild @@ -43,10 +43,10 @@ def main(): if is_travis and sys.platform == 'linux2': with scoped_env('CXX', 'g++'): with scoped_env('CC', 'gcc'): - run_script('bootstrap.py') + run_script('bootstrap.py', ['-v', '--dev']) run_script('update.py') else: - run_script('bootstrap.py') + run_script('bootstrap.py', ['-v', '--dev']) run_script('cpplint.py') if sys.platform != 'win32': diff --git a/vendor/brightray b/vendor/brightray index 616ce9051fe..e1304edb03a 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 616ce9051fef9896651686aa9a0b6403caa4e1a8 +Subproject commit e1304edb03ac774d1386be19bcced0822aabbc70 From 546747617336eef9f54a9da30001ade0cd4503b6 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 8 Apr 2015 16:36:39 +0800 Subject: [PATCH 25/89] Don't verbose output in ci --- script/cibuild | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/cibuild b/script/cibuild index 264e1230988..70773581487 100755 --- a/script/cibuild +++ b/script/cibuild @@ -43,10 +43,10 @@ def main(): if is_travis and sys.platform == 'linux2': with scoped_env('CXX', 'g++'): with scoped_env('CC', 'gcc'): - run_script('bootstrap.py', ['-v', '--dev']) + run_script('bootstrap.py', ['--dev']) run_script('update.py') else: - run_script('bootstrap.py', ['-v', '--dev']) + run_script('bootstrap.py', ['--dev']) run_script('cpplint.py') if sys.platform != 'win32': From f9b5156c2c520b0d47669411f273ea7b00140e5e Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 8 Apr 2015 16:46:05 +0800 Subject: [PATCH 26/89] linux: Fix static linking --- script/lib/config.py | 2 +- vendor/brightray | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/script/lib/config.py b/script/lib/config.py index 8c476406f1b..29eafb21cdf 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -4,7 +4,7 @@ import platform import sys BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent' -LIBCHROMIUMCONTENT_COMMIT = '610f2f670249d4097c32c8e9719a26f0dc6dc4e4' +LIBCHROMIUMCONTENT_COMMIT = '26fdb337d01f56d3ec24254887eb5c20db1096c7' ARCH = { 'cygwin': '32bit', diff --git a/vendor/brightray b/vendor/brightray index e1304edb03a..bff2151ed0f 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit e1304edb03ac774d1386be19bcced0822aabbc70 +Subproject commit bff2151ed0f2a4c2ccc41d88d2342b24f000e011 From 1b3b2cd40272771e2d02d0b18194d2f612fd208a Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 8 Apr 2015 19:15:48 +0800 Subject: [PATCH 27/89] linux: Don't dynamically load libgio It conflicts with statically linked libgio. --- atom/browser/atom_browser_main_parts_linux.cc | 29 +-- chromium_src/library_loaders/libgio.h | 48 ----- chromium_src/library_loaders/libgio_loader.cc | 174 ------------------ filenames.gypi | 2 - 4 files changed, 10 insertions(+), 243 deletions(-) delete mode 100644 chromium_src/library_loaders/libgio.h delete mode 100644 chromium_src/library_loaders/libgio_loader.cc diff --git a/atom/browser/atom_browser_main_parts_linux.cc b/atom/browser/atom_browser_main_parts_linux.cc index e205d98307b..278e49ac1f1 100644 --- a/atom/browser/atom_browser_main_parts_linux.cc +++ b/atom/browser/atom_browser_main_parts_linux.cc @@ -4,9 +4,10 @@ #include "atom/browser/atom_browser_main_parts.h" +#include + #include "base/command_line.h" #include "base/strings/string_number_conversions.h" -#include "library_loaders/libgio.h" #include "ui/gfx/switches.h" namespace atom { @@ -16,8 +17,8 @@ namespace { const char* kInterfaceSchema = "org.gnome.desktop.interface"; const char* kScaleFactor = "scaling-factor"; -bool SchemaExists(const LibGioLoader& libgio_loader, const char* schema_name) { - const gchar* const* schemas = libgio_loader.g_settings_list_schemas(); +bool SchemaExists(const char* schema_name) { + const gchar* const* schemas = g_settings_list_schemas(); while (*schemas) { if (strcmp(schema_name, static_cast(*schemas)) == 0) return true; @@ -26,9 +27,8 @@ bool SchemaExists(const LibGioLoader& libgio_loader, const char* schema_name) { return false; } -bool KeyExists(const LibGioLoader& libgio_loader, GSettings* client, - const char* key) { - gchar** keys = libgio_loader.g_settings_list_keys(client); +bool KeyExists(GSettings* client, const char* key) { + gchar** keys = g_settings_list_keys(client); if (!keys) return false; @@ -45,24 +45,15 @@ bool KeyExists(const LibGioLoader& libgio_loader, GSettings* client, } void GetDPIFromGSettings(guint* scale_factor) { - LibGioLoader libgio_loader; - - // Try also without .0 at the end; on some systems this may be required. - if (!libgio_loader.Load("libgio-2.0.so.0") && - !libgio_loader.Load("libgio-2.0.so")) { - VLOG(1) << "Cannot load gio library. Will fall back to gconf."; - return; - } - GSettings* client = nullptr; - if (!SchemaExists(libgio_loader, kInterfaceSchema) || - !(client = libgio_loader.g_settings_new(kInterfaceSchema))) { + if (!SchemaExists(kInterfaceSchema) || + !(client = g_settings_new(kInterfaceSchema))) { VLOG(1) << "Cannot create gsettings client."; return; } - if (KeyExists(libgio_loader, client, kScaleFactor)) - *scale_factor = libgio_loader.g_settings_get_uint(client, kScaleFactor); + if (KeyExists(client, kScaleFactor)) + *scale_factor = g_settings_get_uint(client, kScaleFactor); g_object_unref(client); } diff --git a/chromium_src/library_loaders/libgio.h b/chromium_src/library_loaders/libgio.h deleted file mode 100644 index 0e9708c406a..00000000000 --- a/chromium_src/library_loaders/libgio.h +++ /dev/null @@ -1,48 +0,0 @@ -// This is generated file. Do not modify directly. -// Path to the code generator: tools/generate_library_loader/generate_library_loader.py . - -#ifndef LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H -#define LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H - -#include -#define LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DLOPEN - - -#include - -class LibGioLoader { - public: - LibGioLoader(); - ~LibGioLoader(); - - bool Load(const std::string& library_name) - __attribute__((warn_unused_result)); - - bool loaded() const { return loaded_; } - - typeof(&::g_settings_new) g_settings_new; - typeof(&::g_settings_get_child) g_settings_get_child; - typeof(&::g_settings_get_string) g_settings_get_string; - typeof(&::g_settings_get_boolean) g_settings_get_boolean; - typeof(&::g_settings_get_uint) g_settings_get_uint; - typeof(&::g_settings_get_strv) g_settings_get_strv; - typeof(&::g_settings_is_writable) g_settings_is_writable; - typeof(&::g_settings_list_schemas) g_settings_list_schemas; - typeof(&::g_settings_list_keys) g_settings_list_keys; - - - private: - void CleanUp(bool unload); - -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DLOPEN) - void* library_; -#endif - - bool loaded_; - - // Disallow copy constructor and assignment operator. - LibGioLoader(const LibGioLoader&); - void operator=(const LibGioLoader&); -}; - -#endif // LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H diff --git a/chromium_src/library_loaders/libgio_loader.cc b/chromium_src/library_loaders/libgio_loader.cc deleted file mode 100644 index 268f190dcfd..00000000000 --- a/chromium_src/library_loaders/libgio_loader.cc +++ /dev/null @@ -1,174 +0,0 @@ -// This is generated file. Do not modify directly. -// Path to the code generator: tools/generate_library_loader/generate_library_loader.py . - -#include "library_loaders/libgio.h" - -#include - -// Put these sanity checks here so that they fire at most once -// (to avoid cluttering the build output). -#if !defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DLOPEN) && !defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DT_NEEDED) -#error neither LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DLOPEN nor LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DT_NEEDED defined -#endif -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DLOPEN) && defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DT_NEEDED) -#error both LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DLOPEN and LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DT_NEEDED defined -#endif - -LibGioLoader::LibGioLoader() : loaded_(false) { -} - -LibGioLoader::~LibGioLoader() { - CleanUp(loaded_); -} - -bool LibGioLoader::Load(const std::string& library_name) { - if (loaded_) - return false; - -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DLOPEN) - library_ = dlopen(library_name.c_str(), RTLD_LAZY); - if (!library_) - return false; -#endif - - -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DLOPEN) - g_settings_new = - reinterpret_castg_settings_new)>( - dlsym(library_, "g_settings_new")); -#endif -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DT_NEEDED) - g_settings_new = &::g_settings_new; -#endif - if (!g_settings_new) { - CleanUp(true); - return false; - } - -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DLOPEN) - g_settings_get_child = - reinterpret_castg_settings_get_child)>( - dlsym(library_, "g_settings_get_child")); -#endif -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DT_NEEDED) - g_settings_get_child = &::g_settings_get_child; -#endif - if (!g_settings_get_child) { - CleanUp(true); - return false; - } - -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DLOPEN) - g_settings_get_string = - reinterpret_castg_settings_get_string)>( - dlsym(library_, "g_settings_get_string")); -#endif -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DT_NEEDED) - g_settings_get_string = &::g_settings_get_string; -#endif - if (!g_settings_get_string) { - CleanUp(true); - return false; - } - -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DLOPEN) - g_settings_get_boolean = - reinterpret_castg_settings_get_boolean)>( - dlsym(library_, "g_settings_get_boolean")); -#endif -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DT_NEEDED) - g_settings_get_boolean = &::g_settings_get_boolean; -#endif - if (!g_settings_get_boolean) { - CleanUp(true); - return false; - } - -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DLOPEN) - g_settings_get_uint = - reinterpret_castg_settings_get_uint)>( - dlsym(library_, "g_settings_get_uint")); -#endif -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DT_NEEDED) - g_settings_get_uint = &::g_settings_get_uint; -#endif - if (!g_settings_get_uint) { - CleanUp(true); - return false; - } - -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DLOPEN) - g_settings_get_strv = - reinterpret_castg_settings_get_strv)>( - dlsym(library_, "g_settings_get_strv")); -#endif -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DT_NEEDED) - g_settings_get_strv = &::g_settings_get_strv; -#endif - if (!g_settings_get_strv) { - CleanUp(true); - return false; - } - -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DLOPEN) - g_settings_is_writable = - reinterpret_castg_settings_is_writable)>( - dlsym(library_, "g_settings_is_writable")); -#endif -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DT_NEEDED) - g_settings_is_writable = &::g_settings_is_writable; -#endif - if (!g_settings_is_writable) { - CleanUp(true); - return false; - } - -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DLOPEN) - g_settings_list_schemas = - reinterpret_castg_settings_list_schemas)>( - dlsym(library_, "g_settings_list_schemas")); -#endif -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DT_NEEDED) - g_settings_list_schemas = &::g_settings_list_schemas; -#endif - if (!g_settings_list_schemas) { - CleanUp(true); - return false; - } - -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DLOPEN) - g_settings_list_keys = - reinterpret_castg_settings_list_keys)>( - dlsym(library_, "g_settings_list_keys")); -#endif -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DT_NEEDED) - g_settings_list_keys = &::g_settings_list_keys; -#endif - if (!g_settings_list_keys) { - CleanUp(true); - return false; - } - - loaded_ = true; - return true; -} - -void LibGioLoader::CleanUp(bool unload) { -#if defined(LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBGIO_H_DLOPEN) - if (unload) { - dlclose(library_); - library_ = NULL; - } -#endif - loaded_ = false; - g_settings_new = NULL; - g_settings_get_child = NULL; - g_settings_get_string = NULL; - g_settings_get_boolean = NULL; - g_settings_get_uint = NULL; - g_settings_get_strv = NULL; - g_settings_is_writable = NULL; - g_settings_list_schemas = NULL; - g_settings_list_keys = NULL; - -} diff --git a/filenames.gypi b/filenames.gypi index 5866511faa7..d14c935ab72 100644 --- a/filenames.gypi +++ b/filenames.gypi @@ -340,8 +340,6 @@ 'chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.h', 'chromium_src/chrome/renderer/tts_dispatcher.cc', 'chromium_src/chrome/renderer/tts_dispatcher.h', - 'chromium_src/library_loaders/libgio_loader.cc', - 'chromium_src/library_loaders/libgio.h', 'chromium_src/library_loaders/libspeechd_loader.cc', 'chromium_src/library_loaders/libspeechd.h', '<@(native_mate_files)', From 555e06573a1d54faae372cbd6c8c20d891d92a01 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 8 Apr 2015 19:19:40 +0800 Subject: [PATCH 28/89] Fix pylint warnings --- script/create-dist.py | 14 -------------- script/update.py | 16 ++++++++-------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/script/create-dist.py b/script/create-dist.py index 0b3152b8cbb..4341adad37e 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -import argparse import os import re import shutil @@ -79,8 +78,6 @@ def main(): rm_rf(DIST_DIR) os.makedirs(DIST_DIR) - args = parse_args() - force_build() create_symbols() copy_binaries() @@ -96,17 +93,6 @@ def main(): create_symbols_zip() -def parse_args(): - parser = argparse.ArgumentParser(description='Create distributions') - parser.add_argument('-u', '--url', - help='The base URL from which to download ' - 'libchromiumcontent (i.e., the URL you passed to ' - 'libchromiumcontent\'s script/upload script', - default=BASE_URL, - required=False) - return parser.parse_args() - - def force_build(): build = os.path.join(SOURCE_ROOT, 'script', 'build.py') execute([sys.executable, build, '-c', 'Release']) diff --git a/script/update.py b/script/update.py index 67a0c2b5002..9b47ead488c 100755 --- a/script/update.py +++ b/script/update.py @@ -47,14 +47,14 @@ def run_gyp(target_arch, component): # Force using win32 python on cygwin. python = os.path.join('vendor', 'python_26', 'python.exe') gyp = os.path.join('vendor', 'brightray', 'vendor', 'gyp', 'gyp_main.py') - return subprocess.call([python, gyp, - '-f', 'ninja', '--depth', '.', 'atom.gyp', - '-Icommon.gypi', - '-Dlibchromiumcontent_component={0}'.format(component), - '-Dlinux_clang=0', # FIXME remove me. - '-Dtarget_arch={0}'.format(target_arch), - '-Dlibrary=static_library']) - + defines = [ + '-Dlibchromiumcontent_component={0}'.format(component), + '-Dlinux_clang=0', # FIXME remove me. + '-Dtarget_arch={0}'.format(target_arch), + '-Dlibrary=static_library', + ] + return subprocess.call([python, gyp, '-f', 'ninja', '--depth', '.', + 'atom.gyp', '-Icommon.gypi'] + defines) if __name__ == '__main__': sys.exit(main()) From c5b85b23eb29a67c8349aa127a8c49a8a18a1d44 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 8 Apr 2015 19:22:02 +0800 Subject: [PATCH 29/89] Remove linux_clang option We are always using clang now. --- script/update.py | 1 - vendor/brightray | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/script/update.py b/script/update.py index 9b47ead488c..ba3380d67c3 100755 --- a/script/update.py +++ b/script/update.py @@ -49,7 +49,6 @@ def run_gyp(target_arch, component): gyp = os.path.join('vendor', 'brightray', 'vendor', 'gyp', 'gyp_main.py') defines = [ '-Dlibchromiumcontent_component={0}'.format(component), - '-Dlinux_clang=0', # FIXME remove me. '-Dtarget_arch={0}'.format(target_arch), '-Dlibrary=static_library', ] diff --git a/vendor/brightray b/vendor/brightray index bff2151ed0f..dfce146b624 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit bff2151ed0f2a4c2ccc41d88d2342b24f000e011 +Subproject commit dfce146b6249c191fe7cba624ce85432d3894d1d From c2852b5b8c5edb573848938c8c6d1193ed883362 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 8 Apr 2015 19:46:37 +0800 Subject: [PATCH 30/89] linux: Add some more building requirements --- docs/development/build-instructions-linux.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/development/build-instructions-linux.md b/docs/development/build-instructions-linux.md index a7895d22261..03e870a42f6 100644 --- a/docs/development/build-instructions-linux.md +++ b/docs/development/build-instructions-linux.md @@ -9,7 +9,10 @@ On Ubuntu you could install the libraries via: ```bash -$ sudo apt-get install build-essential clang libdbus-1-dev libgtk2.0-dev libnotify-dev libgnome-keyring-dev libgconf2-dev gcc-multilib g++-multilib +$ sudo apt-get install build-essential clang libdbus-1-dev libgtk2.0-dev \ + libnotify-dev libgnome-keyring-dev libgconf2-dev \ + libasound2-dev libcap-dev libcups2-dev libxtst-dev \ + gcc-multilib g++-multilib ``` Latest Node.js could be installed via ppa: From c3f8ef06b6ebb9b5bf5cea070c82e8c4aaf607e1 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 8 Apr 2015 19:46:57 +0800 Subject: [PATCH 31/89] Ship with correct files in distribution --- atom.gyp | 1 - script/create-dist.py | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/atom.gyp b/atom.gyp index 6a4e7c861d7..81c9204a431 100644 --- a/atom.gyp +++ b/atom.gyp @@ -429,7 +429,6 @@ { '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 diff --git a/script/create-dist.py b/script/create-dist.py index 4341adad37e..64da6b045ef 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -29,10 +29,9 @@ TARGET_BINARIES = { ], 'win32': [ 'atom.exe', - 'chromiumcontent.dll', + 'boringssl.dll', 'content_shell.pak', 'd3dcompiler_47.dll', - 'node.dll', 'ffmpegsumo.dll', 'icudtl.dat', 'libEGL.dll', @@ -46,9 +45,8 @@ TARGET_BINARIES = { 'linux': [ 'atom', 'content_shell.pak', - 'libnode.so', 'icudtl.dat', - 'libchromiumcontent.so', + 'libboringssl.so', 'libffmpegsumo.so', 'natives_blob.bin', 'snapshot_blob.bin', From f5e6c62418deef6539393019a0eb207d5e986ecd Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 8 Apr 2015 20:08:27 +0800 Subject: [PATCH 32/89] linux: Fix create distribution for chromedriver --- script/create-dist.py | 29 +++++++++++++++++++++-------- script/lib/util.py | 2 +- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/script/create-dist.py b/script/create-dist.py index 64da6b045ef..e3ff67ed463 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -5,6 +5,7 @@ import re import shutil import subprocess import sys +import stat from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, TARGET_PLATFORM, \ DIST_ARCH @@ -17,6 +18,8 @@ ATOM_SHELL_VERSION = get_atom_shell_version() SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DIST_DIR = os.path.join(SOURCE_ROOT, 'dist') OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R') +CHROMIUM_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', + 'download', 'libchromiumcontent', 'static_library') SYMBOL_NAME = { 'darwin': 'libchromiumcontent.dylib.dSYM', @@ -107,12 +110,20 @@ def copy_binaries(): def copy_chromedriver(): - build = os.path.join(SOURCE_ROOT, 'script', 'build.py') - execute([sys.executable, build, '-c', 'Release', '-t', 'copy_chromedriver']) - binary = 'chromedriver' if TARGET_PLATFORM == 'win32': - binary += '.exe' - shutil.copy2(os.path.join(OUT_DIR, binary), DIST_DIR) + chromedriver = 'chromedriver.exe' + else: + chromedriver = 'chromedriver' + src = os.path.join(CHROMIUM_DIR, chromedriver) + dest = os.path.join(DIST_DIR, chromedriver) + + # Copy file and keep the executable bit. + shutil.copyfile(src, dest) + os.chmod(dest, os.stat(dest).st_mode | stat.S_IEXEC) + + # Fix the linking with boringssl. + if TARGET_PLATFORM == 'linux': + execute(['chrpath', '-r', '$ORIGIN', dest]) def copy_license(): @@ -173,9 +184,11 @@ def create_chromedriver_zip(): with scoped_cwd(DIST_DIR): files = ['LICENSE'] if TARGET_PLATFORM == 'win32': - files += ['chromedriver.exe'] - else: - files += ['chromedriver'] + files += ['chromedriver.exe', 'boringssl.dll'] + elif TARGET_PLATFORM == 'darwin': + files += ['chromedriver', 'libboringssl.dylib'] + elif TARGET_PLATFORM == 'linux': + files += ['chromedriver', 'libboringssl.so'] make_zip(zip_file, files, []) diff --git a/script/lib/util.py b/script/lib/util.py index 174c65a83d9..04ee9817e28 100644 --- a/script/lib/util.py +++ b/script/lib/util.py @@ -162,7 +162,7 @@ def get_chromedriver_version(): SOURCE_ROOT = os.path.abspath(os.path.join(__file__, '..', '..', '..')) chromedriver = os.path.join(SOURCE_ROOT, 'out', 'R', 'chromedriver') output = subprocess.check_output([chromedriver, '-v']).strip() - return 'v' + output[13:] + return 'v' + output[13:output.rfind(' ')] def parse_version(version): From 565065ed6bb4287008463dc1a3e4185272f191a3 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 8 Apr 2015 20:16:02 +0800 Subject: [PATCH 33/89] Remove unused copy_chromedriver target --- atom.gyp | 30 ------------------------------ tools/copy_binary.py | 12 ------------ 2 files changed, 42 deletions(-) delete mode 100755 tools/copy_binary.py diff --git a/atom.gyp b/atom.gyp index 81c9204a431..029b8131819 100644 --- a/atom.gyp +++ b/atom.gyp @@ -449,36 +449,6 @@ }], # OS=="linux" ], }, # target <(project_name>_dump_symbols - { - 'target_name': 'copy_chromedriver', - 'type': 'none', - 'actions': [ - { - 'action_name': 'Copy ChromeDriver Binary', - 'variables': { - 'conditions': [ - ['OS=="win"', { - 'chromedriver_binary': 'chromedriver.exe', - },{ - 'chromedriver_binary': 'chromedriver', - }], - ], - }, - 'inputs': [ - '<(libchromiumcontent_dir)/<(chromedriver_binary)', - ], - 'outputs': [ - '<(PRODUCT_DIR)/<(chromedriver_binary)', - ], - 'action': [ - 'python', - 'tools/copy_binary.py', - '<@(_inputs)', - '<@(_outputs)', - ], - } - ], - }, # copy_chromedriver ], 'conditions': [ ['OS=="mac"', { diff --git a/tools/copy_binary.py b/tools/copy_binary.py deleted file mode 100755 index a21b652a439..00000000000 --- a/tools/copy_binary.py +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env python - -import os -import shutil -import stat -import sys - -src = sys.argv[1] -dist = sys.argv[2] - -shutil.copyfile(src, dist) -os.chmod(dist, os.stat(dist).st_mode | stat.S_IEXEC) From 4bb0ac271b3cb6bb2661dbc4cd50f6eae8ddde4f Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 8 Apr 2015 22:05:33 +0800 Subject: [PATCH 34/89] mac: Fix linking error when running chromedriver --- script/create-dist.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/script/create-dist.py b/script/create-dist.py index e3ff67ed463..a66795f4269 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -124,6 +124,12 @@ def copy_chromedriver(): # Fix the linking with boringssl. if TARGET_PLATFORM == 'linux': execute(['chrpath', '-r', '$ORIGIN', dest]) + elif TARGET_PLATFORM == 'darwin': + shutil.copy2(os.path.join(CHROMIUM_DIR, 'libboringssl.dylib'), DIST_DIR) + execute(['install_name_tool', '-change', + '/usr/local/lib/libboringssl.dylib', + '@loader_path/libboringssl.dylib', + dest]) def copy_license(): From 42dafd47fd0744b62bdad97d126697a044f0cb8e Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 8 Apr 2015 22:12:47 +0800 Subject: [PATCH 35/89] Separate symbols generation from building --- atom.gyp | 101 ----------------------- script/create-dist.py | 19 +---- script/dump-symbols.py | 62 ++++++++++++++ tools/posix/generate_breakpad_symbols.py | 2 +- 4 files changed, 66 insertions(+), 118 deletions(-) create mode 100755 script/dump-symbols.py diff --git a/atom.gyp b/atom.gyp index 029b8131819..6a81a9b2f54 100644 --- a/atom.gyp +++ b/atom.gyp @@ -348,107 +348,6 @@ } ], }, # target atom_coffee2c - { - 'target_name': '<(project_name)_dump_symbols', - 'type': 'none', - 'dependencies': [ - '<(project_name)', - ], - 'conditions': [ - ['OS=="mac"', { - 'dependencies': [ - 'vendor/breakpad/breakpad.gyp:dump_syms', - ], - 'actions': [ - { - 'action_name': 'Dump Symbols', - 'inputs': [ - '<(PRODUCT_DIR)/<(product_name).app/Contents/MacOS/<(product_name)', - ], - 'outputs': [ - '<(PRODUCT_DIR)/Atom-Shell.breakpad.syms', - ], - 'action': [ - 'python', - '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', - '--libchromiumcontent-dir=<(libchromiumcontent_dir)', - '--clear', - '--jobs=16', - ], - }, - ], - }], # OS=="mac" - ['OS=="win"', { - 'actions': [ - { - 'action_name': 'Dump Symbols', - 'inputs': [ - '<(PRODUCT_DIR)/<(project_name).exe', - ], - 'outputs': [ - '<(PRODUCT_DIR)/Atom-Shell.breakpad.syms', - ], - 'action': [ - 'python', - 'tools/win/generate_breakpad_symbols.py', - '--symbols-dir=<(PRODUCT_DIR)/Atom-Shell.breakpad.syms', - '--jobs=16', - '<(PRODUCT_DIR)', - '<(libchromiumcontent_dir)', - ], - }, - ], - }], # 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_dir)', - '--clear', - '--jobs=16', - ], - }, - { - 'action_name': 'Strip Binary', - 'inputs': [ - '<(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': [ - 'tools/posix/strip.sh', - '<@(_inputs)', - ], - }, - ], - }], # OS=="linux" - ], - }, # target <(project_name>_dump_symbols ], 'conditions': [ ['OS=="mac"', { diff --git a/script/create-dist.py b/script/create-dist.py index a66795f4269..59e4a28a3a2 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -21,12 +21,6 @@ OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R') CHROMIUM_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', 'download', 'libchromiumcontent', 'static_library') -SYMBOL_NAME = { - 'darwin': 'libchromiumcontent.dylib.dSYM', - 'linux': 'libchromiumcontent.so.dbg', - 'win32': 'chromiumcontent.dll.pdb', -}[TARGET_PLATFORM] - TARGET_BINARIES = { 'darwin': [ ], @@ -157,16 +151,9 @@ def create_version(): def create_symbols(): - directory = 'Atom-Shell.breakpad.syms' - rm_rf(os.path.join(OUT_DIR, directory)) - - build = os.path.join(SOURCE_ROOT, 'script', 'build.py') - subprocess.check_output([sys.executable, build, '-c', 'Release', - '-t', 'atom_dump_symbols']) - - shutil.copytree(os.path.join(OUT_DIR, directory), - os.path.join(DIST_DIR, directory), - symlinks=True) + destination = os.path.join(DIST_DIR, 'Atom-Shell.breakpad.syms') + dump_symbols = os.path.join(SOURCE_ROOT, 'script', 'dump-symbols.py') + execute([sys.executable, dump_symbols, destination]) def create_dist_zip(): diff --git a/script/dump-symbols.py b/script/dump-symbols.py new file mode 100755 index 00000000000..e8df27fdd2b --- /dev/null +++ b/script/dump-symbols.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python + +import os +import sys + +from lib.config import TARGET_PLATFORM +from lib.util import execute, rm_rf + + +SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) +DIST_DIR = os.path.join(SOURCE_ROOT, 'dist') +OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R') +CHROMIUM_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', + 'download', 'libchromiumcontent', 'static_library') + + +def main(destination): + rm_rf(destination) + (project_name, product_name) = get_names_from_gyp() + + if TARGET_PLATFORM in ['darwin', 'linux']: + # Generate the dump_syms tool. + build = os.path.join(SOURCE_ROOT, 'script', 'build.py') + execute([sys.executable, build, '-c', 'R', '-t', 'dump_syms']) + + generate_breakpad_symbols = os.path.join(SOURCE_ROOT, 'tools', 'posix', + 'generate_breakpad_symbols.py') + if TARGET_PLATFORM == 'darwin': + start = os.path.join(OUT_DIR, '{0}.app'.format(product_name), 'Contents', + 'MacOS', product_name) + else: + start = os.path.join(OUT_DIR, project_name) + args = [ + '--build-dir={0}'.format(OUT_DIR), + '--binary={0}'.format(start), + '--symbols-dir={0}'.format(destination), + '--libchromiumcontent-dir={0}'.format(CHROMIUM_DIR), + '--clear', + '--jobs=16', + ] + else: + generate_breakpad_symbols = os.path.join(SOURCE_ROOT, 'tools', 'win', + 'generate_breakpad_symbols.py') + args = [ + '--symbols-dir={0}'.format(destination), + '--jobs=16', + OUT_DIR, + CHROMIUM_DIR, + ] + + execute([sys.executable, generate_breakpad_symbols] + args) + + +def get_names_from_gyp(): + gyp = os.path.join(SOURCE_ROOT, 'atom.gyp') + with open(gyp) as f: + o = eval(f.read()); + return (o['variables']['project_name%'], o['variables']['product_name%']) + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1])) diff --git a/tools/posix/generate_breakpad_symbols.py b/tools/posix/generate_breakpad_symbols.py index 6b6c7515860..88cae88fe8c 100755 --- a/tools/posix/generate_breakpad_symbols.py +++ b/tools/posix/generate_breakpad_symbols.py @@ -61,7 +61,7 @@ def FindBundlePart(full_path): def GetDSYMBundle(options, binary_path): """Finds the .dSYM bundle to the binary.""" - if binary_path[0] == '/' or binary_path == '': + if not binary_path.endswith(' Framework'): return binary_path filename = FindBundlePart(binary_path) From 0bc5d6438e06212b37aa6504664c0aa6bfa5e758 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 8 Apr 2015 22:22:40 +0800 Subject: [PATCH 36/89] Fix generating distribution for chromedriver --- script/lib/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/lib/util.py b/script/lib/util.py index 04ee9817e28..698da95080a 100644 --- a/script/lib/util.py +++ b/script/lib/util.py @@ -160,7 +160,7 @@ def get_atom_shell_version(): def get_chromedriver_version(): SOURCE_ROOT = os.path.abspath(os.path.join(__file__, '..', '..', '..')) - chromedriver = os.path.join(SOURCE_ROOT, 'out', 'R', 'chromedriver') + chromedriver = os.path.join(SOURCE_ROOT, 'dist', 'chromedriver') output = subprocess.check_output([chromedriver, '-v']).strip() return 'v' + output[13:output.rfind(' ')] From b8e38ad14ea96e551f34da5ae9089407d979c02f Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 09:05:51 +0800 Subject: [PATCH 37/89] linux: Strip binaries wen creating distribution --- script/create-dist.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/script/create-dist.py b/script/create-dist.py index 59e4a28a3a2..c2dc4645f2d 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -80,6 +80,7 @@ def main(): copy_license() if TARGET_PLATFORM == 'linux': + strip_binaries() copy_system_libraries() create_version() @@ -130,6 +131,12 @@ def copy_license(): shutil.copy2(os.path.join(SOURCE_ROOT, 'LICENSE'), DIST_DIR) +def strip_binaries(): + for binary in TARGET_BINARIES[TARGET_PLATFORM]: + if binary.endswith('.so') or '.' not in binary: + execute(['strip', os.path.join(DIST_DIR, binary)]) + + def copy_system_libraries(): ldd = execute(['ldd', os.path.join(OUT_DIR, 'atom')]) lib_re = re.compile('\t(.*) => (.+) \(.*\)$') From 44d0bceff465c440c52d9bdbf2d0f6b49026ca16 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 09:59:57 +0800 Subject: [PATCH 38/89] linux: Move some building flags to brightray --- atom.gyp | 20 ++++---------------- vendor/brightray | 2 +- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/atom.gyp b/atom.gyp index 6a81a9b2f54..7db7c8169a3 100644 --- a/atom.gyp +++ b/atom.gyp @@ -17,16 +17,6 @@ # Rules for excluding e.g. foo_win.cc from the build on non-Windows. 'filename_rules.gypi', ], - 'conditions': [ - ['libchromiumcontent_component', { - 'configurations': { - 'Debug': { - 'defines': [ 'DEBUG' ], - 'cflags': [ '-g', '-O0' ], - }, - }, - }], - ], }, 'targets': [ { @@ -282,15 +272,13 @@ ], }, # Required settings of using breakpad. - 'include_dirs': [ - 'vendor/breakpad/src', - ], - 'cflags': [ - ' Date: Thu, 9 Apr 2015 10:00:31 +0800 Subject: [PATCH 39/89] Allow testing release build --- script/test.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/script/test.py b/script/test.py index 21a1083cb1e..712c94128b5 100755 --- a/script/test.py +++ b/script/test.py @@ -11,13 +11,17 @@ SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) def main(): os.chdir(SOURCE_ROOT) + config = 'D' + if len(sys.argv) == 2 and sys.argv[1] == '-R': + config = 'R' + if sys.platform == 'darwin': - atom_shell = os.path.join(SOURCE_ROOT, 'out', 'D', 'Atom.app', + atom_shell = os.path.join(SOURCE_ROOT, 'out', config, 'Atom.app', 'Contents', 'MacOS', 'Atom') elif sys.platform == 'win32': - atom_shell = os.path.join(SOURCE_ROOT, 'out', 'D', 'atom.exe') + atom_shell = os.path.join(SOURCE_ROOT, 'out', config, 'atom.exe') else: - atom_shell = os.path.join(SOURCE_ROOT, 'out', 'D', 'atom') + atom_shell = os.path.join(SOURCE_ROOT, 'out', config, 'atom') subprocess.check_call([atom_shell, 'spec'] + sys.argv[1:]) From 0a56f34d0404a77cab0b8f09435f73601584b375 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 10:14:50 +0800 Subject: [PATCH 40/89] Move filename_rules.gypi to brightray --- atom.gyp | 4 --- filename_rules.gypi | 77 --------------------------------------------- vendor/brightray | 2 +- 3 files changed, 1 insertion(+), 82 deletions(-) delete mode 100644 filename_rules.gypi diff --git a/atom.gyp b/atom.gyp index 7db7c8169a3..b874b09cf04 100644 --- a/atom.gyp +++ b/atom.gyp @@ -13,10 +13,6 @@ 'mac_framework_dirs': [ '<(atom_source_root)/external_binaries', ], - 'includes': [ - # Rules for excluding e.g. foo_win.cc from the build on non-Windows. - 'filename_rules.gypi', - ], }, 'targets': [ { diff --git a/filename_rules.gypi b/filename_rules.gypi deleted file mode 100644 index e1ee46dddee..00000000000 --- a/filename_rules.gypi +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright (c) 2012 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# This gypi file defines the patterns used for determining whether a -# file is excluded from the build on a given platform. It is -# included by common.gypi for chromium_code. - -{ - 'target_conditions': [ - ['OS!="win"', { - 'sources/': [ ['exclude', '_win(_unittest)?\\.(h|cc)$'], - ['exclude', '(^|/)win/'], - ['exclude', '(^|/)win_[^/]*\\.(h|cc)$'] ], - }], - ['OS!="mac"', { - 'sources/': [ ['exclude', '_(cocoa|mac)(_unittest)?\\.(h|cc|mm?)$'], - ['exclude', '(^|/)(cocoa|mac)/'] ], - }], - ['OS!="ios"', { - 'sources/': [ ['exclude', '_ios(_unittest)?\\.(h|cc|mm?)$'], - ['exclude', '(^|/)ios/'] ], - }], - ['OS!="mac" and OS!="ios"', { - 'sources/': [ ['exclude', '\\.mm?$' ] ], - }], - # Do not exclude the linux files on *BSD since most of them can be - # shared at this point. - # In case a file is not needed, it is going to be excluded later on. - # TODO(evan): the above is not correct; we shouldn't build _linux - # files on non-linux. - ['OS!="linux" and OS!="openbsd" and OS!="freebsd"', { - 'sources/': [ - ['exclude', '(^|/)library_loaders/'], - ['exclude', '_linux(_unittest)?\\.(h|cc)$'], - ['exclude', '(^|/)linux_[^/]*\\.(h|cc)$'], - ['exclude', '(^|/)linux/'], - ['exclude', '_x11(_unittest)?\\.(h|cc)$'], - ['exclude', '(^|/)x11_[^/]*\\.(h|cc)$'], - ['exclude', '(^|/)x11/'], - ], - }], - ['OS!="android"', { - 'sources/': [ - ['exclude', '_android(_unittest)?\\.cc$'], - ['exclude', '(^|/)android/'], - ], - }], - ['OS=="win"', { - 'sources/': [ - ['exclude', '_posix(_unittest)?\\.(h|cc)$'], - ['exclude', '(^|/)posix/'], - ], - }], - ['OS!="linux" and OS!="openbsd" and OS!="freebsd"', { - 'sources/': [ - ['exclude', '_xdg(_unittest)?\\.(h|cc)$'], - ], - }], - ['OS!="linux" and OS!="openbsd" and OS!="freebsd"', { - 'sources/': [ - ['exclude', '_gtk(_browsertest|_unittest)?\\.(h|cc)$'], - ['exclude', '(^|/)gtk/'], - ['exclude', '(^|/)gtk_[^/]*\\.(h|cc)$'], - ['exclude', '(^|/)libgtk2ui/'], - ['exclude', '(^|/)x/'], - ], - }], - ['OS=="mac"', { - 'sources/': [ ['exclude', '_aura(_browsertest|_unittest)?\\.(h|cc)$'], - ['exclude', '(^|/)aura/'], - ['exclude', '_views\\.(h|cc)$'], - ['exclude', '(^|/)views/'], - ], - }], - ] -} diff --git a/vendor/brightray b/vendor/brightray index 821eed6ada1..80c8211551c 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 821eed6ada17149eea96bb3ab6cb0c299342f535 +Subproject commit 80c8211551c3fe6a51ff0abfe235bd889d06ffd6 From b6af1cf93c3c6ef4abe14e9e8496326ba376b1f6 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 10:15:24 +0800 Subject: [PATCH 41/89] Remove appveyor.yml I don't think we will use it in future. --- appveyor.yml | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 93fa245f5f8..00000000000 --- a/appveyor.yml +++ /dev/null @@ -1,28 +0,0 @@ -# appveyor file -# http://www.appveyor.com/docs/appveyor-yml -version: "{build}" - -init: - - git config --global core.autocrlf input - -environment: - matrix: - - nodejs_version: 0.10 - -platform: - - x86 - -install: - - ps: Install-Product node $env:nodejs_version - - cmd: SET PATH=C:\Program Files (x86)\MSBuild\12.0\bin\;%PATH% - - cmd: SET PATH=C:\python27;%PATH% - - cmd: python script/bootstrap.py - - cmd: python script/build.py -c Debug - -test_script: - - node --version - - npm --version - - cmd: python script/cpplint.py - - cmd: python script/coffeelint.py - -build: off From b947cb505710c318fd283443f440bd4f72ffd2ab Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 10:52:15 +0800 Subject: [PATCH 42/89] Move clang flag to brightray --- common.gypi | 33 --------------------------------- vendor/brightray | 2 +- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/common.gypi b/common.gypi index cbf3d14da25..b8bc7559a46 100644 --- a/common.gypi +++ b/common.gypi @@ -3,12 +3,6 @@ 'vendor/brightray/brightray.gypi', ], 'variables': { - 'clang': 0, - 'conditions': [ - ['OS=="mac" or OS=="linux"', { - 'clang': 1, - }], - ], # Required by breakpad. 'os_bsd': 0, # Reflects node's config.gypi. @@ -213,33 +207,6 @@ }, }, 'conditions': [ - # Settings to compile with clang under OS X. - ['clang==1', { - 'make_global_settings': [ - ['CC', '/usr/bin/clang'], - ['CXX', '/usr/bin/clang++'], - ['LINK', '$(CXX)'], - ['CC.host', '$(CC)'], - ['CXX.host', '$(CXX)'], - ['LINK.host', '$(LINK)'], - ], - 'target_defaults': { - 'cflags_cc': [ - '-std=c++11', - ], - 'xcode_settings': { - 'CC': '/usr/bin/clang', - 'LDPLUSPLUS': '/usr/bin/clang++', - 'OTHER_CFLAGS': [ - '-fcolor-diagnostics', - ], - - 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99 - 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++ - 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11 - }, - }, - }], # clang==1 # The breakdpad on Windows assumes Debug_x64 and Release_x64 configurations. ['OS=="win"', { 'target_defaults': { diff --git a/vendor/brightray b/vendor/brightray index 80c8211551c..bf71f9ca782 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 80c8211551c3fe6a51ff0abfe235bd889d06ffd6 +Subproject commit bf71f9ca78227171054f7cc9ed1407d72aec02db From 52b875f199da7098132be0f5aa8557799ecc6a22 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 11:30:40 +0800 Subject: [PATCH 43/89] mac: Move strip flags to brightray --- common.gypi | 13 ------------- vendor/brightray | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/common.gypi b/common.gypi index b8bc7559a46..9b2abe4b42d 100644 --- a/common.gypi +++ b/common.gypi @@ -152,19 +152,6 @@ }], # OS=="win" ], }], - ['_type in ["executable", "shared_library"]', { - 'xcode_settings': { - # On some machines setting CLANG_CXX_LIBRARY doesn't work for linker. - 'OTHER_LDFLAGS': [ - '-stdlib=libc++' - ], - # Generates symbols and strip the binary. - 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym', - 'DEPLOYMENT_POSTPROCESSING': 'YES', - 'STRIP_INSTALLED_PRODUCT': 'YES', - 'STRIPFLAGS': '-x', - }, - }], ], 'msvs_cygwin_shell': 0, # Strangely setting it to 1 would make building under cygwin fail. 'msvs_disabled_warnings': [ diff --git a/vendor/brightray b/vendor/brightray index bf71f9ca782..c735889888f 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit bf71f9ca78227171054f7cc9ed1407d72aec02db +Subproject commit c735889888f8632e3dd9693e00a7988654baf7fd From 78ed9b1b232961b0feae2a47f2aedf38a31d6842 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 12:06:02 +0800 Subject: [PATCH 44/89] linux: Move '-g' to brightray --- common.gypi | 19 ------------------- vendor/brightray | 2 +- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/common.gypi b/common.gypi index 9b2abe4b42d..dfbc980615d 100644 --- a/common.gypi +++ b/common.gypi @@ -214,24 +214,5 @@ }, }, }], # 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', - ], - }], - ], - }], - ], - }, - }], ], } diff --git a/vendor/brightray b/vendor/brightray index c735889888f..6832cc458a1 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit c735889888f8632e3dd9693e00a7988654baf7fd +Subproject commit 6832cc458a1ccbd547682998fcc62e58d789af11 From 97c76c19c40e9fefa8f98692650d44b6cf6646f1 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 13:21:33 +0800 Subject: [PATCH 45/89] win: Register msdia80.dll in dump-symbols.py --- script/dump-symbols.py | 11 +++++++++-- tools/win/generate_breakpad_symbols.py | 6 ------ 2 files changed, 9 insertions(+), 8 deletions(-) mode change 100644 => 100755 tools/win/generate_breakpad_symbols.py diff --git a/script/dump-symbols.py b/script/dump-symbols.py index e8df27fdd2b..9ac6782943b 100755 --- a/script/dump-symbols.py +++ b/script/dump-symbols.py @@ -15,6 +15,8 @@ CHROMIUM_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', def main(destination): + register_required_dll() + rm_rf(destination) (project_name, product_name) = get_names_from_gyp() @@ -44,13 +46,18 @@ def main(destination): args = [ '--symbols-dir={0}'.format(destination), '--jobs=16', - OUT_DIR, - CHROMIUM_DIR, + os.path.relpath(OUT_DIR), ] execute([sys.executable, generate_breakpad_symbols] + args) +def register_required_dll(): + register = os.path.join(SOURCE_ROOT, 'tools', 'win', + 'register_msdia80_dll.js') + execute(['node.exe', os.path.relpath(register)]); + + def get_names_from_gyp(): gyp = os.path.join(SOURCE_ROOT, 'atom.gyp') with open(gyp) as f: diff --git a/tools/win/generate_breakpad_symbols.py b/tools/win/generate_breakpad_symbols.py old mode 100644 new mode 100755 index f69c30c712a..a294d8c5e58 --- a/tools/win/generate_breakpad_symbols.py +++ b/tools/win/generate_breakpad_symbols.py @@ -47,11 +47,6 @@ def mkdir_p(path): else: raise -def RegisterRequiredDll(): - register = os.path.join(os.path.dirname(__file__), 'register_msdia80_dll.js') - subprocess.check_call(['node.exe', register]); - - def GenerateSymbols(options, binaries): """Dumps the symbols of binary and places them in the given directory.""" @@ -124,7 +119,6 @@ def main(): pdbs += glob.glob(os.path.join(directory, '*.exe.pdb')) pdbs += glob.glob(os.path.join(directory, '*.dll.pdb')) - RegisterRequiredDll(); GenerateSymbols(options, pdbs) return 0 From 2d6b6e4578bf2f75ba481c5b0f3136b2757ec1bf Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 14:10:28 +0800 Subject: [PATCH 46/89] win: No more chromiumcontent.dll.pdb --- script/upload-windows-pdb.py | 1 - 1 file changed, 1 deletion(-) diff --git a/script/upload-windows-pdb.py b/script/upload-windows-pdb.py index 99dc4101342..c9a5f279c31 100755 --- a/script/upload-windows-pdb.py +++ b/script/upload-windows-pdb.py @@ -11,7 +11,6 @@ SYMBOLS_DIR = 'dist\\symbols' DOWNLOAD_DIR = 'vendor\\brightray\\vendor\\download\\libchromiumcontent' PDB_LIST = [ 'out\\R\\atom.exe.pdb', - DOWNLOAD_DIR + '\\R\\chromiumcontent.dll.pdb', ] From dcae08c128fcab874134a2f84f1d005e34b49d14 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 14:27:05 +0800 Subject: [PATCH 47/89] win: Move common configs to gyp --- atom.gyp | 9 +++++++++ common.gypi | 29 ----------------------------- vendor/brightray | 2 +- 3 files changed, 10 insertions(+), 30 deletions(-) diff --git a/atom.gyp b/atom.gyp index b874b09cf04..c564f8190e7 100644 --- a/atom.gyp +++ b/atom.gyp @@ -106,6 +106,15 @@ ], }], # OS!="mac" ['OS=="win"', { + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalOptions': [ + # Force linking even though we have duplicate symbols between + # BoringSSL and OpenSSL. + '/FORCE:MULTIPLE', + ], + }, + }, 'copies': [ { 'variables': { diff --git a/common.gypi b/common.gypi index dfbc980615d..8f0937e64b9 100644 --- a/common.gypi +++ b/common.gypi @@ -163,35 +163,6 @@ 4819, # The file contains a character that cannot be represented in the current code page 4996, # (atlapp.h) 'GetVersionExW': was declared deprecated ], - 'msvs_settings': { - 'VCCLCompilerTool': { - # Programs that use the Standard C++ library must be compiled with C++ - # exception handling enabled. - # http://support.microsoft.com/kb/154419 - 'ExceptionHandling': 1, - }, - 'VCLinkerTool': { - 'AdditionalOptions': [ - # Force linking even though we have duplicate symbols between - # BoringSSL and OpenSSL. - '/FORCE:MULTIPLE', - # ATL 8.0 included in WDK 7.1 makes the linker to generate following - # warnings: - # - warning LNK4254: section 'ATL' (50000040) merged into - # '.rdata' (40000040) with different attributes - # - warning LNK4078: multiple 'ATL' sections found with - # different attributes - '/ignore:4254', - '/ignore:4078', - # views_chromiumcontent.lib generates this warning because it's - # symobls are defined as dllexport but used as static library: - # - warning LNK4217: locally defined symbol imported in function - # - warning LNK4049: locally defined symbol imported - '/ignore:4217', - '/ignore:4049', - ], - }, - }, }, 'conditions': [ # The breakdpad on Windows assumes Debug_x64 and Release_x64 configurations. diff --git a/vendor/brightray b/vendor/brightray index 6832cc458a1..21ab1efb09e 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 6832cc458a1ccbd547682998fcc62e58d789af11 +Subproject commit 21ab1efb09e8f7efa5591dc4c989f7012025a133 From ae9d90eaa6c3e43a88a2eaa3a25467a81e2a6bf5 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 16:00:29 +0800 Subject: [PATCH 48/89] Upgrade libchromiumcontent for win32 fix --- 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 29eafb21cdf..f14037a3795 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -4,7 +4,7 @@ import platform import sys BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent' -LIBCHROMIUMCONTENT_COMMIT = '26fdb337d01f56d3ec24254887eb5c20db1096c7' +LIBCHROMIUMCONTENT_COMMIT = '60350899df1f7058c9026a239820d0519edb19cc' ARCH = { 'cygwin': '32bit', From a400bb59973cc9c606c53c83c2699783667d438a Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 20:58:11 +0800 Subject: [PATCH 49/89] Build node as shared library --- atom.gyp | 53 +++++++++++++++++++++++++++++++++++-------- common.gypi | 23 +++---------------- script/create-dist.py | 2 ++ vendor/brightray | 2 +- vendor/node | 2 +- 5 files changed, 51 insertions(+), 31 deletions(-) diff --git a/atom.gyp b/atom.gyp index c564f8190e7..649e7079a98 100644 --- a/atom.gyp +++ b/atom.gyp @@ -120,9 +120,16 @@ 'variables': { 'conditions': [ ['libchromiumcontent_component', { - 'copied_libraries': '<(libchromiumcontent_shared_libraries)', + 'copied_libraries': [ + '<(PRODUCT_DIR)/node.dll' + '<@(libchromiumcontent_shared_libraries)', + '<@(libchromiumcontent_shared_v8_libraries)', + ], }, { - 'copied_libraries': ['<(libchromiumcontent_dir)/boringssl.dll'], + 'copied_libraries': [ + '<(PRODUCT_DIR)/node.dll' + '<(libchromiumcontent_dir)/boringssl.dll' + ], }], ], }, @@ -159,9 +166,16 @@ 'variables': { 'conditions': [ ['libchromiumcontent_component', { - 'copied_libraries': '<(libchromiumcontent_shared_libraries)', + 'copied_libraries': [ + '<(PRODUCT_DIR)/libnode.so' + '<@(libchromiumcontent_shared_libraries)', + '<@(libchromiumcontent_shared_v8_libraries)', + ], }, { - 'copied_libraries': ['<(libchromiumcontent_dir)/libboringssl.so'], + 'copied_libraries': [ + '<(PRODUCT_DIR)/libnode.so' + '<(libchromiumcontent_dir)/libboringssl.so' + ], }], ], }, @@ -192,7 +206,6 @@ 'atom_coffee2c', 'vendor/brightray/brightray.gyp:brightray', 'vendor/node/node.gyp:node', - 'vendor/node/deps/openssl/openssl.gyp:openssl', ], 'defines': [ 'PRODUCT_NAME="<(product_name)"', @@ -221,11 +234,11 @@ 'vendor/node/deps/http_parser', 'vendor/node/deps/uv/include', # The `node.h` is using `#include"v8.h"`. - 'vendor/brightray/vendor/download/libchromiumcontent/src/v8/include', + '<(libchromiumcontent_src_dir)/v8/include', # The `node.h` is using `#include"ares.h"`. 'vendor/node/deps/cares/include', # The `third_party/WebKit/Source/platform/weborigin/SchemeRegistry.h` is using `platform/PlatformExport.h`. - 'vendor/brightray/vendor/download/libchromiumcontent/src/third_party/WebKit/Source', + '<(libchromiumcontent_src_dir)/third_party/WebKit/Source', ], 'direct_dependent_settings': { 'include_dirs': [ @@ -236,6 +249,11 @@ 'vendor/brightray/brightray.gyp:brightray', ], 'conditions': [ + ['libchromiumcontent_component', { + 'link_settings': { + 'libraries': [ '<@(libchromiumcontent_v8_libraries)' ], + }, + }], ['OS=="win"', { 'sources': [ '<@(lib_sources_win)', @@ -398,9 +416,16 @@ 'variables': { 'conditions': [ ['libchromiumcontent_component', { - 'copied_libraries': '<(libchromiumcontent_shared_libraries)', + 'copied_libraries': [ + '<(PRODUCT_DIR)/libnode.dylib', + '<@(libchromiumcontent_shared_libraries)', + '<@(libchromiumcontent_shared_v8_libraries)', + ], }, { - 'copied_libraries': ['<(libchromiumcontent_dir)/libboringssl.dylib'], + 'copied_libraries': [ + '<(PRODUCT_DIR)/libnode.dylib', + '<(libchromiumcontent_dir)/libboringssl.dylib' + ], }], ], }, @@ -429,6 +454,16 @@ '${BUILT_PRODUCTS_DIR}/<(product_name) Framework.framework/Versions/A/<(product_name) Framework', ], }, + { + 'postbuild_name': 'Fix path of libnode', + 'action': [ + 'install_name_tool', + '-change', + '/usr/local/lib/libnode.dylib', + '@rpath/libnode.dylib', + '${BUILT_PRODUCTS_DIR}/<(product_name) Framework.framework/Versions/A/<(product_name) Framework', + ], + }, { 'postbuild_name': 'Add symlinks for framework subdirectories', 'action': [ diff --git a/common.gypi b/common.gypi index 8f0937e64b9..087cd335d1c 100644 --- a/common.gypi +++ b/common.gypi @@ -14,7 +14,7 @@ 'node_shared_cares': 'false', 'node_shared_http_parser': 'false', 'node_shared_libuv': 'false', - 'node_shared_openssl': 'true', + 'node_shared_openssl': 'false', 'node_shared_v8': 'true', 'node_shared_zlib': 'false', 'node_tag': '', @@ -92,30 +92,13 @@ '-Wno-unused-value', '-Wno-deprecated-declarations', '-Wno-return-type', - # Fix relocation error when compiling as shared library. - '-fPIC', ], }], ], }], - ['_target_name in ["node", "atom_lib"]', { - 'include_dirs': [ - '<(libchromiumcontent_src_dir)/v8/include', - 'vendor/node/deps/openssl/openssl/include', - ], - }], ['_target_name=="node"', { - 'conditions': [ - ['OS=="mac"', { - 'libraries': [ '-undefined dynamic_lookup' ], - 'xcode_settings': { - 'DYLIB_INSTALL_NAME_BASE': '@rpath' - }, - }], - ['OS=="linux"', { - 'cflags': [ '-fPIC' ], - }], - ] + 'include_dirs': [ '<(libchromiumcontent_src_dir)/v8/include' ], + 'libraries': [ '<@(libchromiumcontent_v8_libraries)' ], }], ['_target_name=="libuv"', { 'conditions': [ diff --git a/script/create-dist.py b/script/create-dist.py index c2dc4645f2d..e345ed06ca5 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -33,6 +33,7 @@ TARGET_BINARIES = { 'icudtl.dat', 'libEGL.dll', 'libGLESv2.dll', + 'node.dll', 'content_resources_200_percent.pak', 'ui_resources_200_percent.pak', 'xinput1_3.dll', @@ -46,6 +47,7 @@ TARGET_BINARIES = { 'libboringssl.so', 'libffmpegsumo.so', 'natives_blob.bin', + 'libnode.so', 'snapshot_blob.bin', ], } diff --git a/vendor/brightray b/vendor/brightray index 21ab1efb09e..1b62aab98e1 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 21ab1efb09e8f7efa5591dc4c989f7012025a133 +Subproject commit 1b62aab98e1e79f6357bd156fc2a43068d4a3f49 diff --git a/vendor/node b/vendor/node index b1cd6a5f5e0..bf5162b9042 160000 --- a/vendor/node +++ b/vendor/node @@ -1 +1 @@ -Subproject commit b1cd6a5f5e0b18e666c1a27794c4f77992a96bb7 +Subproject commit bf5162b9042ff3e626a1adbd56b547801fda8cbf From 5f2fe27b65686a8a69071f0639ce86b00876a4b3 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 10 Apr 2015 12:07:53 +0800 Subject: [PATCH 50/89] linux: Fix linking with node and v8 --- atom.gyp | 10 ++++------ common.gypi | 15 ++++++++++++++- script/dump-symbols.py | 3 ++- script/lib/config.py | 2 +- vendor/brightray | 2 +- vendor/node | 2 +- 6 files changed, 23 insertions(+), 11 deletions(-) diff --git a/atom.gyp b/atom.gyp index 649e7079a98..e4efefd6260 100644 --- a/atom.gyp +++ b/atom.gyp @@ -121,14 +121,12 @@ 'conditions': [ ['libchromiumcontent_component', { 'copied_libraries': [ - '<(PRODUCT_DIR)/node.dll' '<@(libchromiumcontent_shared_libraries)', '<@(libchromiumcontent_shared_v8_libraries)', ], }, { 'copied_libraries': [ - '<(PRODUCT_DIR)/node.dll' - '<(libchromiumcontent_dir)/boringssl.dll' + '<(libchromiumcontent_dir)/boringssl.dll', ], }], ], @@ -167,14 +165,14 @@ 'conditions': [ ['libchromiumcontent_component', { 'copied_libraries': [ - '<(PRODUCT_DIR)/libnode.so' + '<(PRODUCT_DIR)/lib/libnode.so', '<@(libchromiumcontent_shared_libraries)', '<@(libchromiumcontent_shared_v8_libraries)', ], }, { 'copied_libraries': [ - '<(PRODUCT_DIR)/libnode.so' - '<(libchromiumcontent_dir)/libboringssl.so' + '<(PRODUCT_DIR)/lib/libnode.so', + '<(libchromiumcontent_dir)/libboringssl.so', ], }], ], diff --git a/common.gypi b/common.gypi index 087cd335d1c..e33555b2140 100644 --- a/common.gypi +++ b/common.gypi @@ -92,13 +92,26 @@ '-Wno-unused-value', '-Wno-deprecated-declarations', '-Wno-return-type', + # Required when building as shared library. + '-fPIC', ], }], ], }], ['_target_name=="node"', { 'include_dirs': [ '<(libchromiumcontent_src_dir)/v8/include' ], - 'libraries': [ '<@(libchromiumcontent_v8_libraries)' ], + 'conditions': [ + ['OS=="linux" and libchromiumcontent_component==0', { + # Prevent the linker to strip symbols. + 'ldflags': [ + '-Wl,--whole-archive', + '<@(libchromiumcontent_v8_libraries)', + '-Wl,--no-whole-archive', + ], + }, { + 'libraries': [ '<@(libchromiumcontent_v8_libraries)' ], + }], + ], }], ['_target_name=="libuv"', { 'conditions': [ diff --git a/script/dump-symbols.py b/script/dump-symbols.py index 9ac6782943b..10471517b69 100755 --- a/script/dump-symbols.py +++ b/script/dump-symbols.py @@ -15,7 +15,8 @@ CHROMIUM_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', def main(destination): - register_required_dll() + if TARGET_PLATFORM == 'win32': + register_required_dll() rm_rf(destination) (project_name, product_name) = get_names_from_gyp() diff --git a/script/lib/config.py b/script/lib/config.py index f14037a3795..9663480154e 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -4,7 +4,7 @@ import platform import sys BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent' -LIBCHROMIUMCONTENT_COMMIT = '60350899df1f7058c9026a239820d0519edb19cc' +LIBCHROMIUMCONTENT_COMMIT = '0718fa8b44e004a39ee2511858abbef1dae89cef' ARCH = { 'cygwin': '32bit', diff --git a/vendor/brightray b/vendor/brightray index 1b62aab98e1..0f37e5fa4d5 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 1b62aab98e1e79f6357bd156fc2a43068d4a3f49 +Subproject commit 0f37e5fa4d5273f80c91d485e0ce6edef683a26e diff --git a/vendor/node b/vendor/node index bf5162b9042..561969a65ff 160000 --- a/vendor/node +++ b/vendor/node @@ -1 +1 @@ -Subproject commit bf5162b9042ff3e626a1adbd56b547801fda8cbf +Subproject commit 561969a65ff36c2df94326664813f46b7c5803b1 From 8500a53c238229476479302bb2d86f64d6a40380 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 10 Apr 2015 13:24:05 +0800 Subject: [PATCH 51/89] mac: Improve how we find .dSYM bundle --- tools/posix/generate_breakpad_symbols.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/posix/generate_breakpad_symbols.py b/tools/posix/generate_breakpad_symbols.py index 88cae88fe8c..d3f98d4d794 100755 --- a/tools/posix/generate_breakpad_symbols.py +++ b/tools/posix/generate_breakpad_symbols.py @@ -61,8 +61,10 @@ def FindBundlePart(full_path): def GetDSYMBundle(options, binary_path): """Finds the .dSYM bundle to the binary.""" - if not binary_path.endswith(' Framework'): - return binary_path + if os.path.isabs(binary_path): + dsym_path = binary_path + '.dSYM' + if os.path.exists(dsym_path): + return dsym_path filename = FindBundlePart(binary_path) search_dirs = [options.build_dir, options.libchromiumcontent_dir] From 8894cfab5023872a5f79f08fdea7de31eda5be8c Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 10 Apr 2015 13:24:58 +0800 Subject: [PATCH 52/89] mac: Fix libicu symbols not included --- common.gypi | 7 ++++++- script/create-dist.py | 2 +- vendor/node | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/common.gypi b/common.gypi index e33555b2140..8dc91f692f6 100644 --- a/common.gypi +++ b/common.gypi @@ -101,8 +101,13 @@ ['_target_name=="node"', { 'include_dirs': [ '<(libchromiumcontent_src_dir)/v8/include' ], 'conditions': [ + ['OS=="mac" and libchromiumcontent_component==0', { + 'xcode_settings': { + 'OTHER_LDFLAGS': [ '-Wl,-all_load' ], + }, + }], ['OS=="linux" and libchromiumcontent_component==0', { - # Prevent the linker to strip symbols. + # Prevent the linker from stripping symbols. 'ldflags': [ '-Wl,--whole-archive', '<@(libchromiumcontent_v8_libraries)', diff --git a/script/create-dist.py b/script/create-dist.py index e345ed06ca5..e957725d817 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -46,8 +46,8 @@ TARGET_BINARIES = { 'icudtl.dat', 'libboringssl.so', 'libffmpegsumo.so', - 'natives_blob.bin', 'libnode.so', + 'natives_blob.bin', 'snapshot_blob.bin', ], } diff --git a/vendor/node b/vendor/node index 561969a65ff..df87e874a7b 160000 --- a/vendor/node +++ b/vendor/node @@ -1 +1 @@ -Subproject commit 561969a65ff36c2df94326664813f46b7c5803b1 +Subproject commit df87e874a7b9a72628b442a306028dcffc107fec From 3a5bb588e5efe216356bed5b4ba61bd30b5524a6 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 10 Apr 2015 15:20:45 +0800 Subject: [PATCH 53/89] No more need to reference node's symbols --- atom/common/node_bindings.cc | 23 ----------------------- atom/common/node_includes.h | 2 ++ vendor/node | 2 +- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/atom/common/node_bindings.cc b/atom/common/node_bindings.cc index a021e92b857..1ff9c1685c4 100644 --- a/atom/common/node_bindings.cc +++ b/atom/common/node_bindings.cc @@ -27,29 +27,6 @@ using content::BrowserThread; #define REFERENCE_MODULE(name) \ extern "C" void _register_ ## name(void); \ void (*fp_register_ ## name)(void) = _register_ ## name -// Node's builtin modules. -REFERENCE_MODULE(cares_wrap); -REFERENCE_MODULE(fs_event_wrap); -REFERENCE_MODULE(buffer); -REFERENCE_MODULE(contextify); -REFERENCE_MODULE(crypto); -REFERENCE_MODULE(fs); -REFERENCE_MODULE(http_parser); -REFERENCE_MODULE(os); -REFERENCE_MODULE(v8); -REFERENCE_MODULE(zlib); -REFERENCE_MODULE(pipe_wrap); -REFERENCE_MODULE(process_wrap); -REFERENCE_MODULE(signal_wrap); -REFERENCE_MODULE(smalloc); -REFERENCE_MODULE(spawn_sync); -REFERENCE_MODULE(tcp_wrap); -REFERENCE_MODULE(timer_wrap); -REFERENCE_MODULE(tls_wrap); -REFERENCE_MODULE(tty_wrap); -REFERENCE_MODULE(udp_wrap); -REFERENCE_MODULE(uv); -REFERENCE_MODULE(js_stream); // Atom Shell's builtin modules. REFERENCE_MODULE(atom_browser_app); REFERENCE_MODULE(atom_browser_auto_updater); diff --git a/atom/common/node_includes.h b/atom/common/node_includes.h index 80567cbd49b..0c4189b2fac 100644 --- a/atom/common/node_includes.h +++ b/atom/common/node_includes.h @@ -7,6 +7,8 @@ // Include common headers for using node APIs. +#define BUILDING_NODE_EXTENSION + #undef ASSERT #undef CHECK #undef CHECK_EQ diff --git a/vendor/node b/vendor/node index df87e874a7b..da4d745446f 160000 --- a/vendor/node +++ b/vendor/node @@ -1 +1 @@ -Subproject commit df87e874a7b9a72628b442a306028dcffc107fec +Subproject commit da4d745446fcc63bfc205477703533712dd01e2c From 1f66006c9318c90e028b2092897cfb63b9c3c41d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 10 Apr 2015 15:35:25 +0800 Subject: [PATCH 54/89] win: Fix link errors caused by libicu --- atom/common/node_bindings.cc | 8 ++++++++ common.gypi | 23 +++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/atom/common/node_bindings.cc b/atom/common/node_bindings.cc index 1ff9c1685c4..ef74459b1c0 100644 --- a/atom/common/node_bindings.cc +++ b/atom/common/node_bindings.cc @@ -52,6 +52,14 @@ REFERENCE_MODULE(atom_renderer_ipc); REFERENCE_MODULE(atom_renderer_web_frame); #undef REFERENCE_MODULE +// The "v8::Function::kLineOffsetNotFound" is exported in node.dll, but the +// linker can not find it, could be a bug of VS. +#if defined(OS_WIN) && !defined(DEBUG) +namespace v8 { +const int Function::kLineOffsetNotFound = -1; +} +#endif + namespace atom { namespace { diff --git a/common.gypi b/common.gypi index 8dc91f692f6..dd0b95859d4 100644 --- a/common.gypi +++ b/common.gypi @@ -102,10 +102,33 @@ 'include_dirs': [ '<(libchromiumcontent_src_dir)/v8/include' ], 'conditions': [ ['OS=="mac" and libchromiumcontent_component==0', { + # -all_load is the "whole-archive" on OS X. 'xcode_settings': { 'OTHER_LDFLAGS': [ '-Wl,-all_load' ], }, }], + ['OS=="win" and libchromiumcontent_component==0', { + 'libraries': [ '-lwinmm.lib' ], + 'msvs_settings': { + 'VCLinkerTool': { + # There is nothing like "whole-archive" on Windows, so we + # have to manually force some objets files to be included + # by referencing them. + 'ForceSymbolReferences': [ + '_u_errorName_52', + '_ubidi_setPara_52', + '_ucsdet_getName_52', + '_ulocdata_close_52', + '_uregex_matches_52', + '_uscript_getCode_52', + '_usearch_setPattern_52', + '?createInstance@Transliterator@icu_52@@SAPAV12@ABVUnicodeString@2@W4UTransDirection@@AAW4UErrorCode@@@Z', + '?nameToUnicodeUTF8@IDNA@icu_52@@UBEXABVStringPiece@2@AAVByteSink@2@AAVIDNAInfo@2@AAW4UErrorCode@@@Z', + '?kLineOffsetNotFound@Function@v8@@2HB', + ], # '/INCLUDE' + }, + }, + }], ['OS=="linux" and libchromiumcontent_component==0', { # Prevent the linker from stripping symbols. 'ldflags': [ From a13343800a99f9a5a891f10886fa3e8896bf6f54 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 10 Apr 2015 15:45:45 +0800 Subject: [PATCH 55/89] win: Generate node.lib from node.dll --- script/upload-node-headers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/upload-node-headers.py b/script/upload-node-headers.py index 5b452363618..7add94b3342 100755 --- a/script/upload-node-headers.py +++ b/script/upload-node-headers.py @@ -112,7 +112,7 @@ def upload_node(bucket, access_key, secret_key, version): if TARGET_PLATFORM == 'win32': # Copy atom.lib to node.lib node_lib = os.path.join(OUT_DIR, 'node.lib') - atom_lib = os.path.join(OUT_DIR, 'atom.lib') + atom_lib = os.path.join(OUT_DIR, 'node.dll.lib') shutil.copy2(atom_lib, node_lib) # Upload the 32bit node.lib. From 88b6a60c29075333092dcfa63535ac61195f47f0 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 10 Apr 2015 17:56:46 +0800 Subject: [PATCH 56/89] Hide symbols of openssl So we will avoid conflicts with boringssl. --- common.gypi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/common.gypi b/common.gypi index dd0b95859d4..847c4bb3822 100644 --- a/common.gypi +++ b/common.gypi @@ -141,6 +141,22 @@ }], ], }], + ['_target_name=="openssl"', { + 'xcode_settings': { + 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip + 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', + 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', + }, + 'cflags': [ + '-fvisibility=hidden', + '-fdata-sections', + '-ffunction-sections', + ], + 'ldflags': [ + '-Wl,--as-needed', + '-Wl,--gc-sections', + ], + }], ['_target_name=="libuv"', { 'conditions': [ ['OS=="win"', { From dfa6fedaedfa12dd3c510f149af95c5a7e55f9f0 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 10 Apr 2015 19:00:06 +0800 Subject: [PATCH 57/89] Don't link with shared_librayr of boringssl in Release mode --- atom.gyp | 16 +--------------- script/create-dist.py | 20 +++----------------- script/lib/config.py | 2 +- vendor/brightray | 2 +- 4 files changed, 6 insertions(+), 34 deletions(-) diff --git a/atom.gyp b/atom.gyp index e4efefd6260..ed09e23686c 100644 --- a/atom.gyp +++ b/atom.gyp @@ -125,9 +125,7 @@ '<@(libchromiumcontent_shared_v8_libraries)', ], }, { - 'copied_libraries': [ - '<(libchromiumcontent_dir)/boringssl.dll', - ], + 'copied_libraries': [], }], ], }, @@ -172,7 +170,6 @@ }, { 'copied_libraries': [ '<(PRODUCT_DIR)/lib/libnode.so', - '<(libchromiumcontent_dir)/libboringssl.so', ], }], ], @@ -422,7 +419,6 @@ }, { 'copied_libraries': [ '<(PRODUCT_DIR)/libnode.dylib', - '<(libchromiumcontent_dir)/libboringssl.dylib' ], }], ], @@ -442,16 +438,6 @@ }, ], 'postbuilds': [ - { - 'postbuild_name': 'Fix path of libboringssl', - 'action': [ - 'install_name_tool', - '-change', - '/usr/local/lib/libboringssl.dylib', - '@rpath/libboringssl.dylib', - '${BUILT_PRODUCTS_DIR}/<(product_name) Framework.framework/Versions/A/<(product_name) Framework', - ], - }, { 'postbuild_name': 'Fix path of libnode', 'action': [ diff --git a/script/create-dist.py b/script/create-dist.py index e957725d817..faa04038b1e 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -26,7 +26,6 @@ TARGET_BINARIES = { ], 'win32': [ 'atom.exe', - 'boringssl.dll', 'content_shell.pak', 'd3dcompiler_47.dll', 'ffmpegsumo.dll', @@ -44,7 +43,6 @@ TARGET_BINARIES = { 'atom', 'content_shell.pak', 'icudtl.dat', - 'libboringssl.so', 'libffmpegsumo.so', 'libnode.so', 'natives_blob.bin', @@ -118,16 +116,6 @@ def copy_chromedriver(): shutil.copyfile(src, dest) os.chmod(dest, os.stat(dest).st_mode | stat.S_IEXEC) - # Fix the linking with boringssl. - if TARGET_PLATFORM == 'linux': - execute(['chrpath', '-r', '$ORIGIN', dest]) - elif TARGET_PLATFORM == 'darwin': - shutil.copy2(os.path.join(CHROMIUM_DIR, 'libboringssl.dylib'), DIST_DIR) - execute(['install_name_tool', '-change', - '/usr/local/lib/libboringssl.dylib', - '@loader_path/libboringssl.dylib', - dest]) - def copy_license(): shutil.copy2(os.path.join(SOURCE_ROOT, 'LICENSE'), DIST_DIR) @@ -186,11 +174,9 @@ def create_chromedriver_zip(): with scoped_cwd(DIST_DIR): files = ['LICENSE'] if TARGET_PLATFORM == 'win32': - files += ['chromedriver.exe', 'boringssl.dll'] - elif TARGET_PLATFORM == 'darwin': - files += ['chromedriver', 'libboringssl.dylib'] - elif TARGET_PLATFORM == 'linux': - files += ['chromedriver', 'libboringssl.so'] + files += ['chromedriver.exe'] + else: + files += ['chromedriver'] make_zip(zip_file, files, []) diff --git a/script/lib/config.py b/script/lib/config.py index 9663480154e..388ca02fffa 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -4,7 +4,7 @@ import platform import sys BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent' -LIBCHROMIUMCONTENT_COMMIT = '0718fa8b44e004a39ee2511858abbef1dae89cef' +LIBCHROMIUMCONTENT_COMMIT = 'f1ad1412461ba3345a27cfe935ffc872dba0ac5b' ARCH = { 'cygwin': '32bit', diff --git a/vendor/brightray b/vendor/brightray index 0f37e5fa4d5..14b4dc7151d 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 0f37e5fa4d5273f80c91d485e0ce6edef683a26e +Subproject commit 14b4dc7151ded676d7133f0da17033149a4954df From 21ca4de1affdc79042a078d566c302880da78160 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 10 Apr 2015 21:56:02 +0800 Subject: [PATCH 58/89] docs: Output dir is changed --- docs/development/build-instructions-linux.md | 4 ++-- docs/development/build-instructions-mac.md | 4 ++-- docs/development/build-instructions-windows.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/development/build-instructions-linux.md b/docs/development/build-instructions-linux.md index 03e870a42f6..eba2c4b0f2d 100644 --- a/docs/development/build-instructions-linux.md +++ b/docs/development/build-instructions-linux.md @@ -55,10 +55,10 @@ $ ./script/build.py You can also only build the `Debug` target: ```bash -$ ./script/build.py -c Debug +$ ./script/build.py -c D ``` -After building is done, you can find `atom` under `out/Debug`. +After building is done, you can find `atom` under `out/D`. ## Troubleshooting diff --git a/docs/development/build-instructions-mac.md b/docs/development/build-instructions-mac.md index ebc5876a74e..3d35b84d3b7 100644 --- a/docs/development/build-instructions-mac.md +++ b/docs/development/build-instructions-mac.md @@ -39,10 +39,10 @@ $ ./script/build.py You can also only build the `Debug` target: ```bash -$ ./script/build.py -c Debug +$ ./script/build.py -c D ``` -After building is done, you can find `Atom.app` under `out/Debug`. +After building is done, you can find `Atom.app` under `out/D`. ## 32bit support diff --git a/docs/development/build-instructions-windows.md b/docs/development/build-instructions-windows.md index 1b4bf5282a6..ece557e0a83 100644 --- a/docs/development/build-instructions-windows.md +++ b/docs/development/build-instructions-windows.md @@ -49,10 +49,10 @@ python script\build.py You can also only build the Debug target: ```powershell -python script\build.py -c Debug +python script\build.py -c D ``` -After building is done, you can find `atom.exe` under `out\Debug`. +After building is done, you can find `atom.exe` under `out\D`. ## 64bit support From ab94c3f49e8b9387fc7e331e5db7739947c3204a Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 11 Apr 2015 12:11:40 +0800 Subject: [PATCH 59/89] docs: Add "Build system overview" chapter --- docs/README.md | 1 + docs/development/build-system-overview.md | 64 +++++++++++++++++++++++ vendor/brightray | 2 +- 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 docs/development/build-system-overview.md diff --git a/docs/README.md b/docs/README.md index e9ceda79bdf..34688848b35 100644 --- a/docs/README.md +++ b/docs/README.md @@ -59,6 +59,7 @@ Modules for both processes: * [Coding style](development/coding-style.md) * [Source code directory structure](development/source-code-directory-structure.md) * [Technical differences to NW.js (formerly node-webkit)](development/atom-shell-vs-node-webkit.md) +* [Build system overview](development/build-system-overview.md) * [Build instructions (Mac)](development/build-instructions-mac.md) * [Build instructions (Windows)](development/build-instructions-windows.md) * [Build instructions (Linux)](development/build-instructions-linux.md) diff --git a/docs/development/build-system-overview.md b/docs/development/build-system-overview.md new file mode 100644 index 00000000000..b15950001e5 --- /dev/null +++ b/docs/development/build-system-overview.md @@ -0,0 +1,64 @@ +# Build system overview + +Atom Shell uses `gyp` for project generation, and `ninja` for building, project +configurations can be found in `.gyp` and `.gypi` files. + +## Gyp files + +Following `gyp` files contain the main rules of building Atom Shell: + +* `atom.gyp` defines how Atom Shell itself is built. +* `common.gypi` adjusts the build configurations of Node to make it build + together with Chromium. +* `vendor/brightray/brightray.gyp` defines how `brightray` is built, and + includes the default configurations of linking with Chromium. +* `vendor/brightray/brightray.gypi` includes general build configurations about + building. + +## Component build + +Since Chromium is a quite large project, the final linking stage would take +quite a few minutes, making it hard for development. In order to solve this, +Chromium introduces the "component build", which builds each component as a +separate shared library, so linking can be very quick, in sacrifice of file size +and performance. + +In Atom Shell we took a very similar approach: for `Debug` build, the binary +will be linked to shared library version of Chromium's components to achieve +fast linking time; for `Release` build, the binary will be linked to the static +library versions, so we can have best binary size and performance. + +## Minimal bootstrapping + +All the Chromium's prebuilt binaries are downloaded when running the bootstrap +script, by default both static libraries and shared libraries will be +downloaded, and the final size is between 800MB to 2GB according to the +platform. + +If you only want to build Atom Shell quickly for testing or development, you +can only download the shared library versions by passing the `--dev` parameter: + +```bash +$ ./script/boostrap.by --dev +$ ./script/build.by -c D +``` + +## Two-phrase project generation + +Atom Shell links with different sets of libraries in `Release` and `Debug` +builds, however `gyp` doesn't support configuring different link settings for +different configurations. + +To work around this Atom Shell uses a `gyp` variable +`libchromiumcontent_component` to control which link settings to use, and only +generates one target when running `gyp`. + +## Target names + +Unlike most projects that use `Release` and `Debug` as target names, Atom Shell +uses `R` and `D` instead. This is because `gyp` randomly crashes if there is +only one `Release` or `Debug` build configuration is defined, and Atom Shell has +to only generate one target for one time as stated above. + +This only affects developers, if you are only building Atom Shell for rebranding +you are not affected. diff --git a/vendor/brightray b/vendor/brightray index 14b4dc7151d..9b4018b24a1 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 14b4dc7151ded676d7133f0da17033149a4954df +Subproject commit 9b4018b24a1812fb2a073ff297f103f0df319db1 From 4defde0b6130585355543125292e6a5d515355f7 Mon Sep 17 00:00:00 2001 From: Joshua Bemenderfer Date: Sat, 11 Apr 2015 12:46:13 +0800 Subject: [PATCH 60/89] Fix spelling and grammar errors. Particularly in the spelling of the bootstrap and build script names. That threw me off a bit. --- docs/development/build-system-overview.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/development/build-system-overview.md b/docs/development/build-system-overview.md index b15950001e5..c2a29cf5ebc 100644 --- a/docs/development/build-system-overview.md +++ b/docs/development/build-system-overview.md @@ -17,30 +17,30 @@ Following `gyp` files contain the main rules of building Atom Shell: ## Component build -Since Chromium is a quite large project, the final linking stage would take +Since Chromium is quite a large project, the final linking stage would take quite a few minutes, making it hard for development. In order to solve this, -Chromium introduces the "component build", which builds each component as a -separate shared library, so linking can be very quick, in sacrifice of file size +Chromium introduced the "component build", which builds each component as a +separate shared library, making linking very quick but sacrificing file size and performance. -In Atom Shell we took a very similar approach: for `Debug` build, the binary +In Atom Shell we took a very similar approach: for `Debug` builds, the binary will be linked to shared library version of Chromium's components to achieve -fast linking time; for `Release` build, the binary will be linked to the static -library versions, so we can have best binary size and performance. +fast linking time; for `Release` builds, the binary will be linked to the static +library versions, so we can have the best possible binary size and performance. ## Minimal bootstrapping -All the Chromium's prebuilt binaries are downloaded when running the bootstrap -script, by default both static libraries and shared libraries will be -downloaded, and the final size is between 800MB to 2GB according to the +All of Chromium's prebuilt binaries are downloaded when running the bootstrap +script. By default both static libraries and shared libraries will be +downloaded and the final size should be between 800MB and 2GB according to the platform. If you only want to build Atom Shell quickly for testing or development, you can only download the shared library versions by passing the `--dev` parameter: ```bash -$ ./script/boostrap.by --dev -$ ./script/build.by -c D +$ ./script/bootstrap.py --dev +$ ./script/build.py -c D ``` ## Two-phrase project generation From f997dbb01d96e55a6c57f92b4445636e8b274efe Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 11 Apr 2015 13:07:19 +0800 Subject: [PATCH 61/89] Remove some duplicated symbols --- common.gypi | 6 ------ 1 file changed, 6 deletions(-) diff --git a/common.gypi b/common.gypi index 847c4bb3822..912c6773a74 100644 --- a/common.gypi +++ b/common.gypi @@ -149,12 +149,6 @@ }, 'cflags': [ '-fvisibility=hidden', - '-fdata-sections', - '-ffunction-sections', - ], - 'ldflags': [ - '-Wl,--as-needed', - '-Wl,--gc-sections', ], }], ['_target_name=="libuv"', { From 3a59cd3b722ef99ff343f54301b649a50fab9ab6 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 11 Apr 2015 13:38:16 +0800 Subject: [PATCH 62/89] Upgrade brightray --- vendor/brightray | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/brightray b/vendor/brightray index 9b4018b24a1..f2b33daa4ea 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 9b4018b24a1812fb2a073ff297f103f0df319db1 +Subproject commit f2b33daa4ea5a1e1ba0a5b18a3f0470d99b6f962 From ca50cbb5ffe874db17604591fcc52605325ca96f Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 11 Apr 2015 16:59:44 +0800 Subject: [PATCH 63/89] Allow specifying the arch of libchromiumcontent to download --- .gitignore | 1 + script/bootstrap.py | 18 ++++++++++++------ vendor/brightray | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 4410f3035be..b18292e6ab0 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ node_modules/ *.xcodeproj *.swp *.pyc +debug.log npm-debug.log diff --git a/script/bootstrap.py b/script/bootstrap.py index caf23ed5018..ececbb6eae9 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -4,7 +4,7 @@ import argparse import os import sys -from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, \ +from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, TARGET_PLATFORM, \ enable_verbose_mode, is_verbose_mode from lib.util import execute_stdout, scoped_cwd @@ -19,8 +19,7 @@ def main(): os.chdir(SOURCE_ROOT) args = parse_args() - if (args.yes is False and - sys.platform not in ('win32', 'cygwin')): + if not args.yes and TARGET_PLATFORM != 'win32': check_root() if args.verbose: enable_verbose_mode() @@ -28,7 +27,7 @@ def main(): update_win32_python() update_submodules() update_node_modules('.') - bootstrap_brightray(args.dev, args.url) + bootstrap_brightray(args.dev, args.url, args.target_arch) create_chrome_version_h() touch_config_gypi() @@ -53,8 +52,11 @@ def parse_args(): action='store_true', help='Run non-interactively by assuming "yes" to all ' \ 'prompts.') + parser.add_argument('--target_arch', default='default', + help='Manually specify the arch to build for') return parser.parse_args() + def check_root(): if os.geteuid() == 0: print "We suggest not running this as root, unless you're really sure." @@ -68,9 +70,13 @@ def update_submodules(): execute_stdout(['git', 'submodule', 'update', '--init', '--recursive']) -def bootstrap_brightray(is_dev, url): +def bootstrap_brightray(is_dev, url, target_arch): bootstrap = os.path.join(VENDOR_DIR, 'brightray', 'script', 'bootstrap') - args = ['--commit', LIBCHROMIUMCONTENT_COMMIT, url] + args = [ + '--commit', LIBCHROMIUMCONTENT_COMMIT, + '--target_arch', target_arch, + url, + ] if is_dev: args = ['--dev'] + args execute_stdout([sys.executable, bootstrap] + args) diff --git a/vendor/brightray b/vendor/brightray index f2b33daa4ea..f44a3834690 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit f2b33daa4ea5a1e1ba0a5b18a3f0470d99b6f962 +Subproject commit f44a3834690c010a1841cde92ca5e4798b1c9d2f From 1a6832d84996542129d0cb48370aaccd8404983f Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 11 Apr 2015 17:30:52 +0800 Subject: [PATCH 64/89] TARGET_PLATFORM => PLATFORM TARGET_PLATFORM is quite misleading since it is actually host platform. --- script/bootstrap.py | 4 ++-- script/create-dist.py | 26 +++++++++++++------------- script/dump-symbols.py | 8 ++++---- script/lib/config.py | 2 +- script/upload-node-headers.py | 4 ++-- script/upload.py | 14 +++++++------- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/script/bootstrap.py b/script/bootstrap.py index ececbb6eae9..5dd2488902e 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -4,7 +4,7 @@ import argparse import os import sys -from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, TARGET_PLATFORM, \ +from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \ enable_verbose_mode, is_verbose_mode from lib.util import execute_stdout, scoped_cwd @@ -19,7 +19,7 @@ def main(): os.chdir(SOURCE_ROOT) args = parse_args() - if not args.yes and TARGET_PLATFORM != 'win32': + if not args.yes and PLATFORM != 'win32': check_root() if args.verbose: enable_verbose_mode() diff --git a/script/create-dist.py b/script/create-dist.py index faa04038b1e..4d1ae544c1b 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -7,7 +7,7 @@ import subprocess import sys import stat -from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, TARGET_PLATFORM, \ +from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \ DIST_ARCH from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \ execute, get_chromedriver_version @@ -79,7 +79,7 @@ def main(): copy_chromedriver() copy_license() - if TARGET_PLATFORM == 'linux': + if PLATFORM == 'linux': strip_binaries() copy_system_libraries() @@ -95,17 +95,17 @@ def force_build(): def copy_binaries(): - for binary in TARGET_BINARIES[TARGET_PLATFORM]: + for binary in TARGET_BINARIES[PLATFORM]: shutil.copy2(os.path.join(OUT_DIR, binary), DIST_DIR) - for directory in TARGET_DIRECTORIES[TARGET_PLATFORM]: + for directory in TARGET_DIRECTORIES[PLATFORM]: shutil.copytree(os.path.join(OUT_DIR, directory), os.path.join(DIST_DIR, directory), symlinks=True) def copy_chromedriver(): - if TARGET_PLATFORM == 'win32': + if PLATFORM == 'win32': chromedriver = 'chromedriver.exe' else: chromedriver = 'chromedriver' @@ -122,7 +122,7 @@ def copy_license(): def strip_binaries(): - for binary in TARGET_BINARIES[TARGET_PLATFORM]: + for binary in TARGET_BINARIES[PLATFORM]: if binary.endswith('.so') or '.' not in binary: execute(['strip', os.path.join(DIST_DIR, binary)]) @@ -155,25 +155,25 @@ def create_symbols(): def create_dist_zip(): dist_name = 'atom-shell-{0}-{1}-{2}.zip'.format(ATOM_SHELL_VERSION, - TARGET_PLATFORM, DIST_ARCH) + PLATFORM, DIST_ARCH) zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name) with scoped_cwd(DIST_DIR): - files = TARGET_BINARIES[TARGET_PLATFORM] + ['LICENSE', 'version'] - if TARGET_PLATFORM == 'linux': + files = TARGET_BINARIES[PLATFORM] + ['LICENSE', 'version'] + if PLATFORM == 'linux': files += [lib for lib in SYSTEM_LIBRARIES if os.path.exists(lib)] - dirs = TARGET_DIRECTORIES[TARGET_PLATFORM] + dirs = TARGET_DIRECTORIES[PLATFORM] make_zip(zip_file, files, dirs) def create_chromedriver_zip(): dist_name = 'chromedriver-{0}-{1}-{2}.zip'.format(get_chromedriver_version(), - TARGET_PLATFORM, DIST_ARCH) + PLATFORM, DIST_ARCH) zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name) with scoped_cwd(DIST_DIR): files = ['LICENSE'] - if TARGET_PLATFORM == 'win32': + if PLATFORM == 'win32': files += ['chromedriver.exe'] else: files += ['chromedriver'] @@ -182,7 +182,7 @@ def create_chromedriver_zip(): def create_symbols_zip(): dist_name = 'atom-shell-{0}-{1}-{2}-symbols.zip'.format(ATOM_SHELL_VERSION, - TARGET_PLATFORM, + PLATFORM, DIST_ARCH) zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name) diff --git a/script/dump-symbols.py b/script/dump-symbols.py index 10471517b69..ccad30227ba 100755 --- a/script/dump-symbols.py +++ b/script/dump-symbols.py @@ -3,7 +3,7 @@ import os import sys -from lib.config import TARGET_PLATFORM +from lib.config import PLATFORM from lib.util import execute, rm_rf @@ -15,20 +15,20 @@ CHROMIUM_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', def main(destination): - if TARGET_PLATFORM == 'win32': + if PLATFORM == 'win32': register_required_dll() rm_rf(destination) (project_name, product_name) = get_names_from_gyp() - if TARGET_PLATFORM in ['darwin', 'linux']: + if PLATFORM in ['darwin', 'linux']: # Generate the dump_syms tool. build = os.path.join(SOURCE_ROOT, 'script', 'build.py') execute([sys.executable, build, '-c', 'R', '-t', 'dump_syms']) generate_breakpad_symbols = os.path.join(SOURCE_ROOT, 'tools', 'posix', 'generate_breakpad_symbols.py') - if TARGET_PLATFORM == 'darwin': + if PLATFORM == 'darwin': start = os.path.join(OUT_DIR, '{0}.app'.format(product_name), 'Contents', 'MacOS', product_name) else: diff --git a/script/lib/config.py b/script/lib/config.py index 388ca02fffa..2c2a7eda41a 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -17,7 +17,7 @@ DIST_ARCH = { '64bit': 'x64', }[ARCH] -TARGET_PLATFORM = { +PLATFORM = { 'cygwin': 'win32', 'darwin': 'darwin', 'linux2': 'linux', diff --git a/script/upload-node-headers.py b/script/upload-node-headers.py index 7add94b3342..a971af78e5f 100755 --- a/script/upload-node-headers.py +++ b/script/upload-node-headers.py @@ -7,7 +7,7 @@ import shutil import sys import tarfile -from lib.config import TARGET_PLATFORM +from lib.config import PLATFORM from lib.util import execute, safe_mkdir, scoped_cwd, s3_config, s3put @@ -109,7 +109,7 @@ def upload_node(bucket, access_key, secret_key, version): s3put(bucket, access_key, secret_key, DIST_DIR, 'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz')) - if TARGET_PLATFORM == 'win32': + if PLATFORM == 'win32': # Copy atom.lib to node.lib node_lib = os.path.join(OUT_DIR, 'node.lib') atom_lib = os.path.join(OUT_DIR, 'node.dll.lib') diff --git a/script/upload.py b/script/upload.py index 677247a2e6e..0c2b2ba6a32 100755 --- a/script/upload.py +++ b/script/upload.py @@ -7,7 +7,7 @@ import subprocess import sys import tempfile -from lib.config import DIST_ARCH, TARGET_PLATFORM +from lib.config import DIST_ARCH, PLATFORM from lib.util import execute, get_atom_shell_version, parse_version, \ get_chromedriver_version, scoped_cwd from lib.github import GitHub @@ -21,13 +21,13 @@ SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R') DIST_DIR = os.path.join(SOURCE_ROOT, 'dist') DIST_NAME = 'atom-shell-{0}-{1}-{2}.zip'.format(ATOM_SHELL_VERSION, - TARGET_PLATFORM, + PLATFORM, DIST_ARCH) SYMBOLS_NAME = 'atom-shell-{0}-{1}-{2}-symbols.zip'.format(ATOM_SHELL_VERSION, - TARGET_PLATFORM, + PLATFORM, DIST_ARCH) CHROMEDRIVER_NAME = 'chromedriver-{0}-{1}-{2}.zip'.format(CHROMEDRIVER_VERSION, - TARGET_PLATFORM, + PLATFORM, DIST_ARCH) @@ -58,7 +58,7 @@ def main(): os.path.join(DIST_DIR, CHROMEDRIVER_NAME)) if args.publish_release: - if TARGET_PLATFORM == 'win32': + if PLATFORM == 'win32': # Upload PDBs to Windows symbol server. execute([sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-windows-pdb.py')]) @@ -83,10 +83,10 @@ def parse_args(): def get_atom_shell_build_version(): - if TARGET_PLATFORM == 'darwin': + if PLATFORM == 'darwin': atom_shell = os.path.join(SOURCE_ROOT, 'out', 'R', 'Atom.app', 'Contents', 'MacOS', 'Atom') - elif TARGET_PLATFORM == 'win32': + elif PLATFORM == 'win32': atom_shell = os.path.join(SOURCE_ROOT, 'out', 'R', 'atom.exe') else: atom_shell = os.path.join(SOURCE_ROOT, 'out', 'R', 'atom') From de016e72a57fb50622ace268f80310459406ae28 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 11 Apr 2015 17:58:19 +0800 Subject: [PATCH 65/89] win: Build with the arch chosen by user --- script/create-dist.py | 8 ++++---- script/lib/config.py | 38 +++++++++++++++++++++++++++----------- script/update.py | 11 ++--------- script/upload.py | 8 ++++---- vendor/brightray | 2 +- 5 files changed, 38 insertions(+), 29 deletions(-) diff --git a/script/create-dist.py b/script/create-dist.py index 4d1ae544c1b..a7ceb99f6ee 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -8,7 +8,7 @@ import sys import stat from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \ - DIST_ARCH + get_target_arch from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \ execute, get_chromedriver_version @@ -155,7 +155,7 @@ def create_symbols(): def create_dist_zip(): dist_name = 'atom-shell-{0}-{1}-{2}.zip'.format(ATOM_SHELL_VERSION, - PLATFORM, DIST_ARCH) + PLATFORM, get_target_arch()) zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name) with scoped_cwd(DIST_DIR): @@ -168,7 +168,7 @@ def create_dist_zip(): def create_chromedriver_zip(): dist_name = 'chromedriver-{0}-{1}-{2}.zip'.format(get_chromedriver_version(), - PLATFORM, DIST_ARCH) + PLATFORM, get_target_arch()) zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name) with scoped_cwd(DIST_DIR): @@ -183,7 +183,7 @@ def create_chromedriver_zip(): def create_symbols_zip(): dist_name = 'atom-shell-{0}-{1}-{2}-symbols.zip'.format(ATOM_SHELL_VERSION, PLATFORM, - DIST_ARCH) + get_target_arch()) zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name) with scoped_cwd(DIST_DIR): diff --git a/script/lib/config.py b/script/lib/config.py index 2c2a7eda41a..250c362206b 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -1,22 +1,13 @@ #!/usr/bin/env python +import os import platform import sys + BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent' LIBCHROMIUMCONTENT_COMMIT = 'f1ad1412461ba3345a27cfe935ffc872dba0ac5b' -ARCH = { - 'cygwin': '32bit', - 'darwin': '64bit', - 'linux2': platform.architecture()[0], - 'win32': '32bit', -}[sys.platform] -DIST_ARCH = { - '32bit': 'ia32', - '64bit': 'x64', -}[ARCH] - PLATFORM = { 'cygwin': 'win32', 'darwin': 'darwin', @@ -26,10 +17,35 @@ PLATFORM = { verbose_mode = False + +def get_target_arch(): + # Always build 64bit on OS X. + if PLATFORM == 'darwin': + return 'x64' + # Only build for host's arch on Linux. + elif PLATFORM == 'linux': + if platform.architecture()[0] == '32bit': + return 'ia32' + else: + return 'x64' + # On Windows it depends on user. + elif PLATFORM == 'win32': + target_arch_path = os.path.join(__file__, '..', '..', '..', 'vendor', + 'brightray', 'vendor', 'download', + 'libchromiumcontent', '.target_arch') + with open(os.path.normpath(target_arch_path)) as f: + target_arch = f.read().strip() + return target_arch + # Maybe we will support other platforms in future. + else: + return 'x64' + + def enable_verbose_mode(): print 'Running in verbose mode' global verbose_mode verbose_mode = True + def is_verbose_mode(): return verbose_mode diff --git a/script/update.py b/script/update.py index ba3380d67c3..aaa07526c05 100755 --- a/script/update.py +++ b/script/update.py @@ -4,7 +4,7 @@ import os import subprocess import sys -from lib.config import DIST_ARCH +from lib.config import get_target_arch SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) @@ -23,14 +23,6 @@ def update_external_binaries(): def update_gyp(): - target_arch = DIST_ARCH - if sys.platform == 'darwin': - # Only have 64bit build on OS X. - target_arch = 'x64' - elif sys.platform in ['cygwin', 'win32']: - # Only have 32bit build on Windows. - target_arch = 'ia32' - # Since gyp doesn't support specify link_settings for each configuration, # we are not able to link to different libraries in "Debug" and "Release" # configurations. @@ -38,6 +30,7 @@ def update_gyp(): # for twice, one is to generate "Debug" config, the other one to generate # the "Release" config. And the settings are controlled by the variable # "libchromiumcontent_component" which is defined before running gyp. + target_arch = get_target_arch() return (run_gyp(target_arch, 0) or run_gyp(target_arch, 1)) diff --git a/script/upload.py b/script/upload.py index 0c2b2ba6a32..81fd28f58e0 100755 --- a/script/upload.py +++ b/script/upload.py @@ -7,7 +7,7 @@ import subprocess import sys import tempfile -from lib.config import DIST_ARCH, PLATFORM +from lib.config import PLATFORM, get_target_arch from lib.util import execute, get_atom_shell_version, parse_version, \ get_chromedriver_version, scoped_cwd from lib.github import GitHub @@ -22,13 +22,13 @@ OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R') DIST_DIR = os.path.join(SOURCE_ROOT, 'dist') DIST_NAME = 'atom-shell-{0}-{1}-{2}.zip'.format(ATOM_SHELL_VERSION, PLATFORM, - DIST_ARCH) + get_target_arch()) SYMBOLS_NAME = 'atom-shell-{0}-{1}-{2}-symbols.zip'.format(ATOM_SHELL_VERSION, PLATFORM, - DIST_ARCH) + get_target_arch()) CHROMEDRIVER_NAME = 'chromedriver-{0}-{1}-{2}.zip'.format(CHROMEDRIVER_VERSION, PLATFORM, - DIST_ARCH) + get_target_arch()) def main(): diff --git a/vendor/brightray b/vendor/brightray index f44a3834690..33367e86d33 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit f44a3834690c010a1841cde92ca5e4798b1c9d2f +Subproject commit 33367e86d33f2ba8bf3d9dc796b469e6d5855e20 From 6175380bc0f229eb55a14372391562f97db3c3e8 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 11 Apr 2015 18:26:15 +0800 Subject: [PATCH 66/89] Explicit set default arch --- script/bootstrap.py | 4 ++-- script/lib/config.py | 18 ++++++++++++------ vendor/brightray | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/script/bootstrap.py b/script/bootstrap.py index 5dd2488902e..4ca7526b7c6 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -5,7 +5,7 @@ import os import sys from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \ - enable_verbose_mode, is_verbose_mode + enable_verbose_mode, is_verbose_mode, get_target_arch from lib.util import execute_stdout, scoped_cwd @@ -52,7 +52,7 @@ def parse_args(): action='store_true', help='Run non-interactively by assuming "yes" to all ' \ 'prompts.') - parser.add_argument('--target_arch', default='default', + parser.add_argument('--target_arch', default=get_target_arch(), help='Manually specify the arch to build for') return parser.parse_args() diff --git a/script/lib/config.py b/script/lib/config.py index 250c362206b..a45822aa172 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -1,5 +1,6 @@ #!/usr/bin/env python +import errno import os import platform import sys @@ -30,12 +31,17 @@ def get_target_arch(): return 'x64' # On Windows it depends on user. elif PLATFORM == 'win32': - target_arch_path = os.path.join(__file__, '..', '..', '..', 'vendor', - 'brightray', 'vendor', 'download', - 'libchromiumcontent', '.target_arch') - with open(os.path.normpath(target_arch_path)) as f: - target_arch = f.read().strip() - return target_arch + try: + target_arch_path = os.path.join(__file__, '..', '..', '..', 'vendor', + 'brightray', 'vendor', 'download', + 'libchromiumcontent', '.target_arch') + with open(os.path.normpath(target_arch_path)) as f: + return f.read().strip() + except IOError as e: + if e.errno != errno.ENOENT: + raise + # Build 32bit by default. + return 'ia32' # Maybe we will support other platforms in future. else: return 'x64' diff --git a/vendor/brightray b/vendor/brightray index 33367e86d33..d88754641e6 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 33367e86d33f2ba8bf3d9dc796b469e6d5855e20 +Subproject commit d88754641e6905eeb8a62b102323369645768b53 From f32cd5a35e88302de8dda280ba88ead8ff87c45e Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 11 Apr 2015 19:17:03 +0800 Subject: [PATCH 67/89] win: Suppress size loss warnings --- common.gypi | 1 + vendor/brightray | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common.gypi b/common.gypi index 912c6773a74..39d9e04b400 100644 --- a/common.gypi +++ b/common.gypi @@ -192,6 +192,7 @@ 4005, # (node.h) macro redefinition 4189, # local variable is initialized but not referenced 4201, # (uv.h) nameless struct/union + 4267, # conversion from 'size_t' to 'int', possible loss of data 4503, # decorated name length exceeded, name was truncated 4800, # (v8.h) forcing value to bool 'true' or 'false' 4819, # The file contains a character that cannot be represented in the current code page diff --git a/vendor/brightray b/vendor/brightray index d88754641e6..081d3c1d3bd 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit d88754641e6905eeb8a62b102323369645768b53 +Subproject commit 081d3c1d3bd2585ac2fc6ee77e6a0d547bc2f98f From aa07d5e55725018b62b716953d0c94dd4d28ccd7 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 11 Apr 2015 19:51:11 +0800 Subject: [PATCH 68/89] win: Fix linking problem on x64 --- common.gypi | 63 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 20 deletions(-) diff --git a/common.gypi b/common.gypi index 39d9e04b400..4ae5e9e77c0 100644 --- a/common.gypi +++ b/common.gypi @@ -107,27 +107,50 @@ 'OTHER_LDFLAGS': [ '-Wl,-all_load' ], }, }], - ['OS=="win" and libchromiumcontent_component==0', { + ['OS=="win"', { 'libraries': [ '-lwinmm.lib' ], - 'msvs_settings': { - 'VCLinkerTool': { - # There is nothing like "whole-archive" on Windows, so we - # have to manually force some objets files to be included - # by referencing them. - 'ForceSymbolReferences': [ - '_u_errorName_52', - '_ubidi_setPara_52', - '_ucsdet_getName_52', - '_ulocdata_close_52', - '_uregex_matches_52', - '_uscript_getCode_52', - '_usearch_setPattern_52', - '?createInstance@Transliterator@icu_52@@SAPAV12@ABVUnicodeString@2@W4UTransDirection@@AAW4UErrorCode@@@Z', - '?nameToUnicodeUTF8@IDNA@icu_52@@UBEXABVStringPiece@2@AAVByteSink@2@AAVIDNAInfo@2@AAW4UErrorCode@@@Z', - '?kLineOffsetNotFound@Function@v8@@2HB', - ], # '/INCLUDE' - }, - }, + 'conditions': [ + ['libchromiumcontent_component==0', { + 'variables': { + 'conditions': [ + ['target_arch=="ia32"', { + 'reference_symbols': [ + '_u_errorName_52', + '_ubidi_setPara_52', + '_ucsdet_getName_52', + '_ulocdata_close_52', + '_uregex_matches_52', + '_uscript_getCode_52', + '_usearch_setPattern_52', + '?createInstance@Transliterator@icu_52@@SAPAV12@ABVUnicodeString@2@W4UTransDirection@@AAW4UErrorCode@@@Z', + '?nameToUnicodeUTF8@IDNA@icu_52@@UBEXABVStringPiece@2@AAVByteSink@2@AAVIDNAInfo@2@AAW4UErrorCode@@@Z', + '?kLineOffsetNotFound@Function@v8@@2HB', + ], + }, { + 'reference_symbols': [ + 'u_errorName_52', + 'ubidi_setPara_52', + 'ucsdet_getName_52', + 'uidna_openUTS46_52', + 'ulocdata_close_52', + 'uregex_matches_52', + 'uscript_getCode_52', + 'usearch_setPattern_52', + '?createInstance@Transliterator@icu_52@@SAPEAV12@AEBVUnicodeString@2@W4UTransDirection@@AEAW4UErrorCode@@@Z' + ], + }], + ], + }, + 'msvs_settings': { + 'VCLinkerTool': { + # There is nothing like "whole-archive" on Windows, so we + # have to manually force some objets files to be included + # by referencing them. + 'ForceSymbolReferences': [ '<@(reference_symbols)' ], # '/INCLUDE' + }, + }, + }], + ], }], ['OS=="linux" and libchromiumcontent_component==0', { # Prevent the linker from stripping symbols. From 9e7c2a6fe493143ff195acfe55ec9809570052e2 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 11 Apr 2015 20:15:31 +0800 Subject: [PATCH 69/89] spec: Suppress crash-reporter test on 64bit Windows --- spec/api-crash-reporter-spec.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/api-crash-reporter-spec.coffee b/spec/api-crash-reporter-spec.coffee index c9aa025ca38..3d78c3a6a36 100644 --- a/spec/api-crash-reporter-spec.coffee +++ b/spec/api-crash-reporter-spec.coffee @@ -17,6 +17,9 @@ describe 'crash-reporter module', -> beforeEach -> w = new BrowserWindow(show: false) afterEach -> w.destroy() + # It is not working on 64bit Windows. + return if process.platform is 'win32' and process.arch is 'x64 + it 'should send minidump when renderer crashes', (done) -> @timeout 60000 server = http.createServer (req, res) -> From b5450801d075cb3da87414fb651a28dea5cf9ce9 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 11 Apr 2015 22:15:50 +0800 Subject: [PATCH 70/89] win: Upload node.dll.pdb --- script/upload-windows-pdb.py | 1 + 1 file changed, 1 insertion(+) diff --git a/script/upload-windows-pdb.py b/script/upload-windows-pdb.py index c9a5f279c31..b76fb7a0993 100755 --- a/script/upload-windows-pdb.py +++ b/script/upload-windows-pdb.py @@ -11,6 +11,7 @@ SYMBOLS_DIR = 'dist\\symbols' DOWNLOAD_DIR = 'vendor\\brightray\\vendor\\download\\libchromiumcontent' PDB_LIST = [ 'out\\R\\atom.exe.pdb', + 'out\\R\\node.dll.pdb', ] From 03bdd8814ed7035df07596f4ce26d85e18c2f0c1 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 11 Apr 2015 23:03:54 +0800 Subject: [PATCH 71/89] Fix typo --- spec/api-crash-reporter-spec.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/api-crash-reporter-spec.coffee b/spec/api-crash-reporter-spec.coffee index 3d78c3a6a36..0e844036477 100644 --- a/spec/api-crash-reporter-spec.coffee +++ b/spec/api-crash-reporter-spec.coffee @@ -18,7 +18,7 @@ describe 'crash-reporter module', -> afterEach -> w.destroy() # It is not working on 64bit Windows. - return if process.platform is 'win32' and process.arch is 'x64 + return if process.platform is 'win32' and process.arch is 'x64' it 'should send minidump when renderer crashes', (done) -> @timeout 60000 From fabaa2af94baf7807719caff3e47b43af3c579ec Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 11 Apr 2015 23:28:59 +0800 Subject: [PATCH 72/89] Upgrade breakpad and brightray --- vendor/breakpad | 2 +- vendor/brightray | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/breakpad b/vendor/breakpad index 1e937567e92..4427c117038 160000 --- a/vendor/breakpad +++ b/vendor/breakpad @@ -1 +1 @@ -Subproject commit 1e937567e92d2c3beed4556f3c68a4b0362b1e6d +Subproject commit 4427c1170387afe46eb3fad259436f1f9f5efa86 diff --git a/vendor/brightray b/vendor/brightray index 081d3c1d3bd..80a002c4a23 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 081d3c1d3bd2585ac2fc6ee77e6a0d547bc2f98f +Subproject commit 80a002c4a239f347cc4e0eea7378054977520726 From c30d8068370baeb602f940d34f04ad291a938d2c Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 11 Apr 2015 23:40:10 +0800 Subject: [PATCH 73/89] win: Upload node.lib of x64 build --- script/upload-node-headers.py | 27 ++++++++++----------------- script/upload.py | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 27 deletions(-) diff --git a/script/upload-node-headers.py b/script/upload-node-headers.py index a971af78e5f..ce327700732 100755 --- a/script/upload-node-headers.py +++ b/script/upload-node-headers.py @@ -7,7 +7,7 @@ import shutil import sys import tarfile -from lib.config import PLATFORM +from lib.config import PLATFORM, get_target_arch from lib.util import execute, safe_mkdir, scoped_cwd, s3_config, s3put @@ -110,19 +110,19 @@ def upload_node(bucket, access_key, secret_key, version): 'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz')) if PLATFORM == 'win32': + target_arch = get_target_arch() + if target_arch == 'ia32': + node_lib = os.path.join(DIST_DIR, 'node.lib') + else: + node_lib = os.path.join(DIST_DIR, 'x64', 'node.lib') + safe_mkdir(os.path.dirname(node_lib)) + # Copy atom.lib to node.lib - node_lib = os.path.join(OUT_DIR, 'node.lib') atom_lib = os.path.join(OUT_DIR, 'node.dll.lib') shutil.copy2(atom_lib, node_lib) - # Upload the 32bit node.lib. - s3put(bucket, access_key, secret_key, OUT_DIR, - 'atom-shell/dist/{0}'.format(version), [node_lib]) - - # Upload the fake 64bit node.lib. - touch_x64_node_lib() - node_lib = os.path.join(OUT_DIR, 'x64', 'node.lib') - s3put(bucket, access_key, secret_key, OUT_DIR, + # Upload the node.lib. + s3put(bucket, access_key, secret_key, DIST_DIR, 'atom-shell/dist/{0}'.format(version), [node_lib]) # Upload the index.json @@ -136,12 +136,5 @@ def upload_node(bucket, access_key, secret_key, version): [index_json]) -def touch_x64_node_lib(): - x64_dir = os.path.join(OUT_DIR, 'x64') - safe_mkdir(x64_dir) - with open(os.path.join(x64_dir, 'node.lib'), 'w+') as node_lib: - node_lib.write('Invalid library') - - if __name__ == '__main__': sys.exit(main()) diff --git a/script/upload.py b/script/upload.py index 81fd28f58e0..4b9c0d4b608 100755 --- a/script/upload.py +++ b/script/upload.py @@ -57,17 +57,17 @@ def main(): upload_atom_shell(github, release_id, os.path.join(DIST_DIR, CHROMEDRIVER_NAME)) + if PLATFORM == 'win32': + # Upload PDBs to Windows symbol server. + execute([sys.executable, + os.path.join(SOURCE_ROOT, 'script', 'upload-windows-pdb.py')]) + + # Upload node headers. + execute([sys.executable, + os.path.join(SOURCE_ROOT, 'script', 'upload-node-headers.py'), + '-v', ATOM_SHELL_VERSION]) + if args.publish_release: - if PLATFORM == 'win32': - # Upload PDBs to Windows symbol server. - execute([sys.executable, - os.path.join(SOURCE_ROOT, 'script', 'upload-windows-pdb.py')]) - - # Upload node headers. - execute([sys.executable, - os.path.join(SOURCE_ROOT, 'script', 'upload-node-headers.py'), - '-v', ATOM_SHELL_VERSION]) - # Press the publish button. publish_release(github, release_id) From 8a418ba3473604ede7d903995e5b4cdfaae415ac Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 12 Apr 2015 00:01:10 +0800 Subject: [PATCH 74/89] Upload SHASUMS.txt when publishing release --- script/upload-node-headers.py | 10 ++-------- script/upload.py | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/script/upload-node-headers.py b/script/upload-node-headers.py index ce327700732..a2b9894382d 100755 --- a/script/upload-node-headers.py +++ b/script/upload-node-headers.py @@ -47,11 +47,6 @@ def main(): bucket, access_key, secret_key = s3_config() upload_node(bucket, access_key, secret_key, args.version) - # Upload the SHASUMS.txt. - execute([sys.executable, - os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'), - '-v', args.version]) - def parse_args(): parser = argparse.ArgumentParser(description='upload sumsha file') @@ -110,8 +105,7 @@ def upload_node(bucket, access_key, secret_key, version): 'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz')) if PLATFORM == 'win32': - target_arch = get_target_arch() - if target_arch == 'ia32': + if get_target_arch() == 'ia32': node_lib = os.path.join(DIST_DIR, 'node.lib') else: node_lib = os.path.join(DIST_DIR, 'x64', 'node.lib') @@ -125,7 +119,7 @@ def upload_node(bucket, access_key, secret_key, version): s3put(bucket, access_key, secret_key, DIST_DIR, 'atom-shell/dist/{0}'.format(version), [node_lib]) - # Upload the index.json + # Upload the index.json. with scoped_cwd(SOURCE_ROOT): atom_shell = os.path.join(OUT_DIR, 'atom.exe') index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json')) diff --git a/script/upload.py b/script/upload.py index 4b9c0d4b608..692d506be2f 100755 --- a/script/upload.py +++ b/script/upload.py @@ -46,9 +46,22 @@ def main(): sys.stderr.flush() return 1 - # Upload atom-shell with GitHub Releases API. github = GitHub(auth_token()) release_id = create_or_get_release_draft(github, args.version) + + if args.publish_release: + # Upload the SHASUMS.txt. + execute([sys.executable, + os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'), + '-v', ATOM_SHELL_VERSION]) + + # Press the publish button. + publish_release(github, release_id) + + # Do not upload other files when passed "-p". + return + + # Upload atom-shell with GitHub Releases API. upload_atom_shell(github, release_id, os.path.join(DIST_DIR, DIST_NAME)) upload_atom_shell(github, release_id, os.path.join(DIST_DIR, SYMBOLS_NAME)) @@ -67,10 +80,6 @@ def main(): os.path.join(SOURCE_ROOT, 'script', 'upload-node-headers.py'), '-v', ATOM_SHELL_VERSION]) - if args.publish_release: - # Press the publish button. - publish_release(github, release_id) - def parse_args(): parser = argparse.ArgumentParser(description='upload distribution file') From f64a3dd349f3b0dd6fdc1057a2033bb3edde8b29 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 12 Apr 2015 00:02:45 +0800 Subject: [PATCH 75/89] Add win32-ia32 in index.json --- script/dump-version-info.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/dump-version-info.js b/script/dump-version-info.js index 165c4a8cd0a..c49f7588ad3 100644 --- a/script/dump-version-info.js +++ b/script/dump-version-info.js @@ -43,6 +43,8 @@ function getInfoForCurrentVersion() { 'linux-x64-symbols', 'win32-ia32', 'win32-ia32-symbols', + 'win32-x64', + 'win32-x64-symbols', ]; return json; From 6b1f2215b2117778bc10128f1a5ed30bb8235313 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 12 Apr 2015 11:23:41 +0800 Subject: [PATCH 76/89] win: Do not copy vc runtime dlls We now statically link with vc runtime. --- atom.gyp | 2 -- 1 file changed, 2 deletions(-) diff --git a/atom.gyp b/atom.gyp index ed09e23686c..5f54b0f3ca7 100644 --- a/atom.gyp +++ b/atom.gyp @@ -142,8 +142,6 @@ '<(libchromiumcontent_dir)/natives_blob.bin', '<(libchromiumcontent_dir)/snapshot_blob.bin', 'external_binaries/d3dcompiler_47.dll', - 'external_binaries/msvcp120.dll', - 'external_binaries/msvcr120.dll', 'external_binaries/vccorlib120.dll', 'external_binaries/xinput1_3.dll', ], From aa835ad38a03090eaa29ba701e22afcbcb8c1707 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 12 Apr 2015 11:36:55 +0800 Subject: [PATCH 77/89] Upload index.json when publishing release --- script/upload-index-json.py | 31 ++++++++++++++++++++++++++ script/upload-node-headers.py | 10 --------- script/upload.py | 4 ++++ {script => tools}/dump-version-info.js | 0 4 files changed, 35 insertions(+), 10 deletions(-) create mode 100755 script/upload-index-json.py rename {script => tools}/dump-version-info.js (100%) diff --git a/script/upload-index-json.py b/script/upload-index-json.py new file mode 100755 index 00000000000..52f441b7019 --- /dev/null +++ b/script/upload-index-json.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +import os +import sys + +from lib.config import PLATFORM +from lib.util import execute, s3_config, s3put, scoped_cwd + + +SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) +OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R') + + +def main(): + # Upload the index.json. + with scoped_cwd(SOURCE_ROOT): + atom_shell = os.path.join(OUT_DIR, 'atom') + if PLATFORM == 'win32': + atom_shell += '.exe' + index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json')) + execute([atom_shell, + os.path.join('tools', 'dump-version-info.js'), + index_json]) + + bucket, access_key, secret_key = s3_config() + s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist', + [index_json]) + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/script/upload-node-headers.py b/script/upload-node-headers.py index a2b9894382d..136da07d938 100755 --- a/script/upload-node-headers.py +++ b/script/upload-node-headers.py @@ -119,16 +119,6 @@ def upload_node(bucket, access_key, secret_key, version): s3put(bucket, access_key, secret_key, DIST_DIR, 'atom-shell/dist/{0}'.format(version), [node_lib]) - # Upload the index.json. - with scoped_cwd(SOURCE_ROOT): - atom_shell = os.path.join(OUT_DIR, 'atom.exe') - index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json')) - execute([atom_shell, - os.path.join('script', 'dump-version-info.js'), - index_json]) - s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist', - [index_json]) - if __name__ == '__main__': sys.exit(main()) diff --git a/script/upload.py b/script/upload.py index 692d506be2f..9cf0f04f3d7 100755 --- a/script/upload.py +++ b/script/upload.py @@ -55,6 +55,10 @@ def main(): os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'), '-v', ATOM_SHELL_VERSION]) + # Upload the index.json. + execute([sys.executable, + os.path.join(SOURCE_ROOT, 'script', 'upload-index-json.py')]) + # Press the publish button. publish_release(github, release_id) diff --git a/script/dump-version-info.js b/tools/dump-version-info.js similarity index 100% rename from script/dump-version-info.js rename to tools/dump-version-info.js From 6b1dd0d413505a9b5d03341b7215d0255898fd33 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 12 Apr 2015 12:00:02 +0800 Subject: [PATCH 78/89] s3_config should be in lib.config --- script/lib/config.py | 11 +++++++++++ script/lib/util.py | 11 ----------- script/upload-checksums.py | 3 ++- script/upload-index-json.py | 4 ++-- script/upload-node-headers.py | 4 ++-- script/upload-windows-pdb.py | 3 ++- 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/script/lib/config.py b/script/lib/config.py index a45822aa172..7fb314ac9a2 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -47,6 +47,17 @@ def get_target_arch(): return 'x64' +def s3_config(): + config = (os.environ.get('ATOM_SHELL_S3_BUCKET', ''), + os.environ.get('ATOM_SHELL_S3_ACCESS_KEY', ''), + os.environ.get('ATOM_SHELL_S3_SECRET_KEY', '')) + message = ('Error: Please set the $ATOM_SHELL_S3_BUCKET, ' + '$ATOM_SHELL_S3_ACCESS_KEY, and ' + '$ATOM_SHELL_S3_SECRET_KEY environment variables') + assert all(len(c) for c in config), message + return config + + def enable_verbose_mode(): print 'Running in verbose mode' global verbose_mode diff --git a/script/lib/util.py b/script/lib/util.py index 698da95080a..88641589859 100644 --- a/script/lib/util.py +++ b/script/lib/util.py @@ -176,17 +176,6 @@ def parse_version(version): return vs + ['0'] * (4 - len(vs)) -def s3_config(): - config = (os.environ.get('ATOM_SHELL_S3_BUCKET', ''), - os.environ.get('ATOM_SHELL_S3_ACCESS_KEY', ''), - os.environ.get('ATOM_SHELL_S3_SECRET_KEY', '')) - message = ('Error: Please set the $ATOM_SHELL_S3_BUCKET, ' - '$ATOM_SHELL_S3_ACCESS_KEY, and ' - '$ATOM_SHELL_S3_SECRET_KEY environment variables') - assert all(len(c) for c in config), message - return config - - def s3put(bucket, access_key, secret_key, prefix, key_prefix, files): args = [ 's3put', diff --git a/script/upload-checksums.py b/script/upload-checksums.py index b0378d834bc..19b6643c6d9 100755 --- a/script/upload-checksums.py +++ b/script/upload-checksums.py @@ -5,7 +5,8 @@ import hashlib import os import tempfile -from lib.util import download, rm_rf, s3_config, s3put +from lib.config import s3_config +from lib.util import download, rm_rf, s3put DIST_URL = 'https://atom.io/download/atom-shell/' diff --git a/script/upload-index-json.py b/script/upload-index-json.py index 52f441b7019..6bec55f2a98 100755 --- a/script/upload-index-json.py +++ b/script/upload-index-json.py @@ -3,8 +3,8 @@ import os import sys -from lib.config import PLATFORM -from lib.util import execute, s3_config, s3put, scoped_cwd +from lib.config import PLATFORM, s3_config +from lib.util import execute, s3put, scoped_cwd SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) diff --git a/script/upload-node-headers.py b/script/upload-node-headers.py index 136da07d938..86335b2b63d 100755 --- a/script/upload-node-headers.py +++ b/script/upload-node-headers.py @@ -7,8 +7,8 @@ import shutil import sys import tarfile -from lib.config import PLATFORM, get_target_arch -from lib.util import execute, safe_mkdir, scoped_cwd, s3_config, s3put +from lib.config import PLATFORM, get_target_arch, s3_config +from lib.util import execute, safe_mkdir, scoped_cwd, s3put SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) diff --git a/script/upload-windows-pdb.py b/script/upload-windows-pdb.py index b76fb7a0993..71c0c672dbe 100755 --- a/script/upload-windows-pdb.py +++ b/script/upload-windows-pdb.py @@ -3,7 +3,8 @@ import os import glob -from lib.util import execute, rm_rf, safe_mkdir, s3put, s3_config +from lib.config import s3_config +from lib.util import execute, rm_rf, safe_mkdir, s3put SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) From b9b7928e7dc1c6ef6ebb5a9e9a0832555f4a8051 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 12 Apr 2015 12:45:18 +0800 Subject: [PATCH 79/89] Move version info to atom.gyp and discard apm dependency Fixes #1408. Closes #1359. --- atom.gyp | 1 + package.json | 8 -------- script/bootstrap.py | 23 +++++++++++------------ script/bump-version.py | 12 ++++++------ script/dump-symbols.py | 8 +++----- script/lib/util.py | 20 ++++++++++++++------ 6 files changed, 35 insertions(+), 37 deletions(-) diff --git a/atom.gyp b/atom.gyp index 5f54b0f3ca7..a05ff617e53 100644 --- a/atom.gyp +++ b/atom.gyp @@ -2,6 +2,7 @@ 'variables': { 'project_name%': 'atom', 'product_name%': 'Atom', + 'version%': '0.22.3', 'atom_source_root': ' Date: Sun, 12 Apr 2015 12:52:07 +0800 Subject: [PATCH 80/89] Don't push when bumping version --- script/bump-version.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/script/bump-version.py b/script/bump-version.py index c256fd4228d..59ff0a73306 100755 --- a/script/bump-version.py +++ b/script/bump-version.py @@ -32,7 +32,6 @@ def main(): update_version_h(versions) update_info_plist(version) tag_version(version) - git_push() def increase_version(versions, index): @@ -118,10 +117,5 @@ def tag_version(version): execute(['git', 'tag', 'v{0}'.format(version)]) -def git_push(): - execute(['git', 'push']) - execute(['git', 'push', '--tags']) - - if __name__ == '__main__': sys.exit(main()) From b53123d5e77f7e5efe006948c299696d36e88529 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 12 Apr 2015 12:55:38 +0800 Subject: [PATCH 81/89] Add clean script --- script/clean.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 script/clean.py diff --git a/script/clean.py b/script/clean.py new file mode 100755 index 00000000000..f27ee9cbea3 --- /dev/null +++ b/script/clean.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +import os +import sys + +from lib.util import rm_rf + + +SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) + + +def main(): + os.chdir(SOURCE_ROOT) + rm_rf('node_modules') + rm_rf('out') + rm_rf('spec/node_modules') + + +if __name__ == '__main__': + sys.exit(main()) From a724d6d684c12ff01759bbb0ecce8273940a9bb6 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 12 Apr 2015 12:59:04 +0800 Subject: [PATCH 82/89] Bump v0.23.0 --- atom.gyp | 2 +- atom/browser/resources/mac/Info.plist | 2 +- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/atom.gyp b/atom.gyp index a05ff617e53..8eb93aef687 100644 --- a/atom.gyp +++ b/atom.gyp @@ -2,7 +2,7 @@ 'variables': { 'project_name%': 'atom', 'product_name%': 'Atom', - 'version%': '0.22.3', + 'version%': '0.23.0', 'atom_source_root': 'CFBundleIconFile atom.icns CFBundleVersion - 0.22.3 + 0.23.0 LSMinimumSystemVersion 10.8.0 NSMainNibFile diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index ac228c07522..adb8d85d01a 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -50,8 +50,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,22,3,0 - PRODUCTVERSION 0,22,3,0 + FILEVERSION 0,23,0,0 + PRODUCTVERSION 0,23,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Atom-Shell" - VALUE "FileVersion", "0.22.3" + VALUE "FileVersion", "0.23.0" VALUE "InternalName", "atom.exe" VALUE "LegalCopyright", "Copyright (C) 2013 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "atom.exe" VALUE "ProductName", "Atom-Shell" - VALUE "ProductVersion", "0.22.3" + VALUE "ProductVersion", "0.23.0" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index f68794dfa83..e492e424fcb 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -6,8 +6,8 @@ #define ATOM_VERSION_H #define ATOM_MAJOR_VERSION 0 -#define ATOM_MINOR_VERSION 22 -#define ATOM_PATCH_VERSION 3 +#define ATOM_MINOR_VERSION 23 +#define ATOM_PATCH_VERSION 0 #define ATOM_VERSION_IS_RELEASE 1 From d19a1063d571f3265584c6fe93c0aef20f719bba Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 12 Apr 2015 13:15:11 +0800 Subject: [PATCH 83/89] Fix pylint warnings --- script/bootstrap.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/script/bootstrap.py b/script/bootstrap.py index 2870e75ac11..ba9c0b0b1d9 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -82,7 +82,9 @@ def bootstrap_brightray(is_dev, url, target_arch): execute_stdout([sys.executable, bootstrap] + args) -def update_node_modules(dirname, env=os.environ): +def update_node_modules(dirname, env=None): + if env is None: + env = os.environ with scoped_cwd(dirname): if is_verbose_mode(): execute_stdout([NPM, 'install', '--verbose'], env) From d0f2da944fb9a6ccb8e8efaf35ac4c6e9bd3c75d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 12 Apr 2015 14:23:48 +0800 Subject: [PATCH 84/89] Add missing 'v' in some places --- script/lib/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/lib/util.py b/script/lib/util.py index 0099c6e4307..b67bb8da0da 100644 --- a/script/lib/util.py +++ b/script/lib/util.py @@ -163,7 +163,7 @@ def atom_gyp(): def get_atom_shell_version(): - return atom_gyp()['version%'] + return 'v' + atom_gyp()['version%'] def get_chromedriver_version(): From 26ac617692930c7ee5047ffb87219e30b1c96868 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 12 Apr 2015 15:27:28 +0800 Subject: [PATCH 85/89] win: vccorlib120.dll is not needed anymore --- atom.gyp | 1 - 1 file changed, 1 deletion(-) diff --git a/atom.gyp b/atom.gyp index 8eb93aef687..f516a0dd1c1 100644 --- a/atom.gyp +++ b/atom.gyp @@ -143,7 +143,6 @@ '<(libchromiumcontent_dir)/natives_blob.bin', '<(libchromiumcontent_dir)/snapshot_blob.bin', 'external_binaries/d3dcompiler_47.dll', - 'external_binaries/vccorlib120.dll', 'external_binaries/xinput1_3.dll', ], }, From f979847e06393401e0d0d6e8903c81393db2230b Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 12 Apr 2015 07:56:22 +0000 Subject: [PATCH 86/89] linux: Upgrade brightray to fix linking problem --- vendor/brightray | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/brightray b/vendor/brightray index 80a002c4a23..45ffaf46355 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 80a002c4a239f347cc4e0eea7378054977520726 +Subproject commit 45ffaf463554f489e890c24a35abd3ca2d48f36b From 1027fe99919679f42171603dec16ec2f4aa99061 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 12 Apr 2015 08:16:17 +0000 Subject: [PATCH 87/89] linux: Fix wrong off_t type under 32bit arch --- vendor/brightray | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/brightray b/vendor/brightray index 45ffaf46355..ec0a660b0b7 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 45ffaf463554f489e890c24a35abd3ca2d48f36b +Subproject commit ec0a660b0b70e6ea5a4ee760a753b8fac31a5de2 From 61100c9c0bd5ca9010fdc74a9ff572741a8a4c0e Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 12 Apr 2015 21:42:11 +0800 Subject: [PATCH 88/89] No need to store apm's version in index.json --- tools/dump-version-info.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tools/dump-version-info.js b/tools/dump-version-info.js index c49f7588ad3..e76f09ba2f9 100644 --- a/tools/dump-version-info.js +++ b/tools/dump-version-info.js @@ -17,16 +17,10 @@ function getDate() { return year + '-' + month + '-' + day; } -function getApmVersion() { - var package = require(path.resolve(__dirname, '..', 'package.json')); - return package.devDependencies['atom-package-manager']; -} - function getInfoForCurrentVersion() { var json = {}; json.version = process.versions['atom-shell']; json.date = getDate(); - json.apm = getApmVersion(); var names = ['node', 'v8', 'uv', 'zlib', 'openssl', 'modules', 'chrome'] for (var i in names) { From 159e013ce5f2854b71b9603c92c158ba1b598e9f Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 12 Apr 2015 21:46:50 +0800 Subject: [PATCH 89/89] docs: Don't mention apm It causes confusions, and it is not convineint any more, see #793. --- docs/tutorial/using-native-node-modules.md | 41 +++++----------------- 1 file changed, 8 insertions(+), 33 deletions(-) diff --git a/docs/tutorial/using-native-node-modules.md b/docs/tutorial/using-native-node-modules.md index 8c72a7f4046..fa70c376820 100644 --- a/docs/tutorial/using-native-node-modules.md +++ b/docs/tutorial/using-native-node-modules.md @@ -1,33 +1,8 @@ # Using native Node modules The native Node modules are supported by atom-shell, but since atom-shell is -using a different V8 version from official Node, you need to use `apm` instead -of `npm` to install Node modules. - -The usage of [apm](https://github.com/atom/apm) is quite similar to `npm`, to -install dependencies from `package.json` of current project, just do: - -```bash -$ cd /path/to/atom-shell/project/ -$ apm install . -``` - -But you should notice that `apm install module` won't work because it will -install a user package for [Atom Editor](https://github.com/atom/atom) instead. - -## Which version of apm to use - -Generally using the latest release of `apm` for latest atom-shell always works, -but if you are uncertain of the which version of `apm` to use, you may manually -instruct `apm` to use headers of a specified version of atom-shell by setting -the `ATOM_NODE_VERSION` environment. - -For example force installing modules for atom-shell v0.16.0: - -```bash -$ export ATOM_NODE_VERSION=0.16.0 -$ apm install . -``` +using a different V8 version from official Node, you have to manually specify +the location of atom-shell's headers when building native modules. ## Native Node module compatibility @@ -41,10 +16,7 @@ To solve this, you should use modules that support Node v0.11.x, For old modules that only support Node v0.10.x, you should use the [nan](https://github.com/rvagg/nan) module to port it to v0.11.x. -## Other ways of installing native modules - -Apart from `apm`, you can also use `node-gyp` and `npm` to manually build the -native modules. +## How to install native modules ### The node-gyp way @@ -63,9 +35,12 @@ where to download the headers. The `--arch=ia32` says the module is built for ### The npm way +You can also use `npm` to install modules, the steps are exactly the same with +Node modules, except that you need to setup some environment variables: + ```bash export npm_config_disturl=https://atom.io/download/atom-shell -export npm_config_target=0.6.0 -export npm_config_arch=ia32 +export npm_config_target=0.23.0 +export npm_config_arch=x64 HOME=~/.atom-shell-gyp npm install module-name ```