mraa
mraa copied to clipboard
Build failure with Node.js 12.x
When building against Node.js 12.4.0 on Fedora Rawhide, we get the following output:
[ 33%] Built target mraa
make -f src/python/python3/CMakeFiles/_python3-mraa.dir/build.make src/python/python3/CMakeFiles/_python3-mraa.dir/depend
make -f src/javascript/CMakeFiles/mraajs.dir/build.make src/javascript/CMakeFiles/mraajs.dir/depend
make[2]: Entering directory '/builddir/build/BUILD/mraa-2.0.0'
cd /builddir/build/BUILD/mraa-2.0.0 && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /builddir/build/BUILD/mraa-2.0.0 /builddir/build/BUILD/mraa-2.0.0/src/javascript /builddir/build/BUILD/mraa-2.0.0 /builddir/build/BUILD/mraa-2.0.0/src/javascript /builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/DependInfo.cmake --color=
make[2]: Entering directory '/builddir/build/BUILD/mraa-2.0.0'
cd /builddir/build/BUILD/mraa-2.0.0 && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /builddir/build/BUILD/mraa-2.0.0 /builddir/build/BUILD/mraa-2.0In file included from /builddir/build/BUILD/mraa-2.0.0/src/python/python3/CMakeFiles/_python3-mraa.dir/mraa3PYTHON_wrap.cxx:3069:
/builddir/build/BUILD/mraa-2.0.0/api/mraa/gpio.hpp: In member function 'mraa::Result mraa::Gpio::useMmap(bool)':
/builddir/build/BUILD/mraa-2.0.0/api/mraa/gpio.hpp:317:77: warning: 'mraa_result_t mraa_gpio_use_mmaped(mraa_gpio_context, mraa_boolean_t)' is deprecated [-Wdeprecated-declarations]
317 | return (Result) mraa_gpio_use_mmaped(m_gpio, (mraa_boolean_t) enable);
| ^
In file included from /builddir/build/BUILD/mraa-2.0.0/api/mraa/gpio.hpp:27,
from /builddir/build/BUILD/mraa-2.0.0/src/python/python3/CMakeFiles/_python3-mraa.dir/mraa3PYTHON_wrap.cxx:3069:
/builddir/build/BUILD/mraa-2.0.0/api/mraa/gpio.h:279:26: note: declared here
279 | DEPRECATED mraa_result_t mraa_gpio_use_mmaped(mraa_gpio_context dev, mraa_boolean_t mmap);
| ^~~~~~~~~~~~~~~~~~~~
In file included from /builddir/build/BUILD/mraa-2.0.0/src/python/python3/CMakeFiles/_python3-mraa.dir/mraa3PYTHON_wrap.cxx:3069:
/builddir/build/BUILD/mraa-2.0.0/api/mraa/gpio.hpp:317:77: warning: 'mraa_result_t mraa_gpio_use_mmaped(mraa_gpio_context, mraa_boolean_t)' is deprecated [-Wdeprecated-declarations]
317 | return (Result) mraa_gpio_use_mmaped(m_gpio, (mraa_boolean_t) enable);
| ^
In file included from /builddir/build/BUILD/mraa-2.0.0/api/mraa/gpio.hpp:27,
from /builddir/build/BUILD/mraa-2.0.0/src/python/python3/CMakeFiles/_python3-mraa.dir/mraa3PYTHON_wrap.cxx:3069:
/builddir/build/BUILD/mraa-2.0.0/api/mraa/gpio.h:279:26: note: declared here
279 | DEPRECATED mraa_result_t mraa_gpio_use_mmaped(mraa_gpio_context dev, mraa_boolean_t mmap);
| ^~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx: In function 'v8::Handle<v8::Value> SWIG_V8_NewPointerObj(void*, swig_type_info*, int)':
/builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:1188:79: error: no matching function for call to 'v8::ObjectTemplate::NewInstance()'
1188 | v8::Local<v8::Object> result = class_templ->InstanceTemplate()->NewInstance();
| ^
In file included from /usr/include/node/node.h:63,
from /builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:171:
/usr/include/node/v8.h:6244:44: note: candidate: 'v8::MaybeLocal<v8::Object> v8::ObjectTemplate::NewInstance(v8::Local<v8::Context>)'
6244 | V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(Local<Context> context);
| ^~~~~~~~~~~
/usr/include/node/v8.h:6244:44: note: candidate expects 1 argument, 0 provided
/builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx: In function 'void SWIGV8_AddStaticFunction(v8::Handle<v8::Object>, const char*, void (* const&)(const v8::FunctionCallbackInfo<v8::Value>&))':
/builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:1513:83: error: no matching function for call to 'v8::FunctionTemplate::GetFunction()'
1513 | obj->Set(SWIGV8_SYMBOL_NEW(symbol), SWIGV8_FUNCTEMPLATE_NEW(_func)->GetFunction());
| ^
In file included from /usr/include/node/node.h:63,
from /builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:171:
/usr/include/node/v8.h:5947:46: note: candidate: 'v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)'
5947 | V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
| ^~~~~~~~~~~
/usr/include/node/v8.h:5947:46: note: candidate expects 1 argument, 0 provided
/builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx: In function 'void SWIGV8_AddStaticVariable(v8::Handle<v8::Object>, const char*, SwigV8AccessorGetterCallback, SwigV8AccessorSetterCallback)':
/builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:1524:87: warning: ignoring return value of 'v8::Maybe<bool> v8::Object::SetAccessor(v8::Local<v8::Context>, v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::MaybeLocal<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)', declared with attribute warn_unused_result [-Wunused-result]
1524 | obj->SetAccessor(SWIGV8_CURRENT_CONTEXT(), SWIGV8_SYMBOL_NEW(symbol), getter, setter);
| ^
In file included from /usr/include/node/node.h:63,
from /builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:171:
/usr/include/node/v8.h:3463:37: note: declared here
3463 | V8_WARN_UNUSED_RESULT Maybe<bool> SetAccessor(
| ^~~~~~~~~~~
In file included from /builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:1776:
/builddir/build/BUILD/mraa-2.0.0/api/mraa/gpio.hpp: In static member function 'static void mraa::Gpio::v8isr(uv_work_t*, int)':
/builddir/build/BUILD/mraa-2.0.0/api/mraa/gpio.hpp:176:63: error: no matching function for call to 'v8::Function::Call(v8::Local<v8::Object>, int&, v8::Local<v8::Value> [1])'
176 | f->Call(SWIGV8_CURRENT_CONTEXT()->Global(), argc, argv);
| ^
In file included from /usr/include/node/node.h:63,
from /builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:171:
/usr/include/node/v8.h:4148:43: note: candidate: 'v8::MaybeLocal<v8::Value> v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*)'
4148 | V8_WARN_UNUSED_RESULT MaybeLocal<Value> Call(Local<Context> context,
| ^~~~
/usr/include/node/v8.h:4148:43: note: candidate expects 4 arguments, 3 provided
In file included from /builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:1776:
/builddir/build/BUILD/mraa-2.0.0/api/mraa/gpio.hpp: In member function 'mraa::Result mraa::Gpio::useMmap(bool)':
/builddir/build/BUILD/mraa-2.0.0/api/mraa/gpio.hpp:317:77: warning: 'mraa_result_t mraa_gpio_use_mmaped(mraa_gpio_context, mraa_boolean_t)' is deprecated [-Wdeprecated-declarations]
317 | return (Result) mraa_gpio_use_mmaped(m_gpio, (mraa_boolean_t) enable);
| ^
In file included from /builddir/build/BUILD/mraa-2.0.0/api/mraa/gpio.hpp:27,
from /builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:1776:
/builddir/build/BUILD/mraa-2.0.0/api/mraa/gpio.h:279:26: note: declared here
279 | DEPRECATED mraa_result_t mraa_gpio_use_mmaped(mraa_gpio_context dev, mraa_boolean_t mmap);
| ^~~~~~~~~~~~~~~~~~~~
In file included from /builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:1776:
/builddir/build/BUILD/mraa-2.0.0/api/mraa/gpio.hpp:317:77: warning: 'mraa_result_t mraa_gpio_use_mmaped(mraa_gpio_context, mraa_boolean_t)' is deprecated [-Wdeprecated-declarations]
317 | return (Result) mraa_gpio_use_mmaped(m_gpio, (mraa_boolean_t) enable);
| ^
In file included from /builddir/build/BUILD/mraa-2.0.0/api/mraa/gpio.hpp:27,
from /builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:1776:
/builddir/build/BUILD/mraa-2.0.0/api/mraa/gpio.h:279:26: note: declared here
279 | DEPRECATED mraa_result_t mraa_gpio_use_mmaped(mraa_gpio_context dev, mraa_boolean_t mmap);
| ^~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx: In function 'void mraa_initialize(v8::Handle<v8::Object>, v8::Handle<v8::Object>)':
/builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:12376:91: error: no matching function for call to 'v8::FunctionTemplate::GetFunction()'
12376 | v8::Handle<v8::Object> _exports_uint8Array_obj = _exports_uint8Array_class_0->GetFunction();
| ^
In file included from /usr/include/node/node.h:63,
from /builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:171:
/usr/include/node/v8.h:5947:46: note: candidate: 'v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)'
5947 | V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
| ^~~~~~~~~~~
/usr/include/node/v8.h:5947:46: note: candidate expects 1 argument, 0 provided
/builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:12382:79: error: no matching function for call to 'v8::FunctionTemplate::GetFunction()'
12382 | v8::Handle<v8::Object> _exports_Gpio_obj = _exports_Gpio_class_0->GetFunction();
| ^
In file included from /usr/include/node/node.h:63,
from /builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:171:
/usr/include/node/v8.h:5947:46: note: candidate: 'v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)'
5947 | V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
| ^~~~~~~~~~~
/usr/include/node/v8.h:5947:46: note: candidate expects 1 argument, 0 provided
/builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:12388:77: error: no matching function for call to 'v8::FunctionTemplate::GetFunction()'
12388 | v8::Handle<v8::Object> _exports_I2c_obj = _exports_I2c_class_0->GetFunction();
| ^
In file included from /usr/include/node/node.h:63,
from /builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:171:
/usr/include/node/v8.h:5947:46: note: candidate: 'v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)'
5947 | V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
| ^~~~~~~~~~~
/usr/include/node/v8.h:5947:46: note: candidate expects 1 argument, 0 provided
/builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:12394:77: error: no matching function for call to 'v8::FunctionTemplate::GetFunction()'
12394 | v8::Handle<v8::Object> _exports_Pwm_obj = _exports_Pwm_class_0->GetFunction();
| ^
In file included from /usr/include/node/node.h:63,
from /builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:171:
/usr/include/node/v8.h:5947:46: note: candidate: 'v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)'
5947 | V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
| ^~~~~~~~~~~
/usr/include/node/v8.h:5947:46: note: candidate expects 1 argument, 0 provided
/builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:12400:77: error: no matching function for call to 'v8::FunctionTemplate::GetFunction()'
12400 | v8::Handle<v8::Object> _exports_Spi_obj = _exports_Spi_class_0->GetFunction();
| ^
In file included from /usr/include/node/node.h:63,
from /builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:171:
/usr/include/node/v8.h:5947:46: note: candidate: 'v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)'
5947 | V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
| ^~~~~~~~~~~
/usr/include/node/v8.h:5947:46: note: candidate expects 1 argument, 0 provided
/builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:12406:77: error: no matching function for call to 'v8::FunctionTemplate::GetFunction()'
12406 | v8::Handle<v8::Object> _exports_Aio_obj = _exports_Aio_class_0->GetFunction();
| ^
In file included from /usr/include/node/node.h:63,
from /builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:171:
/usr/include/node/v8.h:5947:46: note: candidate: 'v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)'
5947 | V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
| ^~~~~~~~~~~
/usr/include/node/v8.h:5947:46: note: candidate expects 1 argument, 0 provided
/builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:12412:79: error: no matching function for call to 'v8::FunctionTemplate::GetFunction()'
12412 | v8::Handle<v8::Object> _exports_Uart_obj = _exports_Uart_class_0->GetFunction();
| ^
In file included from /usr/include/node/node.h:63,
from /builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:171:
/usr/include/node/v8.h:5947:46: note: candidate: 'v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)'
5947 | V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
| ^~~~~~~~~~~
/usr/include/node/v8.h:5947:46: note: candidate expects 1 argument, 0 provided
/builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:12418:77: error: no matching function for call to 'v8::FunctionTemplate::GetFunction()'
12418 | v8::Handle<v8::Object> _exports_Led_obj = _exports_Led_class_0->GetFunction();
| ^
In file included from /usr/include/node/node.h:63,
from /builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:171:
/usr/include/node/v8.h:5947:46: note: candidate: 'v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)'
5947 | V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
| ^~~~~~~~~~~
/usr/include/node/v8.h:5947:46: note: candidate expects 1 argument, 0 provided
make[2]: *** [src/javascript/CMakeFiles/mraajs.dir/build.make:66: src/javascript/CMakeFiles/mraajs.dir/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:327: src/javascript/CMakeFiles/mraajs.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
.0/src/python/python3 /builddir/build/BUILD/mraa-2.0.0 /builddir/build/BUILD/mraa-2.0.0/src/python/python3 /builddir/build/BUILD/mraa-2.0.0/src/python/python3/CMakeFiles/_python3-mraa.dir/DependInfo.cmake --color=
Scanning dependencies of target mraajs
make[2]: Leaving directory '/builddir/build/BUILD/mraa-2.0.0'
make -f src/javascript/CMakeFiles/mraajs.dir/build.make src/javascript/CMakeFiles/mraajs.dir/build
make[2]: Entering directory '/builddir/build/BUILD/mraa-2.0.0'
Scanning dependencies of target _python3-mraa
make[2]: Leaving directory '/builddir/build/BUILD/mraa-2.0.0'
make -f src/python/python3/CMakeFiles/_python3-mraa.dir/build.make src/python/python3/CMakeFiles/_python3-mraa.dir/build
[ 34%] Building CXX object src/javascript/CMakeFiles/mraajs.dir/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx.o
cd /builddir/build/BUILD/mraa-2.0.0/src/javascript && /usr/bin/c++ -Dmraajs_EXPORTS -I/builddir/build/BUILD/mraa-2.0.0/api -I/builddir/build/BUILD/mraa-2.0.0/api/mraa -I/builddir/build/BUILD/mraa-2.0.0/include -I/usr/include/json-c -I/usr/include/node -I/builddir/build/BUILD/mraa-2.0.0/src/javascript/.. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wall -Werror=main -Wformat -Wmain -Wuninitialized -Winit-self -Wnon-virtual-dtor -Woverloaded-virtual -Wreorder -fPIC -DBUILDING_NODE_EXTENSION -DSWIGJAVASCRIPT=TRUE -std=gnu++11 -o CMakeFiles/mraajs.dir/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx.o -c /builddir/build/BUILD/mraa-2.0.0/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx
make[2]: Entering directory '/builddir/build/BUILD/mraa-2.0.0'
[ 35%] Building CXX object src/python/python3/CMakeFiles/_python3-mraa.dir/CMakeFiles/_python3-mraa.dir/mraa3PYTHON_wrap.cxx.o
cd /builddir/build/BUILD/mraa-2.0.0/src/python/python3 && /usr/bin/c++ -D_python3_mraa_EXPORTS -I/builddir/build/BUILD/mraa-2.0.0/api -I/builddir/build/BUILD/mraa-2.0.0/api/mraa -I/builddir/build/BUILD/mraa-2.0.0/include -I/usr/include/json-c -I/builddir/build/BUILD/mraa-2.0.0/src/python/python3/../.. -I/usr/include/python3.8 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wall -Werror=main -Wformat -Wmain -Wuninitialized -Winit-self -Wnon-virtual-dtor -Woverloaded-virtual -Wreorder -fPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wall -Werror=main -Wformat -Wmain -Wuninitialized -Winit-self -Werror=implicit -Werror=missing-parameter-type -DONEWIRE=1 -DX86PLAT=1 -DJSONPLAT=1 -DSWIGPYTHON=TRUE -DSWIGPYTHON3=TRUE -o CMakeFiles/_python3-mraa.dir/CMakeFiles/_python3-mraa.dir/mraa3PYTHON_wrap.cxx.o -c /builddir/build/BUILD/mraa-2.0.0/src/python/python3/CMakeFiles/_python3-mraa.dir/mraa3PYTHON_wrap.cxx
make[2]: Leaving directory '/builddir/build/BUILD/mraa-2.0.0'
The noteworthy piece is:
candidate expects 1 argument, 0 provided
Node.js 12.x moved to running atop version 7.4 of v8, which is a backwards-incompatible major version upgrade from Node.js 10.x (which used version 6.8 of v8).
Hi @sgallagher, maybe follow this for now, as I don't think there is a swig patch ready yet.
Hi @Propanu @sgallagher , It does not work either it is better but the compilation fails a bit further :
[ 37%] Building CXX object src/javascript/CMakeFiles/mraajs.dir/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx.o /home/ens-ife/Logiciels/IoT/mraa/build/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx: In function ‘v8::Handle<v8::Value> SWIG_V8_NewPointerObj(void*, swig_type_info*, int)’: /home/ens-ife/Logiciels/IoT/mraa/build/src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx:1188:79: error: no matching function for call to ‘v8::ObjectTemplate::NewInstance()’ 1188 | v8::Local<v8::Object> result = class_templ->InstanceTemplate()->NewInstance(); | ^
I have tried some unsuccessfull tricks but I am not able to contribute on this ;-( . As nodejs is rushing to newer and newer versions node.js 13;x is out we may need to call for support because if we stay stucked on nodejs 10.x all this fantastic software may loose part of its interest. I can help with checking/testing but unfortunately no more. Thanks for this work, hope a solution will come up....
I have tried some unsuccessfull tricks but I am not able to contribute on this ;-( . As nodejs is rushing to newer and newer versions node.js 13;x is out we may need to call for support because if we stay stucked on nodejs 10.x all this fantastic software may loose part of its interest. I can help with checking/testing but unfortunately no more. Thanks for this work, hope a solution will come up....
This is causing us a lot of issues in Fedora, and given there's been no movement upstream and frankly this project appears almost dead, I'm considering just retiring it all.
The problem comes from the interaction between node-swig-C++ . I understand that it requires advanced skills but I do not know any equivalent resource to propose a learning platform for IoT or any type of sensor or any GPIO connected tool enabling programming in three languages. We use Jupyter on raspberries and it is fun and efficiency. It would be very sad that this project vanishes.
The Swig/Node integration has always been quite fragile. I've been a bit busy with other stuff recent and haven't been able to give much time to mraa ontop of the ongoing move to the Eclipse Foundation.
OK thanks for the job anyway. If you tackle the problem let me know.
My feeling is that the problem comes from a function call (v8::ObjectTemplate::NewInstance())
that dos not follow the template picked in V8. It is amatter of context but a adding the context make the compilation fall into a series of bugs. I do not if it could be solved only by changing mraa code or if an action on swig is necessary. I read some exchanges on swig issues concerning NewInstance() then I dropped off due to lack of skills in nodeJS.
Hi @tingleby just a little reminder on that point nothing seems to move on swig side I tested the compilation on a raspi4 with swwig4.0.2 and NodeJS13.5.0 The couple 4.0.1 / 10.16.3 is still working (at least for mraa upm compilation I have not yet tested the tools). If needed I can provide the output with the errors but I thing anybody canget it. happy new year to all...
Trying the patch from [1] with mraa 2.1.0 it still fails with newer NodeJS :(
[1] https://github.com/swig/swig/pull/1702
Trying the patch from [1] with mraa 2.1.0 it still fails with newer NodeJS :(
[1] swig/swig#1702
As documented on this PR / issue, my patch is incomplete because I've only tested on our usecase. Feel free to help getting the PR to work properly with Travis to help getting more coverage.
The main issue for me is the f->Call()
invocation in api/mraa/gpio.hpp
:
f->Call(SWIGV8_CURRENT_CONTEXT()->Global(), argc, argv);
In the recent Node.js versions it requires 4 parameters instead of 3 (see API)
The errors related to the Buffer can be worked around via just invoking the code parts for SWIG_V8_VERSION > 0x040000
in src/javascript/mraajs.i
.
This seems to be working.
--- a/api/mraa/gpio.hpp
+++ b/api/mraa/gpio.hpp
@@ -175,7 +175,11 @@
v8::Local<v8::Value> argv[] = { SWIGV8_INTEGER_NEW(-1) };
#if NODE_MODULE_VERSION >= 0x000D
v8::Local<v8::Function> f = v8::Local<v8::Function>::New(v8::Isolate::GetCurrent(), This->m_v8isr);
+#if NODE_MODULE_VERSION >= 72
+ f->Call(SWIGV8_CURRENT_CONTEXT(), SWIGV8_CURRENT_CONTEXT()->Global(), argc, argv);
+#else
f->Call(SWIGV8_CURRENT_CONTEXT()->Global(), argc, argv);
+#endif
#else
This->m_v8isr->Call(SWIGV8_CURRENT_CONTEXT()->Global(), argc, argv);
#endif
@nxhack is this with the latest version of SWIG, or does it also require the unmerged patches I mentioned earlier on this issue?
Since the latest versions of node don't compile out of the box we decided to disable node.js builds by default for the next release. Easy to undo in a future release when all the needed bits are in place. Thanks.
@Propanu
This is a case of applying the patch we are considering in SWIG. https://github.com/swig/swig/pull/1746
I've applied these patches to the OpenWrt packages I maintain and so far there don't seem to be any reports of problems. (I don't know how many users are out there.) https://github.com/openwrt/packages/blob/master/utils/swig/patches/000-support_v12.patch https://github.com/openwrt/packages/blob/master/libs/libmraa/patches/020-support_v12.patch
(This OpenWrt package is intended for node v12 and above.)
Hi @Propanu @nxhack ,Thanks for your work, I tried your patch on current master mraa
with current node (node-v15.0.1-linux-armv7l) and current swig (Version: 4.1.0), compiled on raspberyPi debian buster (Linux raspife3 4.19.127-v7 #1 SMP Sun Oct 4 15:17:59 CEST 2020 armv7l GNU/Linux)
Compilation fails with 45 errors (17 first occurences are listed below), I am not able to build patches but I can test solutions if any proposal. It seems that v8::MaybeLocalv8::String errors disappear using ToLocalChecked()
. IT is strange that some Handlev8::Value& are still there. Here are some of the solutions to reduce the number of compilation errors (not sure they are working yet) if it may help someone who knows howto introduce stable modifications.
#define SWIGV8_STRING_NEW(str) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), str).ToLocalChecked()
#define SWIGV8_SYMBOL_NEW(sym) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), sym).ToLocalChecked()
//#define SWIGV8_STRING_NEW2(cstr, len) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), cstr, v8::String::kNormalString, len)
#define SWIGV8_STRING_NEW2(cstr, len) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), cstr, v8::NewStringType::kNormal, len).ToLocalChecked()
//cdata->handle.MarkIndependent();
cdata->handle.SetWeak()
//_exports_uint8Array_class_0->SetHiddenPrototype(true);
_exports_uint8Array_class_0->ReadOnlyPrototype();
//v8::Local<v8::Object> _exports_uint8Array_obj = _exports_uint8Array_class_0->GetFunction();
v8::Handle<v8::Object> _exports_uint8Array_obj = _exports_uint8Array_class_0->NewRemoteInstance().ToLocalChecked();
//_exports_Gpio_class_0->SetHiddenPrototype(true);
_exports_Gpio_class_0->ReadOnlyPrototype();
//v8::Handle<v8::Object> _exports_Gpio_obj = _exports_Gpio_class_0->GetFunction();
v8::Handle<v8::Object> _exports_Gpio_obj = _exports_Gpio_class_0->NewRemoteInstance().ToLocalChecked();
//_exports_I2c_class_0->SetHiddenPrototype(true);
_exports_I2c_class_0->ReadOnlyPrototype();
//v8::Handle<v8::Object> _exports_I2c_obj = _exports_I2c_class_0->GetFunction();
v8::Handle<v8::Object> _exports_I2c_obj = _exports_I2c_class_0->NewRemoteInstance().ToLocalChecked();
//_exports_Pwm_class_0->SetHiddenPrototype(true);
_exports_Pwm_class_0->ReadOnlyPrototype();
//v8::Handle<v8::Object> _exports_Pwm_obj = _exports_Pwm_class_0->GetFunction();
v8::Handle<v8::Object> _exports_Pwm_obj = _exports_Pwm_class_0->NewRemoteInstance().ToLocalChecked();
//_exports_Spi_class_0->SetHiddenPrototype(true);
_exports_Spi_class_0->ReadOnlyPrototype();
//v8::Handle<v8::Object> _exports_Spi_obj = _exports_Spi_class_0->GetFunction();
v8::Handle<v8::Object> _exports_Spi_obj = _exports_Spi_class_0->NewRemoteInstance().ToLocalChecked();
//_exports_Aio_class_0->SetHiddenPrototype(true);
_exports_Aio_class_0->ReadOnlyPrototype();
//v8::Handle<v8::Object> _exports_Aio_obj = _exports_Aio_class_0->GetFunction();
v8::Handle<v8::Object> _exports_Aio_obj = _exports_Aio_class_0->NewRemoteInstance().ToLocalChecked();
//_exports_Uart_class_0->SetHiddenPrototype(true);
_exports_Uart_class_0->ReadOnlyPrototype();
//v8::Handle<v8::Object> _exports_Uart_obj = _exports_Uart_class_0->GetFunction();
v8::Handle<v8::Object> _exports_Uart_obj = _exports_Uart_class_0->NewRemoteInstance().ToLocalChecked();
//_exports_Led_class_0->SetHiddenPrototype(true);
_exports_Led_class_0->ReadOnlyPrototype();
//v8::Handle<v8::Object> _exports_Led_obj = _exports_Led_class_0->GetFunction();
v8::Handle<v8::Object> _exports_Led_obj = _exports_Led_class_0->NewRemoteInstance().ToLocalChecked();
exports_obj->Set(SWIGV8_CURRENT_CONTEXT(), _exports_uint8Array_obj, SWIGV8_SYMBOL_NEW("uint8Array").ToLocalChecked());
exports_obj->Set(SWIGV8_CURRENT_CONTEXT(), _exports_Gpio_obj, SWIGV8_SYMBOL_NEW("Gpio").ToLocalChecked());
exports_obj->Set(SWIGV8_CURRENT_CONTEXT(), _exports_I2c_obj, SWIGV8_SYMBOL_NEW("I2c").ToLocalChecked());
exports_obj->Set(SWIGV8_CURRENT_CONTEXT(), _exports_Pwm_obj, SWIGV8_SYMBOL_NEW("Pwm").ToLocalChecked());
exports_obj->Set(SWIGV8_CURRENT_CONTEXT(), _exports_Spi_obj, SWIGV8_SYMBOL_NEW("Spi").ToLocalChecked());
exports_obj->Set(SWIGV8_CURRENT_CONTEXT(), _exports_Aio_obj, SWIGV8_SYMBOL_NEW("Aio").ToLocalChecked());
exports_obj->Set(SWIGV8_CURRENT_CONTEXT(), _exports_Uart_obj, SWIGV8_SYMBOL_NEW("Uart").ToLocalChecked());
exports_obj->Set(SWIGV8_CURRENT_CONTEXT(), _exports_Led_obj, SWIGV8_SYMBOL_NEW("Led").ToLocalChecked());
mraajsJAVASCRIPT_wrap.cxx:903:69: error: no matching function for call to ‘v8::Exception::Error(v8::MaybeLocal<v8::String>)’
mraajsJAVASCRIPT_wrap.cxx: In member function ‘virtual void OverloadErrorHandler::error(int, const char*)’:
mraajsJAVASCRIPT_wrap.cxx:1137:17: error: ‘class v8::Persistent<v8::Object>’ has no member named ‘MarkIndependent’
mraajsJAVASCRIPT_wrap.cxx:1188:79: error: no matching function for call to ‘v8::ObjectTemplate::NewInstance()’
mraajsJAVASCRIPT_wrap.cxx:1285:128: error: no matching function for call to ‘v8::Private::ForApi(v8::Isolate*, v8::MaybeLocal<v8::String>)’
mraajsJAVASCRIPT_wrap.cxx:887:85: error: no matching function for call to ‘v8::Value::BooleanValue(v8::Local<v8::Context>)’
mraajsJAVASCRIPT_wrap.cxx:1412:17: error: ‘class v8::Persistent<v8::Object>’ has no member named ‘MarkIndependent’
mraajsJAVASCRIPT_wrap.cxx:1444:30: error: no matching function for call to ‘v8::Array::Set(uint32_t, v8::Handle<v8::Value>&)’
mraajsJAVASCRIPT_wrap.cxx:1476:56: error: no matching function for call to ‘v8::FunctionTemplate::SetClassName(v8::MaybeLocal<v8::String>)’
mraajsJAVASCRIPT_wrap.cxx:1482:96: error: no matching function for call to ‘v8::ObjectTemplate::Set(v8::MaybeLocal<v8::String>, v8::Local<v8::FunctionTemplate>)’
mraajsJAVASCRIPT_wrap.cxx:1505:69: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::MaybeLocal<v8::String>, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&))’
mraajsJAVASCRIPT_wrap.cxx:1513:83: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
mraajsJAVASCRIPT_wrap.cxx:1524:87: error: no matching function for call to ‘v8::Object::SetAccessor(v8::Local<v8::Context>, v8::MaybeLocal<v8::String>, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&))’
mraajsJAVASCRIPT_wrap.cxx:785:108: error: ‘kNormalString’ is not a member of ‘v8::String’
mraajsJAVASCRIPT_wrap.cxx:12395:30: error: ‘class v8::FunctionTemplate’ has no member named ‘SetHiddenPrototype’; did you mean ‘RemovePrototype’?
mraajsJAVASCRIPT_wrap.cxx:12396:91: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
mraajsJAVASCRIPT_wrap.cxx:12485:76: error: no matching function for call to ‘v8::Object::Set(v8::MaybeLocal<v8::String>, v8::Handle<v8::Object>&)’
Lack of "SWIG_V8_VERSION" consistency seems to be the root cause of this problem.
https://github.com/eclipse/mraa/issues/1040#issuecomment-828957352
While checking the handling of "SWIG_V8_VERSION" on the SWIG side, I made a patch for mraa and upm.
SWIG: https://github.com/swig/swig/pull/2011#issuecomment-830914401
MRAA: https://github.com/eclipse/mraa/pull/1064
UPM: https://github.com/eclipse/upm/pull/703