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

Fix compilation on node 13.x, still works on 10.x, 11.x and 12.x #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

papodaca
Copy link

@papodaca papodaca commented May 23, 2019

  • Fixes use of deprecated functions in node 13.x
  • Include multiple node versions in ci matrix
  • update nan to support more node versions

Fixes #21

@papodaca papodaca force-pushed the #21 branch 2 times, most recently from 2e67f75 to 00c118e Compare May 24, 2019 22:51
@papodaca papodaca changed the title Fix compilation on node 12.x, still works on 10.x and 11.x Fix compilation on node 12.x, still works on 10.x, 11.x, 12.x and 13.x Nov 4, 2019
@papodaca papodaca changed the title Fix compilation on node 12.x, still works on 10.x, 11.x, 12.x and 13.x Fix compilation on node 13.x, still works on 10.x, 11.x and 12.x Nov 4, 2019
@mike391
Copy link

mike391 commented Jan 9, 2020

Installing using npm install git+https://github.com/papodaca/node-taglib2.git --save
Using Node 12.14.0

Getting the following errors:

[ 90%] Building CXX object CMakeFiles/taglib2.dir/src/taglib2.cc.o
/home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:21: warning: "NDEBUG" redefined
   21 | #define NDEBUG
      | 
<command-line>: note: this is the location of the previous definition
/home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE writeTagsSync(Nan::NAN_METHOD_ARGS_TYPE)’:
/home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:82:69: error: no matching function for call to ‘v8::Value::ToString()’
   82 |   std::string audio_file = *v8::String::Utf8Value(info[0]->ToString());
      |                                                                     ^
In file included from /home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:4:
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2572:44: note: candidate: ‘v8::MaybeLocal<v8::String> v8::Value::ToString(v8::Local<v8::Context>) const’
 2572 |   V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
      |                                            ^~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2572:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8-internal.h:14,
                 from /home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:25,
                 from /home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:4:
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2588:31: note: candidate: ‘v8::Local<v8::String> v8::Value::ToString(v8::Isolate*) const’
 2588 |                 Local<String> ToString(Isolate* isolate) const);
      |                               ^~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8config.h:318:44: note: in definition of macro ‘V8_DEPRECATED’
  318 | #define V8_DEPRECATED(message, declarator) declarator
      |                                            ^~~~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2588:31: note:   candidate expects 1 argument, 0 provided
 2588 |                 Local<String> ToString(Isolate* isolate) const);
      |                               ^~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8config.h:318:44: note: in definition of macro ‘V8_DEPRECATED’
  318 | #define V8_DEPRECATED(message, declarator) declarator
      |                                            ^~~~~~~~~~
/home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc: In lambda function:
/home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:104:50: error: no matching function for call to ‘v8::Object::Has(v8::Local<v8::String>)’
  104 |     return o->Has(Nan::New(name).ToLocalChecked());
      |                                                  ^
In file included from /home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:4:
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:3494:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, v8::Local<v8::Value>)’
 3494 |   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context,
      |                                     ^~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:3494:37: note:   candidate expects 2 arguments, 1 provided
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:3500:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, uint32_t)’
 3500 |   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, uint32_t index);
      |                                     ^~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:3500:37: note:   candidate expects 2 arguments, 1 provided
/home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc: In lambda function:
/home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:112:45: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>&)’
  112 |     std::string s = *v8::String::Utf8Value(r);
      |                                             ^
In file included from /home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:4:
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:3039:5: note: candidate: ‘v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)’
 3039 |     Utf8Value(Isolate* isolate, Local<v8::Value> obj);
      |     ^~~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:3039:5: note:   candidate expects 2 arguments, 1 provided
/home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc: In lambda function:
/home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:120:64: error: no matching function for call to ‘v8::Value::Int32Value()’
  120 |     return o->Get(Nan::New(name).ToLocalChecked())->Int32Value();
      |                                                                ^
In file included from /home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:4:
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
 2613 |   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
      |                                        ^~~~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
/home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE writeTagsSync(Nan::NAN_METHOD_ARGS_TYPE)’:
/home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:221:77: error: no matching function for call to ‘v8::Value::ToObject()’
  221 |       if (!picture.IsEmpty() && node::Buffer::HasInstance(picture->ToObject())) {
      |                                                                             ^
In file included from /home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:4:
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2576:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
 2576 |   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
      |                                            ^~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2576:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8-internal.h:14,
                 from /home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:25,
                 from /home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:4:
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2590:31: note: candidate: ‘v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const’
 2590 |                 Local<Object> ToObject(Isolate* isolate) const);
      |                               ^~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8config.h:318:44: note: in definition of macro ‘V8_DEPRECATED’
  318 | #define V8_DEPRECATED(message, declarator) declarator
      |                                            ^~~~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2590:31: note:   candidate expects 1 argument, 0 provided
 2590 |                 Local<Object> ToObject(Isolate* isolate) const);
      |                               ^~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8config.h:318:44: note: in definition of macro ‘V8_DEPRECATED’
  318 | #define V8_DEPRECATED(message, declarator) declarator
      |                                            ^~~~~~~~~~
