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

Node build with ABI 111(node 19) is failing #545

Closed
acalcutt opened this issue Oct 24, 2022 · 1 comment · Fixed by #853
Closed

Node build with ABI 111(node 19) is failing #545

acalcutt opened this issue Oct 24, 2022 · 1 comment · Fixed by #853
Labels

Comments

@acalcutt
Copy link
Collaborator

acalcutt commented Oct 24, 2022

note we have already worked around this with #542 , but it needs a proper fix. For now we have excluded ABI 111 in platform/node/CMakeLists.txt so the error does not show.

When the node 19/ABI 111 headers are included, the build gets several errors like

FAILED: platform/node/CMakeFiles/mbgl-node.abi-111.dir/src/node_map.cpp.o
ccache /usr/bin/g++-10 -DBUILDING_NODE_EXTENSION -DMODULE_NAME=mbgl_node -DRAPIDJSON_HAS_STDSTRING=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dmbgl_node_abi_111_EXPORTS -I../include -I../platform/default/include -I../src -isystem headers/node/v19.0.0 -isystem headers/nan/2.14.2 -isystem ../vendor/mapbox-base/include -isystem ../vendor/mapbox-base/extras/expected-lite/include -isystem ../vendor/mapbox-base/deps/geojson-vt-cpp/include -isystem ../vendor/mapbox-base/deps/geojson.hpp/include -isystem ../vendor/mapbox-base/deps/geometry.hpp/include -isystem ../vendor/mapbox-base/deps/jni.hpp/include -isystem ../vendor/mapbox-base/deps/optional -isystem ../vendor/mapbox-base/deps/pixelmatch-cpp/include -isystem ../vendor/mapbox-base/deps/shelf-pack-cpp/include -isystem ../vendor/mapbox-base/deps/supercluster.hpp/include -isystem ../vendor/mapbox-base/deps/variant/include -isystem ../vendor/mapbox-base/deps/cheap-ruler-cpp/include -isystem ../vendor/mapbox-base/extras/rapidjson/include -O3 -DNDEBUG -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -std=c++17 -MD -MT platform/node/CMakeFiles/mbgl-node.abi-111.dir/src/node_map.cpp.o -MF platform/node/CMakeFiles/mbgl-node.abi-111.dir/src/node_map.cpp.o.d -o platform/node/CMakeFiles/mbgl-node.abi-111.dir/src/node_map.cpp.o -c ../platform/node/src/node_map.cpp
In file included from headers/nan/2.14.2/nan.h:176,
from ../platform/node/src/node_map.hpp:15,
from ../platform/node/src/node_map.cpp:1:
headers/nan/2.14.2/nan_callbacks.h:55:23: error: ‘AccessorSignature’ is not a member of ‘v8’
55 | typedef v8::Localv8::AccessorSignature Sig;
| ^~~~~~~~~~~~~~~~~
headers/nan/2.14.2/nan_callbacks.h:55:40: error: template argument 1 is invalid
55 | typedef v8::Localv8::AccessorSignature Sig;
| ^
In file included from ../platform/node/src/node_map.hpp:15,
from ../platform/node/src/node_map.cpp:1:
headers/nan/2.14.2/nan.h: In function ‘void Nan::SetAccessor(v8::Localv8::ObjectTemplate, v8::Localv8::String, Nan::GetterCallback, Nan::SetterCallback, v8::Localv8::Value, v8::AccessControl, v8::PropertyAttribute, Nan:👿:Sig)’:
headers/nan/2.14.2/nan.h:2549:16: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Localv8::String&, void (&)(v8::Localv8::Name, const v8::PropertyCallbackInfov8::Value&), void (&)(v8::Localv8::Name, v8::Localv8::Value, const v8::PropertyCallbackInfo&), v8::Localv8::Object&, v8::AccessControl&, v8::PropertyAttribute&, Nan:👿:Sig&)’
2549 | , signature);
| ^
In file included from headers/node/v19.0.0/v8-function.h:15,
from headers/node/v19.0.0/v8.h:33,
from headers/node/v19.0.0/node.h:73,
from headers/nan/2.14.2/nan.h:56,
from ../platform/node/src/node_map.hpp:15,
from ../platform/node/src/node_map.cpp:1:
headers/node/v19.0.0/v8-template.h:807:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Localv8::String, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Localv8::Value, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
807 | void SetAccessor(
| ^~~~~~~~~~~
headers/node/v19.0.0/v8-template.h:812:22: note: no known conversion for argument 7 from ‘Nan:👿:Sig’ {aka ‘int’} to ‘v8::SideEffectType’
812 | SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
headers/node/v19.0.0/v8-template.h:814:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Localv8::Name, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Localv8::Value, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
814 | void SetAccessor(
| ^~~~~~~~~~~
headers/node/v19.0.0/v8-template.h:819:22: note: no known conversion for argument 7 from ‘Nan:👿:Sig’ {aka ‘int’} to ‘v8::SideEffectType’
819 | SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../platform/node/src/node_map.cpp: In static member function ‘static void node_mbgl::NodeMap::Init(v8::Localv8::Object)’:
../platform/node/src/node_map.cpp:121:46: error: ‘class v8::Object’ has no member named ‘CreationContext’; did you mean ‘GetCreationContext’?
121 | v8::Localv8::Context context = target->CreationContext();
| ^~~~~~~~~~~~~~~
| GetCreationContext
[643/668] Building C object CMakeFiles/mbgl-vendor-sqlite.dir/vendor/sqlite/src/sqlite3.c.o
../vendor/sqlite/src/sqlite3.c: In function ‘sqlite3SelectNew’:
../vendor/sqlite/src/sqlite3.c:121468:10: warning: function may return address of local variable [-Wreturn-local-addr]
121468 | return pNew;
| ^~~~
../vendor/sqlite/src/sqlite3.c:121430:10: note: declared here
121430 | Select standin;
| ^~~~~~~
../vendor/sqlite/src/sqlite3.c:121430:10: note: declared here
ninja: build stopped: subcommand failed.

To test this, you would have to remove the exclusion of ABI 111 in platform/node/CMakeLists.txt

@acalcutt
Copy link
Collaborator Author

maybe a 'nan' issue? nodejs/nan#943 . I know we use that but I'm not really familiar with how it is included.

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

Successfully merging a pull request may close this issue.

2 participants