Skip to content

Failed to build with node 12.1.0 #46

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

Closed
ProgramFan opened this issue May 7, 2019 · 7 comments · Fixed by #45
Closed

Failed to build with node 12.1.0 #46

ProgramFan opened this issue May 7, 2019 · 7 comments · Fixed by #45
Labels

Comments

@ProgramFan
Copy link

npm install tree-sitter failed on macOS mojave 10.14.4, with the following errors:

> [email protected] install /Users/zyang/node_modules/tree-sitter
> prebuild-install || node-gyp rebuild

  CC(target) Release/obj.target/tree_sitter/vendor/tree-sitter/lib/src/lib.o
  LIBTOOL-STATIC Release/tree_sitter.a
  CXX(target) Release/obj.target/tree_sitter_runtime_binding/src/binding.o
  CXX(target) Release/obj.target/tree_sitter_runtime_binding/src/conversions.o
../src/conversions.cc:105:41: error: too few arguments to function call, single
      argument 'context' was not specified
  if (std::isfinite(js_row->NumberValue())) {
                    ~~~~~~~~~~~~~~~~~~~ ^
/Users/zyang/.node-gyp/12.1.0/include/node/v8.h:2564:3: note: 'NumberValue'
      declared here
  V8_WARN_UNUSED_RESULT Maybe<double> NumberValue(Local<Context> context) const;
  ^
/Users/zyang/.node-gyp/12.1.0/include/node/v8config.h:347:31: note: expanded
      from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/conversions.cc:106:52: error: too few arguments to function call, single
      argument 'context' was not specified
    row = static_cast<uint32_t>(js_row->Int32Value());
                                ~~~~~~~~~~~~~~~~~~ ^
/Users/zyang/.node-gyp/12.1.0/include/node/v8.h:2569:3: note: 'Int32Value'
      declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
  ^
/Users/zyang/.node-gyp/12.1.0/include/node/v8config.h:347:31: note: expanded
      from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/conversions.cc:111:44: error: too few arguments to function call, single
      argument 'context' was not specified
  if (std::isfinite(js_column->NumberValue())) {
                    ~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/zyang/.node-gyp/12.1.0/include/node/v8.h:2564:3: note: 'NumberValue'
      declared here
  V8_WARN_UNUSED_RESULT Maybe<double> NumberValue(Local<Context> context) const;
  ^
/Users/zyang/.node-gyp/12.1.0/include/node/v8config.h:347:31: note: expanded
      from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/conversions.cc:112:58: error: too few arguments to function call, single
      argument 'context' was not specified
    column = static_cast<uint32_t>(js_column->Int32Value()) * BYTES_PER_...
                                   ~~~~~~~~~~~~~~~~~~~~~ ^
/Users/zyang/.node-gyp/12.1.0/include/node/v8.h:2569:3: note: 'Int32Value'
      declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
  ^
/Users/zyang/.node-gyp/12.1.0/include/node/v8config.h:347:31: note: expanded
      from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/conversions.cc:130:47: error: too few arguments to function call, single
      argument 'context' was not specified
  return Nan::Just<uint32_t>(arg->Uint32Value() * BYTES_PER_CHARACTER);
                             ~~~~~~~~~~~~~~~~ ^
/Users/zyang/.node-gyp/12.1.0/include/node/v8.h:2567:3: note: 'Uint32Value'
      declared here
  V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
  ^
/Users/zyang/.node-gyp/12.1.0/include/node/v8config.h:347:31: note: expanded
      from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
13 warnings and 5 errors generated.
make: *** [Release/obj.target/tree_sitter_runtime_binding/src/conversions.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Darwin 18.5.0
gyp ERR! command "/usr/local/Cellar/node/12.1.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/zyang/node_modules/tree-sitter
gyp ERR! node -v v12.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

It seems that conversions.cc uses in-capatible v8 API?

@issue-label-bot issue-label-bot bot added the bug label May 7, 2019
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.94. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@Arcanemagus
Copy link

You can follow the work on getting this running here: #45

@maxbrunsfeld maxbrunsfeld changed the title Failed to build on macOS with node 12.1.0 Failed to build with node 12.1.0 May 7, 2019
@mayankmit2002
Copy link

rebuild-install WARN install No prebuilt binaries found (target=12.1.0 runtime=node arch=x64 libc= platform=darwin)
CC(target) Release/obj.target/tree_sitter/vendor/tree-sitter/lib/src/lib.o
LIBTOOL-STATIC Release/tree_sitter.a
CXX(target) Release/obj.target/tree_sitter_runtime_binding/src/binding.o
CXX(target) Release/obj.target/tree_sitter_runtime_binding/src/conversions.o
../src/conversions.cc:32:12: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
exports->Set(Nan::New("pointTransferArray").ToLocalChecked(), Uint32Array::New(js_point_transfer_buffer, 0, 2));
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version",
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator attribute((deprecated(message)))
^
../src/conversions.cc:42:11: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
result->Set(Nan::New(start_position_key), PointToJS(range.start_point));
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version",
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator attribute((deprecated(message)))
^
../src/conversions.cc:43:11: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
result->Set(Nan::New(start_index_key), ByteCountToJS(range.start_byte));
I'm also facing similar issue on OSX Mojave 10.14.5

/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version",
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator attribute((deprecated(message)))
^
../src/conversions.cc:44:11: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
result->Set(Nan::New(end_position_key), PointToJS(range.end_point));
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version",
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator attribute((deprecated(message)))
^
../src/conversions.cc:45:11: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
result->Set(Nan::New(end_index_key), ByteCountToJS(range.end_byte));
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version",
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator attribute((deprecated(message)))
^
../src/conversions.cc:68:3: warning: 'Get' is deprecated: Use maybe version [-Wdeprecated-declarations]
INIT(start_point, start_position_key, PointFromJS);
^
../src/conversions.cc:60:33: note: expanded from macro 'INIT'
auto field = Type(js_range->Get(Nan::New(key)));
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8.h:3412:3: note: 'Get' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version", Local Get(Local key));
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator attribute((deprecated(message)))
^
../src/conversions.cc:69:3: warning: 'Get' is deprecated: Use maybe version [-Wdeprecated-declarations]
INIT(end_point, end_position_key, PointFromJS);
^
../src/conversions.cc:60:33: note: expanded from macro 'INIT'
auto field = Type(js_range->Get(Nan::New(key)));
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8.h:3412:3: note: 'Get' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version", Local Get(Local key));
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator attribute((deprecated(message)))
^
../src/conversions.cc:70:3: warning: 'Get' is deprecated: Use maybe version [-Wdeprecated-declarations]
INIT(start_byte, start_index_key, ByteCountFromJS);
^
../src/conversions.cc:60:33: note: expanded from macro 'INIT'
auto field = Type(js_range->Get(Nan::New(key)));
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8.h:3412:3: note: 'Get' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version", Local Get(Local key));
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator attribute((deprecated(message)))
^
../src/conversions.cc:71:3: warning: 'Get' is deprecated: Use maybe version [-Wdeprecated-declarations]
INIT(end_byte, end_index_key, ByteCountFromJS);
^
../src/conversions.cc:60:33: note: expanded from macro 'INIT'
auto field = Type(js_range->Get(Nan::New(key)));
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8.h:3412:3: note: 'Get' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version", Local Get(Local key));
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator attribute((deprecated(message)))
^
../src/conversions.cc:80:11: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
result->Set(Nan::New(row_key), Nan::New(point.row));
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version",
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator attribute((deprecated(message)))
^
../src/conversions.cc:81:11: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
result->Set(Nan::New(column_key), ByteCountToJS(point.column));
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version",
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator attribute((deprecated(message)))
^
../src/conversions.cc:92:35: warning: 'Get' is deprecated: Use maybe version [-Wdeprecated-declarations]
Local js_row = js_point->Get(Nan::New(row_key));
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8.h:3412:3: note: 'Get' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version", Local Get(Local key));
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator attribute((deprecated(message)))
^
../src/conversions.cc:98:38: warning: 'Get' is deprecated: Use maybe version [-Wdeprecated-declarations]
Local js_column = js_point->Get(Nan::New(column_key));
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8.h:3412:3: note: 'Get' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version", Local Get(Local key));
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator attribute((deprecated(message)))
^
../src/conversions.cc:105:41: error: too few arguments to function call, single argument 'context' was not specified
if (std::isfinite(js_row->NumberValue())) {
~~~~~~~~~~~~~~~~~~~ ^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8.h:2564:3: note: 'NumberValue' declared here
V8_WARN_UNUSED_RESULT Maybe NumberValue(Local context) const;
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8config.h:347:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT attribute((warn_unused_result))
^
../src/conversions.cc:106:52: error: too few arguments to function call, single argument 'context' was not specified
row = static_cast<uint32_t>(js_row->Int32Value());
~~~~~~~~~~~~~~~~~~ ^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8.h:2569:3: note: 'Int32Value' declared here
V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local context) const;
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8config.h:347:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT attribute((warn_unused_result))
^
../src/conversions.cc:111:44: error: too few arguments to function call, single argument 'context' was not specified
if (std::isfinite(js_column->NumberValue())) {
~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8.h:2564:3: note: 'NumberValue' declared here
V8_WARN_UNUSED_RESULT Maybe NumberValue(Local context) const;
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8config.h:347:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT attribute((warn_unused_result))
^
../src/conversions.cc:112:58: error: too few arguments to function call, single argument 'context' was not specified
column = static_cast<uint32_t>(js_column->Int32Value()) * BYTES_PER_CHARACTER;
~~~~~~~~~~~~~~~~~~~~~ ^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8.h:2569:3: note: 'Int32Value' declared here
V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local context) const;
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8config.h:347:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT attribute((warn_unused_result))
^
../src/conversions.cc:130:47: error: too few arguments to function call, single argument 'context' was not specified
return Nan::Just<uint32_t>(arg->Uint32Value() * BYTES_PER_CHARACTER);
~~~~~~~~~~~~~~~~ ^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8.h:2567:3: note: 'Uint32Value' declared here
V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
^
/Users/mayankmittal/.node-gyp/12.1.0/include/node/v8config.h:347:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT attribute((warn_unused_result))

Is there workaround to go through it?

@akurtakov
Copy link

Any hope for this one? Can I help somehow?

@mayankmit2002
Copy link

No success yet. It would be a great help if you can suggest some work around

@maxbrunsfeld
Copy link
Contributor

Can I help somehow?

Yeah, I started work on this at #45, but have not had time to finish yet. If you're interested, feel free to work off of that branch.

It would be a great help if you can suggest some work around

The current workarounds are:

  • Do not use node 12
  • Use the WASM-based binding web-tree-sitter (which has almost the same interface) instead of this module.

Shados added a commit to Shados/nix-config-shared that referenced this issue Aug 22, 2019
node-10 due to downstream bug with node-12 support
(tree-sitter/node-tree-sitter#46)
@skovhus
Copy link

skovhus commented Sep 21, 2019

@maxbrunsfeld would you recommend that we start using tree-sitter-wasm instead of the node version in bash-language-server? Currently, we have more and more user upgrading to node 12.

Thanks for your help!

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.

6 participants