chrisdew / protobuf

Protocol Buffers for Node.JS
http://code.google.com/p/protobuf-for-node/
Apache License 2.0
234 stars 71 forks source link

Compile for io.js 1.0.4 #48

Closed alexfernandez closed 7 years ago

alexfernandez commented 9 years ago

Protobuf is not compiling for io.js latest (1.0.4), node-gyp fails with a lot of errors. Latest error is included here:

../protobuf_for_node.cc: In function ‘v8::Local<v8::Function> protobuf_for_node::SchemaConstructor()’:
../protobuf_for_node.cc:724:26: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
     return SchemaTemplate->GetFunction();
                          ^
../protobuf_for_node.cc:725:3: warning: control reaches end of non-void function [-Wreturn-type]
   }
   ^
make: *** [Release/obj.target/protobuf_for_node/protobuf_for_node.o] Error 1
make: Leaving directory `/home/ubuntu/adserver/node_modules/protobuf/build'
alexfernandez commented 9 years ago

Errors using latest io.js 1.1.0:

  LIBTOOL-STATIC Release/protobuf_lite.a
  CXX(target) Release/obj.target/protobuf_for_node/protobuf_for_node.o
In file included from ../protobuf_for_node.cc:22:
../node_modules/nan/nan.h:409:19: error: no type named 'ExternalAsciiStringResource' in 'v8::String'; did you mean 'ExternalStringResource'?
      v8::String::ExternalAsciiStringResource *resource) {
      ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
                  ExternalStringResource
/Users/alexfernandez/.node-gyp/1.1.0/deps/v8/include/v8.h:2016:19: note: 'ExternalStringResource' declared here
  class V8_EXPORT ExternalStringResource
                  ^
In file included from ../protobuf_for_node.cc:22:
../node_modules/nan/nan.h:408:36: error: redefinition of 'NanNew'
  NAN_INLINE v8::Local<v8::String> NanNew(
                                   ^
../node_modules/nan/nan.h:403:36: note: previous definition is here
  NAN_INLINE v8::Local<v8::String> NanNew(
                                   ^
../node_modules/nan/nan.h:1728:12: error: no member named 'IsExternalAscii' in 'v8::String'; did you mean 'IsExternal'?
  if (str->IsExternalAscii()) {
           ^~~~~~~~~~~~~~~
           IsExternal
/Users/alexfernandez/.node-gyp/1.1.0/deps/v8/include/v8.h:1980:8: note: 'IsExternal' declared here
  bool IsExternal() const;
       ^
In file included from ../protobuf_for_node.cc:22:
../node_modules/nan/nan.h:1729:23: error: no type named 'ExternalAsciiStringResource' in 'v8::String'; did you mean 'ExternalStringResource'?
    const v8::String::ExternalAsciiStringResource* ext;
          ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
                      ExternalStringResource
/Users/alexfernandez/.node-gyp/1.1.0/deps/v8/include/v8.h:2016:19: note: 'ExternalStringResource' declared here
  class V8_EXPORT ExternalStringResource
                  ^
In file included from ../protobuf_for_node.cc:22:
../node_modules/nan/nan.h:1730:16: error: no member named 'GetExternalAsciiStringResource' in 'v8::String'; did you mean 'GetExternalOneByteStringResource'?
    ext = str->GetExternalAsciiStringResource();
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
               GetExternalOneByteStringResource
/Users/alexfernandez/.node-gyp/1.1.0/deps/v8/include/v8.h:2083:40: note: 'GetExternalOneByteStringResource' declared here
  const ExternalOneByteStringResource* GetExternalOneByteStringResource() const;
                                       ^
In file included from ../protobuf_for_node.cc:22:
../node_modules/nan/nan.h:1730:9: error: assigning to 'const v8::String::ExternalStringResource *' from incompatible type 'const v8::String::ExternalOneByteStringResource *'
    ext = str->GetExternalAsciiStringResource();
        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:1731:11: error: assigning to 'const char *' from incompatible type 'const uint16_t *' (aka 'const unsigned short *')
    *data = ext->data();
          ^ ~~~~~~~~~~~
7 errors generated.
make: *** [Release/obj.target/protobuf_for_node/protobuf_for_node.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/alexfernandez/.nvm/versions/io.js/v1.1.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:100:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1040:12)
gyp ERR! System Darwin 14.1.0
gyp ERR! command "node" "/Users/alexfernandez/.nvm/versions/io.js/v1.1.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/alexfernandez/mediasmart/repos/adserver-upstream/node_modules/protobuf
gyp ERR! node -v v1.1.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 
syndbg commented 7 years ago

Hello @alexfernandez . Sorry for the late reply (like really late).

NodeJS 4/5 support (and io.js although not used anymore) is ok since 399f22901dadecc8132aa86cc638c7a379bc61b2

alexfernandez commented 7 years ago

@syndbg :+1: