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

Does not build on latest NodeJS 12.x #21

Open
papodaca opened this issue May 23, 2019 · 2 comments · May be fixed by #22
Open

Does not build on latest NodeJS 12.x #21

papodaca opened this issue May 23, 2019 · 2 comments · May be fixed by #22

Comments

@papodaca
Copy link

papodaca commented May 23, 2019

Cannot build on the latest node release. Seems to be related to some methods that were deprecated in the v8 api that the newer node uses.

seems related to (among other breakages):

   std::string audio_file = *v8::String::Utf8Value(info[0]->ToString());

which uses the ‘v8::Value::ToString()’ method which is deprecated and there is a newer method that takes a context argument? I took a quick look for a bit but am too unfamiliar with the v8 api. It also seem that the v8 api documentation is missing for node 11.x and 12.x so it is a bit tricky to track down the docs.

Build errors:

<command-line>: note: this is the location of the previous definition
../src/taglib2.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE writeTagsSync(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/taglib2.cc:82:69: error: no matching function for call to ‘v8::Value::ToString()’
   std::string audio_file = *v8::String::Utf8Value(info[0]->ToString());
                                                                     ^
In file included from ../src/taglib2.cc:4:
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2528:44: note: candidate: ‘v8::MaybeLocal<v8::String> v8::Value::ToString(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                            ^~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2528:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8-internal.h:14,
                 from /home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:25,
                 from ../src/taglib2.cc:4:
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2544:35: note: candidate: ‘v8::Local<v8::String> v8::Value::ToString(v8::Isolate*) const’
                     Local<String> ToString(Isolate* isolate) const);
                                   ^~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8config.h:329:48: note: in definition of macro ‘V8_DEPRECATE_SOON’
 #define V8_DEPRECATE_SOON(message, declarator) declarator
                                                ^~~~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2544:35: note:   candidate expects 1 argument, 0 provided
                     Local<String> ToString(Isolate* isolate) const);
                                   ^~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8config.h:329:48: note: in definition of macro ‘V8_DEPRECATE_SOON’
 #define V8_DEPRECATE_SOON(message, declarator) declarator
                                                ^~~~~~~~~~
../src/taglib2.cc: In lambda function:
../src/taglib2.cc:104:50: error: no matching function for call to ‘v8::Object::Has(v8::Local<v8::String>)’
     return o->Has(Nan::New(name).ToLocalChecked());
                                                  ^
In file included from ../src/taglib2.cc:4:
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:3449:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context,
                                     ^~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:3449:37: note:   candidate expects 2 arguments, 1 provided
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:3455:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, uint32_t index);
                                     ^~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:3455:37: note:   candidate expects 2 arguments, 1 provided
../src/taglib2.cc: In lambda function:
../src/taglib2.cc:112:45: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>&)’
     std::string s = *v8::String::Utf8Value(r);
                                             ^
In file included from ../src/taglib2.cc:4:
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2995:5: note: candidate: ‘v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)’
     Utf8Value(Isolate* isolate, Local<v8::Value> obj);
     ^~~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2995:5: note:   candidate expects 2 arguments, 1 provided
../src/taglib2.cc: In lambda function:
../src/taglib2.cc:120:64: error: no matching function for call to ‘v8::Value::Int32Value()’
     return o->Get(Nan::New(name).ToLocalChecked())->Int32Value();
                                                                ^
In file included from ../src/taglib2.cc:4:
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2569:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                        ^~~~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2569:40: note:   candidate expects 1 argument, 0 provided
../src/taglib2.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE writeTagsSync(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/taglib2.cc:221:77: error: no matching function for call to ‘v8::Value::ToObject()’
       if (!picture.IsEmpty() && node::Buffer::HasInstance(picture->ToObject())) {
                                                                             ^
In file included from ../src/taglib2.cc:4:
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2532:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                            ^~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2532:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8-internal.h:14,
                 from /home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:25,
                 from ../src/taglib2.cc:4:
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2546:35: note: candidate: ‘v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const’
                     Local<Object> ToObject(Isolate* isolate) const);
                                   ^~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8config.h:329:48: note: in definition of macro ‘V8_DEPRECATE_SOON’
 #define V8_DEPRECATE_SOON(message, declarator) declarator
                                                ^~~~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2546:35: note:   candidate expects 1 argument, 0 provided
                     Local<Object> ToObject(Isolate* isolate) const);
                                   ^~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8config.h:329:48: note: in definition of macro ‘V8_DEPRECATE_SOON’
 #define V8_DEPRECATE_SOON(message, declarator) declarator
                                                ^~~~~~~~~~
