From 978f73756b12cd1943206fa404a8798490a9121c Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 30 Jul 2014 20:51:23 -0700 Subject: [PATCH 1/4] fix node to build with target_arch=x64 on linux atom-shell on linux is incorrectly reporting `ia32` for `process.arch`. This is happening because `-Dtarget_arch=ia32` is passed to ninja on linux inside `script/update.py` which leads to '-DARCH="ia32"' being set in the compile flags. I see that the current intention is to target 64 bit builds on linux (37275c64cd07) and the binaries are in fact compiled as 64 bit despite this bug. I guess ninja is somehow smartly ignoring the incorrect setting of the `-m32` flags at https://github.com/atom/node/blob/6d772c3cda0bb8270857397e128ea1e36c361125/common.gypi#L175-L178. Until this is fixed it breaks usage of any node-pre-gyp packaged node addons because node-pre-gyp depends on process.arch being correct in order to require the right binary arch. --- script/update.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/script/update.py b/script/update.py index 63b7b4f72185..7c5a88935690 100755 --- a/script/update.py +++ b/script/update.py @@ -23,11 +23,10 @@ def update_external_binaries(): def update_gyp(): gyp = os.path.join('vendor', 'brightray', 'vendor', 'gyp', 'gyp_main.py') python = sys.executable - if sys.platform == 'cygwin': + arch = 'x64' + if sys.platform in ['cygwin', 'win32']: python = os.path.join('vendor', 'python_26', 'python.exe') - arch = 'ia32' - if sys.platform == 'darwin': - arch = 'x64' + arch = 'ia32' subprocess.call([python, gyp, '-f', 'ninja', '--depth', '.', 'atom.gyp', '-Icommon.gypi', '-Ivendor/brightray/brightray.gypi', From 191b1aa719c0519b349cb26d7e76182521da63b0 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 31 Jul 2014 10:20:33 -0700 Subject: [PATCH 2/4] only default to 64 bit build on darwin and 64bit linux - maintains default to 32 bit on windows --- script/update.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/script/update.py b/script/update.py index 7c5a88935690..62398d9a6aff 100755 --- a/script/update.py +++ b/script/update.py @@ -23,10 +23,11 @@ def update_external_binaries(): def update_gyp(): gyp = os.path.join('vendor', 'brightray', 'vendor', 'gyp', 'gyp_main.py') python = sys.executable - arch = 'x64' + arch = 'ia32' + if sys.platform.startswith('linux') and sys.maxsize > 2**32 or sys.platform == 'darwin': + arch = 'x64' if sys.platform in ['cygwin', 'win32']: python = os.path.join('vendor', 'python_26', 'python.exe') - arch = 'ia32' subprocess.call([python, gyp, '-f', 'ninja', '--depth', '.', 'atom.gyp', '-Icommon.gypi', '-Ivendor/brightray/brightray.gypi', From 4cd3119125a68d0247fc8ff15484f3586381c9b8 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 31 Jul 2014 11:22:22 -0700 Subject: [PATCH 3/4] fix indent --- script/update.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/update.py b/script/update.py index 62398d9a6aff..61bd4e3a081e 100755 --- a/script/update.py +++ b/script/update.py @@ -25,7 +25,7 @@ def update_gyp(): python = sys.executable arch = 'ia32' if sys.platform.startswith('linux') and sys.maxsize > 2**32 or sys.platform == 'darwin': - arch = 'x64' + arch = 'x64' if sys.platform in ['cygwin', 'win32']: python = os.path.join('vendor', 'python_26', 'python.exe') subprocess.call([python, gyp, From 16428baea2aee68d0a4e45bc55ab9cbb81dc90ef Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 31 Jul 2014 11:58:45 -0700 Subject: [PATCH 4/4] make pylint happy --- script/update.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/update.py b/script/update.py index 61bd4e3a081e..807c8f79defb 100755 --- a/script/update.py +++ b/script/update.py @@ -24,9 +24,11 @@ def update_gyp(): gyp = os.path.join('vendor', 'brightray', 'vendor', 'gyp', 'gyp_main.py') python = sys.executable arch = 'ia32' - if sys.platform.startswith('linux') and sys.maxsize > 2**32 or sys.platform == 'darwin': + if sys.platform.startswith('linux') and sys.maxsize > 2**32: arch = 'x64' - if sys.platform in ['cygwin', 'win32']: + elif sys.platform == 'darwin': + arch = 'x64' + elif sys.platform in ['cygwin', 'win32']: python = os.path.join('vendor', 'python_26', 'python.exe') subprocess.call([python, gyp, '-f', 'ninja', '--depth', '.', 'atom.gyp',