/home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:223:61: error: no matching function for call to ‘v8::Value::ToObject()’
  223 |         char* buffer = node::Buffer::Data(picture->ToObject());
      |                                                             ^
In file included from /home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:4:
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2576:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
 2576 |   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
      |                                            ^~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2576:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8-internal.h:14,
                 from /home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:25,
                 from /home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:4:
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2590:31: note: candidate: ‘v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const’
 2590 |                 Local<Object> ToObject(Isolate* isolate) const);
      |                               ^~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8config.h:318:44: note: in definition of macro ‘V8_DEPRECATED’
  318 | #define V8_DEPRECATED(message, declarator) declarator
      |                                            ^~~~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2590:31: note:   candidate expects 1 argument, 0 provided
 2590 |                 Local<Object> ToObject(Isolate* isolate) const);
      |                               ^~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8config.h:318:44: note: in definition of macro ‘V8_DEPRECATED’
  318 | #define V8_DEPRECATED(message, declarator) declarator
      |                                            ^~~~~~~~~~
/home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:224:68: error: no matching function for call to ‘v8::Value::ToObject()’
  224 |         const size_t blen = node::Buffer::Length(picture->ToObject());
      |                                                                    ^
In file included from /home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:4:
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2576:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
 2576 |   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
      |                                            ^~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2576:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8-internal.h:14,
                 from /home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:25,
                 from /home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:4:
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2590:31: note: candidate: ‘v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const’
 2590 |                 Local<Object> ToObject(Isolate* isolate) const);
      |                               ^~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8config.h:318:44: note: in definition of macro ‘V8_DEPRECATED’
  318 | #define V8_DEPRECATED(message, declarator) declarator
      |                                            ^~~~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2590:31: note:   candidate expects 1 argument, 0 provided
 2590 |                 Local<Object> ToObject(Isolate* isolate) const);
      |                               ^~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8config.h:318:44: note: in definition of macro ‘V8_DEPRECATED’
  318 | #define V8_DEPRECATED(message, declarator) declarator
      |                                            ^~~~~~~~~~
/home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE readTagsSync(Nan::NAN_METHOD_ARGS_TYPE)’:
/home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:250:69: error: no matching function for call to ‘v8::Value::ToString()’
  250 |   std::string audio_file = *v8::String::Utf8Value(info[0]->ToString());
      |                                                                     ^
In file included from /home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:4:
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2572:44: note: candidate: ‘v8::MaybeLocal<v8::String> v8::Value::ToString(v8::Local<v8::Context>) const’
 2572 |   V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
      |                                            ^~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2572:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8-internal.h:14,
                 from /home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:25,
                 from /home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:4:
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2588:31: note: candidate: ‘v8::Local<v8::String> v8::Value::ToString(v8::Isolate*) const’
 2588 |                 Local<String> ToString(Isolate* isolate) const);
      |                               ^~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8config.h:318:44: note: in definition of macro ‘V8_DEPRECATED’
  318 | #define V8_DEPRECATED(message, declarator) declarator
      |                                            ^~~~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:2588:31: note:   candidate expects 1 argument, 0 provided
 2588 |                 Local<String> ToString(Isolate* isolate) const);
      |                               ^~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8config.h:318:44: note: in definition of macro ‘V8_DEPRECATED’
  318 | #define V8_DEPRECATED(message, declarator) declarator
      |                                            ^~~~~~~~~~
/home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc: In function ‘void Init(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’:
/home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:507:64: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
  507 |     Nan::New<v8::FunctionTemplate>(writeTagsSync)->GetFunction());
      |                                                                ^
In file included from /home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:4:
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:5995:46: note: candidate: ‘v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)’
 5995 |   V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
      |                                              ^~~~~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:5995:46: note:   candidate expects 1 argument, 0 provided
/home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:510:63: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
  510 |     Nan::New<v8::FunctionTemplate>(readTagsSync)->GetFunction());
      |                                                               ^
In file included from /home/mcabral/Repos/Mike/bookserve/node_modules/taglib2/src/taglib2.cc:4:
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:5995:46: note: candidate: ‘v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)’
 5995 |   V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
      |                                              ^~~~~~~~~~~
/home/mcabral/.cmake-js/node-x64/v12.14.0/include/node/v8.h:5995:46: note:   candidate expects 1 argument, 0 provided
make[2]: *** [CMakeFiles/taglib2.dir/build.make:63: CMakeFiles/taglib2.dir/src/taglib2.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:110: CMakeFiles/taglib2.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
ERR! OMG Process terminated: 2

@papodaca
Copy link
Author

papodaca commented Jan 9, 2020

If you notice, this PR pulls from the branch '#21' in my fork. Not the master branch I have updated the master branch on my fork though, this should work now.

@wiill
Copy link

wiill commented Nov 27, 2020

Seems to be working on node v14.13.1 as well (macOS X mojave)
Thanks for the command to install directly from GitHub, while waiting for the PR to be merged and published to npm

big ups and cheers 👍

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 this pull request may close these issues.

Does not build on latest NodeJS 12.x
3 participants