../src/taglib2.cc:223:61: error: no matching function for call to ‘v8::Value::ToObject()’
         char* buffer = node::Buffer::Data(picture->ToObject());
                                                             ^
In file included from ../src/taglib2.cc:4:
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2532:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                            ^~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2532:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8-internal.h:14,
                 from /home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:25,
                 from ../src/taglib2.cc:4:
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2546:35: note: candidate: ‘v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const’
                     Local<Object> ToObject(Isolate* isolate) const);
                                   ^~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8config.h:329:48: note: in definition of macro ‘V8_DEPRECATE_SOON’
 #define V8_DEPRECATE_SOON(message, declarator) declarator
                                                ^~~~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2546:35: note:   candidate expects 1 argument, 0 provided
                     Local<Object> ToObject(Isolate* isolate) const);
                                   ^~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8config.h:329:48: note: in definition of macro ‘V8_DEPRECATE_SOON’
 #define V8_DEPRECATE_SOON(message, declarator) declarator
                                                ^~~~~~~~~~
../src/taglib2.cc:224:68: error: no matching function for call to ‘v8::Value::ToObject()’
         const size_t blen = node::Buffer::Length(picture->ToObject());
                                                                    ^
In file included from ../src/taglib2.cc:4:
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2532:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                            ^~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2532:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8-internal.h:14,
                 from /home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:25,
                 from ../src/taglib2.cc:4:
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2546:35: note: candidate: ‘v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const’
                     Local<Object> ToObject(Isolate* isolate) const);
                                   ^~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8config.h:329:48: note: in definition of macro ‘V8_DEPRECATE_SOON’
 #define V8_DEPRECATE_SOON(message, declarator) declarator
                                                ^~~~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2546:35: note:   candidate expects 1 argument, 0 provided
                     Local<Object> ToObject(Isolate* isolate) const);
                                   ^~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8config.h:329:48: note: in definition of macro ‘V8_DEPRECATE_SOON’
 #define V8_DEPRECATE_SOON(message, declarator) declarator
                                                ^~~~~~~~~~
../src/taglib2.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE readTagsSync(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/taglib2.cc:250:69: error: no matching function for call to ‘v8::Value::ToString()’
   std::string audio_file = *v8::String::Utf8Value(info[0]->ToString());
                                                                     ^
In file included from ../src/taglib2.cc:4:
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2528:44: note: candidate: ‘v8::MaybeLocal<v8::String> v8::Value::ToString(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                            ^~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2528:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8-internal.h:14,
                 from /home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:25,
                 from ../src/taglib2.cc:4:
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2544:35: note: candidate: ‘v8::Local<v8::String> v8::Value::ToString(v8::Isolate*) const’
                     Local<String> ToString(Isolate* isolate) const);
                                   ^~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8config.h:329:48: note: in definition of macro ‘V8_DEPRECATE_SOON’
 #define V8_DEPRECATE_SOON(message, declarator) declarator
                                                ^~~~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:2544:35: note:   candidate expects 1 argument, 0 provided
                     Local<String> ToString(Isolate* isolate) const);
                                   ^~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8config.h:329:48: note: in definition of macro ‘V8_DEPRECATE_SOON’
 #define V8_DEPRECATE_SOON(message, declarator) declarator
                                                ^~~~~~~~~~
../src/taglib2.cc: In function ‘void Init(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’:
../src/taglib2.cc:507:64: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
     Nan::New<v8::FunctionTemplate>(writeTagsSync)->GetFunction());
                                                                ^
In file included from ../src/taglib2.cc:4:
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:5947:46: note: candidate: ‘v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
                                              ^~~~~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:5947:46: note:   candidate expects 1 argument, 0 provided
../src/taglib2.cc:510:63: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
     Nan::New<v8::FunctionTemplate>(readTagsSync)->GetFunction());
                                                               ^
In file included from ../src/taglib2.cc:4:
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:5947:46: note: candidate: ‘v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
                                              ^~~~~~~~~~~
/home/usr1/.cmake-js/node-x64/v12.3.1/include/node/v8.h:5947:46: note:   candidate expects 1 argument, 0 provided
ninja: build stopped: subcommand failed.
ERR! OMG Process terminated: 1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
@papodaca
Copy link
Author

For my own use, could be helpful for anyone else trying to fix this. I've posted the doxygen docs for the v8 versions of node 11 and 12.

jacobbubu added a commit to jacobbubu/node-taglib2 that referenced this issue Dec 14, 2019
papodaca added a commit to papodaca/node-taglib2 that referenced this issue Jan 9, 2020
@schneefux
Copy link

Hi, just in case anyone else comes across this issue via Google, I've created a fork which addresses this, #9 and #20.

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

Successfully merging a pull request may close this issue.

2 participants