jprichardson / node-kexec

Node.js exec function to replace running process; like Ruby's exec.
MIT License
50 stars 25 forks source link

Fail building on SemaphoreCI #25

Closed piranna closed 9 years ago

piranna commented 9 years ago

I have configured SemaphoreCI to generate all releases, but kexec fails to build there while on my laptop it works correctly. I'm not sure what's the reason, but I think could be due to lack of some includes or something similar since I'm building it against the cross-compiler generated for NodeOS based on musl. SemaphoreCI use a raw instance of Ubuntu 14.04, while my laptop has Ubuntu 15.10:

> kexec@1.3.0 install /home/runner/NodeOS/node_modules/nodeos-initramfs/obj/i686/initramfs/lib/node_modules/usrbinenv/node_modules/kexec
> node-gyp rebuild

make: Entering directory `/home/runner/NodeOS/node_modules/nodeos-initramfs/obj/i686/initramfs/lib/node_modules/usrbinenv/node_modules/kexec/build'
  i686-nodeos-linux-musl-g++ '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__NODE_V0_10__' '-DBUILDING_NODE_EXTENSION' -I/home/runner/NodeOS/node_modules/nodeos-barebones/deps/node/src -I/home/runner/NodeOS/node_modules/nodeos-barebones/deps/node/deps/uv/include -I/home/runner/NodeOS/node_modules/nodeos-barebones/deps/node/deps/v8/include  -pthread -Wall -Wextra -Wno-unused-parameter -m32 -O3 -ffunction-sections -fdata-sections -fno-tree-vrp -fno-omit-frame-pointer -fno-rtti -fno-exceptions -MMD -MF ./Release/.deps/Release/obj.target/kexec/src/kexec.o.d.raw  -c -o Release/obj.target/kexec/src/kexec.o ../src/kexec.cc
../src/kexec.cc: In function 'int clear_cloexec(int)':
../src/kexec.cc:22:30: error: 'F_GETFD' was not declared in this scope
../src/kexec.cc:22:40: error: 'fcntl' was not declared in this scope
../src/kexec.cc:26:15: error: 'FD_CLOEXEC' was not declared in this scope
../src/kexec.cc:27:25: error: 'F_SETFD' was not declared in this scope
../src/kexec.cc: At global scope:
../src/kexec.cc:39:34: error: 'Arguments' does not name a type
../src/kexec.cc:39:45: error: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
In file included from ../src/kexec.cc:2:0:
/home/runner/NodeOS/node_modules/nodeos-barebones/deps/node/deps/v8/include/v8.h: In function 'v8::Handle<v8::Value> kexec(const int&)':
/home/runner/NodeOS/node_modules/nodeos-barebones/deps/node/deps/v8/include/v8.h:816:13: error: 'v8::HandleScope::HandleScope()' is protected
../src/kexec.cc:40:17: error: within this context
../src/kexec.cc:67:20: error: request for member 'Length' in 'args', which is of non-class type 'const int'
../src/kexec.cc:67:38: error: invalid types 'const int[int]' for array subscript
../src/kexec.cc:69:39: error: invalid types 'const int[int]' for array subscript
../src/kexec.cc:75:44: error: no matching function for call to 'v8::Number::New(int&)'
../src/kexec.cc:75:44: note: candidate is:
In file included from ../src/kexec.cc:2:0:
/home/runner/NodeOS/node_modules/nodeos-barebones/deps/node/deps/v8/include/v8.h:1976:24: note: static v8::Local<v8::Number> v8::Number::New(v8::Isolate*, double)
/home/runner/NodeOS/node_modules/nodeos-barebones/deps/node/deps/v8/include/v8.h:1976:24: note:   candidate expects 2 arguments, 1 provided
../src/kexec.cc:76:22: error: 'class v8::HandleScope' has no member named 'Close'
../src/kexec.cc:83:20: error: request for member 'Length' in 'args', which is of non-class type 'const int'
../src/kexec.cc:83:38: error: invalid types 'const int[int]' for array subscript
../src/kexec.cc:83:61: error: invalid types 'const int[int]' for array subscript
../src/kexec.cc:85:39: error: invalid types 'const int[int]' for array subscript
../src/kexec.cc:89:61: error: invalid types 'const int[int]' for array subscript
../src/kexec.cc:99:64: error: no matching function for call to 'v8::Integer::New(int&)'
../src/kexec.cc:99:64: note: candidate is:
In file included from ../src/kexec.cc:2:0:
/home/runner/NodeOS/node_modules/nodeos-barebones/deps/node/deps/v8/include/v8.h:1989:25: note: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)
/home/runner/NodeOS/node_modules/nodeos-barebones/deps/node/deps/v8/include/v8.h:1989:25: note:   candidate expects 2 arguments, 1 provided
../src/kexec.cc:115:44: error: no matching function for call to 'v8::Number::New(int&)'
../src/kexec.cc:115:44: note: candidate is:
In file included from ../src/kexec.cc:2:0:
/home/runner/NodeOS/node_modules/nodeos-barebones/deps/node/deps/v8/include/v8.h:1976:24: note: static v8::Local<v8::Number> v8::Number::New(v8::Isolate*, double)
/home/runner/NodeOS/node_modules/nodeos-barebones/deps/node/deps/v8/include/v8.h:1976:24: note:   candidate expects 2 arguments, 1 provided
../src/kexec.cc:116:22: error: 'class v8::HandleScope' has no member named 'Close'
../src/kexec.cc:124:41: error: 'New' is not a member of 'v8::String'
../src/kexec.cc:124:81: error: 'ThrowException' was not declared in this scope
../src/kexec.cc:125:18: error: 'class v8::HandleScope' has no member named 'Close'
../src/kexec.cc:125:34: error: too few arguments to function 'v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)'
In file included from ../src/kexec.cc:2:0:
/home/runner/NodeOS/node_modules/nodeos-barebones/deps/node/deps/v8/include/v8.h:305:28: note: declared here
../src/kexec.cc: In function 'void init(v8::Handle<v8::Object>)':
../src/kexec.cc:134:47: error: no matching function for call to 'NODE_SET_METHOD(v8::Handle<v8::Object>&, const char [6], v8::Handle<v8::Value> (&)(const int&))'
../src/kexec.cc:134:47: note: candidate is:
In file included from ../src/kexec.cc:3:0:
/home/runner/NodeOS/node_modules/nodeos-barebones/deps/node/src/node.h:211:13: note: template<class TypeName> void node::NODE_SET_METHOD(const TypeName&, const char*, v8::FunctionCallback)
/home/runner/NodeOS/node_modules/nodeos-barebones/deps/node/src/node.h:211:13: note:   template argument deduction/substitution failed:
../src/kexec.cc:134:47: note:   cannot convert 'kexec' (type 'v8::Handle<v8::Value>(const int&)') to type 'v8::FunctionCallback {aka void (*)(const v8::FunctionCallbackInfo<v8::Value>&)}'
make: *** [Release/obj.target/kexec/src/kexec.o] Error 1
make: Leaving directory `/home/runner/NodeOS/node_modules/nodeos-initramfs/obj/i686/initramfs/lib/node_modules/usrbinenv/node_modules/kexec/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/runner/NodeOS/node_modules/nodeos-barebones/deps/node/deps/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.13.0-32-generic
gyp ERR! command "node" "/home/runner/NodeOS/node_modules/nodeos-barebones/deps/node/deps/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/runner/NodeOS/node_modules/nodeos-initramfs/obj/i686/initramfs/lib/node_modules/usrbinenv/node_modules/kexec
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 

