Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile for io.js 1.1.0 #200

Closed
alexfernandez opened this issue Feb 9, 2015 · 7 comments
Closed

Compile for io.js 1.1.0 #200

alexfernandez opened this issue Feb 9, 2015 · 7 comments

Comments

@alexfernandez
Copy link

Protobuf is failing to build for io.js latest (1.1.0), errors follow:

  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 
@alexfernandez
Copy link
Author

We are using chrisdew's fork.

@cfallin
Copy link
Contributor

cfallin commented Feb 9, 2015

You've already closed this, but FYI, this looks like protobuf_for_node, which is completely separate and unrelated to google/protobuf (we don't have a Node extension yet).

@alexfernandez
Copy link
Author

Thanks. The package is actually a fork of that, and a corresponding issue has been opened. Now that I have your attention, it would be great to have a Node.js extension: protobuf_for_node is apparently unmaintained and so is the fork:

New Maintainer Required

I will open a new issue for that.

@cfallin
Copy link
Contributor

cfallin commented Feb 9, 2015

We're actually developing an official Node.js extension for google/protobuf (i.e., the official Google-provided library) as part of our proto3 effort. I don't think we would take up maintenance of a third-party library.

@alexfernandez
Copy link
Author

That's really cool! Couple of remarks:

  • It would be great if it worked fine with io.js, which seems to be gathering a lot of momentum.
  • A JavaScript-only library would be a very welcome fallback in cases where the original C++ library cannot be compiled, either for lack of dev env or just because of errors, as is currently the case with io.js.

@cfallin
Copy link
Contributor

cfallin commented Feb 9, 2015

Both points acknowledged! We'll test with io.js, certainly. I can't speak to any plans regarding a JavaScript-only version, but that's certainly something to keep in mind, thanks.

@nstepien
Copy link

A JS-only version would be mostly beneficial as a browser-side library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants