vscode: Can't compile native modules due to iojs errors

  • VSCode Version: 1.26.1
  • OS Version: Arch Linux

Steps to Reproduce:

All the steps were run in a clean instalation
  1. yarn install

Output:

error /build/code/src/code/node_modules/native-keymap: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /build/code/src/code/node_modules/native-keymap
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@8.11.4 | linux | x64
gyp http GET https://atom.io/download/electron/v2.0.5/iojs-v2.0.5.tar.gz
gyp http 200 https://atom.io/download/electron/v2.0.5/iojs-v2.0.5.tar.gz
gyp http GET https://atom.io/download/electron/v2.0.5/SHASUMS256.txt
gyp http 200 https://atom.io/download/electron/v2.0.5/SHASUMS256.txt
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/usr/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/build/code/src/code/node_modules/native-keymap/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/build/.node-gyp/iojs-2.0.5/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/build/.node-gyp/iojs-2.0.5',
gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/build/.node-gyp/iojs-2.0.5/<(target_arch)/iojs.lib',
gyp info spawn args   '-Dmodule_root_dir=/build/code/src/code/node_modules/native-keymap',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/build/code/src/code/node_modules/native-keymap/build'
  CXX(target) Release/obj.target/keymapping/src/string_conversion.o
  CXX(target) Release/obj.target/keymapping/src/keymapping.o
  CXX(target) Release/obj.target/keymapping/deps/chromium/x/keysym_to_unicode.o
  CXX(target) Release/obj.target/keymapping/src/keyboard_x.o
In file included from /build/.node-gyp/iojs-2.0.5/src/node.h:63,
                 from ../src/keymapping.cc:6:
/build/.node-gyp/iojs-2.0.5/deps/v8/include/v8.h:15: error: unterminated #ifndef
 #ifndef INCLUDE_V8_H_
 
In file included from /build/.node-gyp/iojs-2.0.5/deps/v8/include/v8.h:26,
                 from /build/.node-gyp/iojs-2.0.5/src/node.h:63,
                 from ../src/keymapping.cc:6:
/build/.node-gyp/iojs-2.0.5/deps/v8/include/v8config.h:294:20: error: ‘inline’ can only be specified for functions
 # define V8_INLINE inline __attribute__((always_inline))
                    ^~~~~~
/build/.node-gyp/iojs-2.0.5/deps/v8/include/v8.h:8873:3: note: in expansion of macro ‘V8_INLINE’
   V8_INLINE static internal::Object* IntToSmi(int value) {
   ^~~~~~~~~
In file included from ../src/keymapping.cc:6:
/build/.node-gyp/iojs-2.0.5/src/node.h:97:8: warning: attribute ignored in declaration of ‘struct v8::internal::SmiTagging<8>::uv_loop_s’ [-Wattributes]
 struct uv_loop_s;
        ^~~~~~~~~
/build/.node-gyp/iojs-2.0.5/src/node.h:97:8: note: attribute for ‘struct v8::internal::SmiTagging<8>::uv_loop_s’ must follow the ‘struct’ keyword
/build/.node-gyp/iojs-2.0.5/src/node.h:100:1: error: expected unqualified-id before ‘namespace’
 namespace v8 {
 ^~~~~~~~~
/build/.node-gyp/iojs-2.0.5/src/node.h:106:1: error: expected unqualified-id before ‘namespace’
 namespace node {
 ^~~~~~~~~
In file included from /usr/include/features.h:428,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdint.h:26,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/include/stdint.h:9,
                 from /build/.node-gyp/iojs-2.0.5/deps/v8/include/v8.h:19,
                 from /build/.node-gyp/iojs-2.0.5/src/node.h:63,
                 from ../src/keymapping.cc:6:
/usr/include/assert.h:64:1: error: expected unqualified-id before string constant
 __BEGIN_DECLS
 ^~~~~~~~~~~~~
In file included from ../src/keymapping.cc:6:
/build/.node-gyp/iojs-2.0.5/src/node.h:197:1: error: expected unqualified-id before ‘namespace’
 namespace node {
 ^~~~~~~~~
In file included from /usr/include/c++/8.2.0/map:60,
                 from ../src/keymapping.cc:7:
/usr/include/c++/8.2.0/bits/stl_tree.h:75:1: error: expected unqualified-id before ‘namespace’
 namespace std _GLIBCXX_VISIBILITY(default)
 ^~~~~~~~~
In file included from /usr/include/c++/8.2.0/map:61,
                 from ../src/keymapping.cc:7:
/usr/include/c++/8.2.0/bits/stl_map.h:66:1: error: expected unqualified-id before ‘namespace’
 namespace std _GLIBCXX_VISIBILITY(default)
 ^~~~~~~~~
In file included from /usr/include/c++/8.2.0/map:62,
                 from ../src/keymapping.cc:7:
/usr/include/c++/8.2.0/bits/stl_multimap.h:64:1: error: expected unqualified-id before ‘namespace’
 namespace std _GLIBCXX_VISIBILITY(default)
 ^~~~~~~~~
In file included from ../src/keymapping.h:10,
                 from ../src/keymapping.cc:9:
/build/.node-gyp/iojs-2.0.5/deps/uv/include/uv.h:27:8: error: expected unqualified-id before string constant
 extern "C" {
        ^~~
In file included from ../src/keymapping.cc:9:
../src/keymapping.h:15:1: error: expected unqualified-id before ‘namespace’
 namespace vscode_keyboard {
 ^~~~~~~~~
../src/keymapping.cc:11:1: error: expected unqualified-id before ‘namespace’
 namespace vscode_keyboard {
 ^~~~~~~~~
../src/keymapping.cc:30:1: error: expected ‘}’ at end of input
 } // namespace vscode_keyboard
 ^
In file included from /build/.node-gyp/iojs-2.0.5/src/node.h:63,
                 from ../src/keymapping.cc:6:
/build/.node-gyp/iojs-2.0.5/deps/v8/include/v8.h:8864:34: note: to match this ‘{’
 template <> struct SmiTagging<8> {
                                  ^
/build/.node-gyp/iojs-2.0.5/deps/v8/include/v8.h:8872:3: error: expected ‘}’ at end of input
   }
   ^
/build/.node-gyp/iojs-2.0.5/deps/v8/include/v8.h:8808:20: note: to match this ‘{’
 namespace internal {
                    ^
/build/.node-gyp/iojs-2.0.5/deps/v8/include/v8.h:8872:3: error: expected ‘}’ at end of input
   }
   ^
/build/.node-gyp/iojs-2.0.5/deps/v8/include/v8.h:64:14: note: to match this ‘{’
 namespace v8 {
              ^
/build/.node-gyp/iojs-2.0.5/deps/v8/include/v8.h:3305:19: warning: inline function ‘void* v8::Object::GetAlignedPointerFromInternalField(int)’ used but never defined
   V8_INLINE void* GetAlignedPointerFromInternalField(int index);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /build/.node-gyp/iojs-2.0.5/src/node.h:63,
                 from ../src/keymapping.h:9,
                 from ../src/keyboard_x.cc:6:
/build/.node-gyp/iojs-2.0.5/deps/v8/include/v8.h: In static member function ‘static void v8::V8::SetAllowCodeGenerationFromStringsCallback(v8::DeprecatedAllowCodeGenerationFromStringsCallback)’:
/build/.node-gyp/iojs-2.0.5/deps/v8/include/v8.h:10176:19: warning: cast between incompatible function types from ‘v8::DeprecatedAllowCodeGenerationFromStringsCallback’ {aka ‘bool (*)(v8::Local<v8::Context>)’} to ‘v8::FreshNewAllowCodeGenerationFromStringsCallback’ {aka ‘bool (*)(v8::Local<v8::Context>, v8::Local<v8::String>)’} [-Wcast-function-type]
           callback));
                   ^
/build/.node-gyp/iojs-2.0.5/deps/v8/include/v8.h: In static member function ‘static void v8::V8::RemoveGCPrologueCallback(v8::GCCallback)’:
/build/.node-gyp/iojs-2.0.5/deps/v8/include/v8.h:10221:53: warning: cast between incompatible function types from ‘v8::GCCallback’ {aka ‘void (*)(v8::GCType, v8::GCCallbackFlags)’} to ‘v8::Isolate::GCCallback’ {aka ‘void (*)(v8::Isolate*, v8::GCType, v8::GCCallbackFlags)’} [-Wcast-function-type]
       reinterpret_cast<Isolate::GCCallback>(callback));
                                                     ^
/build/.node-gyp/iojs-2.0.5/deps/v8/include/v8.h: In static member function ‘static void v8::V8::RemoveGCEpilogueCallback(v8::GCCallback)’:
/build/.node-gyp/iojs-2.0.5/deps/v8/include/v8.h:10228:53: warning: cast between incompatible function types from ‘v8::GCCallback’ {aka ‘void (*)(v8::GCType, v8::GCCallbackFlags)’} to ‘v8::Isolate::GCCallback’ {aka ‘void (*)(v8::Isolate*, v8::GCType, v8::GCCallbackFlags)’} [-Wcast-function-type]
       reinterpret_cast<Isolate::GCCallback>(callback));
                                                     ^
make: *** [keymapping.target.mk:102: Release/obj.target/keymapping/src/keymapping.o] Error 1
make: *** Waiting for unfinished jobs....
make: Leaving directory '/build/code/src/code/node_modules/native-keymap/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.18.5-zen1-1-zen
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /build/code/src/code/node_modules/native-keymap
gyp ERR! node -v v8.11.4
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

Note: It doesn’t always fail on this module, but it always fails due to errors in iojs’ source.

Why is iojs being used?? How can I make the build system use my local node installation?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 33 (16 by maintainers)

Most upvoted comments

It works on my machine. It just doesn’t work when compiling in a clean chroot (clean Arch Linux installation), which is required to build the package for the repos.