]> khamidou — GitHub mirrors - electron.git/commitdiff
fix node to build with target_arch=x64 on linux
authorDane Springmeyer <dane@mapbox.com>
Thu, 31 Jul 2014 03:51:23 +0000 (20:51 -0700)
committerDane Springmeyer <dane@mapbox.com>
Thu, 31 Jul 2014 03:51:23 +0000 (20:51 -0700)
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

index 63b7b4f721851b4377bc96aea0861769aa90e553..7c5a8893569055edaeb8790555d778c45aca0b61 100755 (executable)
@@ -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',