By the way: why are you (still) using directly the v8 APIs instead of standard nan macros?

piranna commented 9 years ago

I've found that although I'm using nvm on SemaphoreCI to use Node.js 0.12.7, since NodeOS build process internally exec npm it's still using 0.10.25. Could this be the problem?

foysavas commented 9 years ago

Yes, that's most likely the problem given the bewildering combination of gyp ERR! node -v v0.10.25 and the missing fcntl header. The fcntl header should been included via v8 headers for any node <= v0.10, but here is missing, making it seem like it's compiling against a newer node.

Also, we shouldn't run into any issues converting to Nan, but kexec predates Nan, and since kexec is only a few lines of code, I guess no one has found the need yet.

jprichardson commented 9 years ago

I'm fine with dropping support for Node v0.8. We could even drop support for Node v0.10 if need be.

piranna commented 9 years ago

I've written to SemaphoreCI looking for advice since I need this working for my bachelor thesis.

I don't think it would be a good idea to drop Node.js 0.10, it's still available by default on Ubuntu 14.04 LTS...

piranna commented 9 years ago

Seems it's a problem in SemaphoreCI, I'll update the issue when I get more info.

piranna commented 9 years ago

Definitely it was an error on SemaphoreCI, I've fixed it by disabling nvm and installing Node.js 0.12 globally from NodeSources repository. I think this issue can be closed (except is you want to talk about the nan thing... :-) ).