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

Installation of 0.19.0 crashes ungracefully #1078

Closed
johanrosenkilde opened this issue Apr 28, 2021 · 4 comments
Closed

Installation of 0.19.0 crashes ungracefully #1078

johanrosenkilde opened this issue Apr 28, 2021 · 4 comments
Labels

Comments

@johanrosenkilde
Copy link

johanrosenkilde commented Apr 28, 2021

debug.log
In an empty folder on my machine, running npm install tree-sitter@0.19.0 results in the following error:

github/repos/t :( npm install tree-sitter@0.19.0
npm ERR! code 1
npm ERR! path /Users/johanrosenkilde/github/repos/t/node_modules/tree-sitter
npm ERR! command failed
npm ERR! command sh -c prebuild-install || node-gyp rebuild
npm ERR! CC(target) Release/obj.target/tree_sitter/vendor/tree-sitter/lib/src/lib.o
npm ERR!   LIBTOOL-STATIC Release/tree_sitter.a
npm ERR!   CXX(target) Release/obj.target/tree_sitter_runtime_binding/src/binding.o
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@16.0.0 | darwin | x64
npm ERR! gyp info find Python using Python version 3.9.4 found at "/usr/local/opt/python@3.9/bin/python3.9"
npm ERR! (node:75522) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn /usr/local/opt/python@3.9/bin/python3.9
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/johanrosenkilde/github/repos/t/node_modules/tree-sitter/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/johanrosenkilde/Library/Caches/node-gyp/16.0.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/johanrosenkilde/Library/Caches/node-gyp/16.0.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/johanrosenkilde/Library/Caches/node-gyp/16.0.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/johanrosenkilde/github/repos/t/node_modules/tree-sitter',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../src/binding.cc:1:
npm ERR! In file included from /Users/johanrosenkilde/Library/Caches/node-gyp/16.0.0/include/node/node.h:63:
npm ERR! In file included from /Users/johanrosenkilde/Library/Caches/node-gyp/16.0.0/include/node/v8.h:30:
npm ERR! /Users/johanrosenkilde/Library/Caches/node-gyp/16.0.0/include/node/v8-internal.h:452:38: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'?
npm ERR!             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR!                                 ~~~~~^~~~~~~~~~~
npm ERR!                                      remove_cv
npm ERR! /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:697:50: note: 'remove_cv' declared here
npm ERR! template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
npm ERR!                                                  ^
npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/tree_sitter_runtime_binding/src/binding.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 19.6.0
npm ERR! gyp ERR! command "/usr/local/Cellar/node/16.0.0_1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/johanrosenkilde/github/repos/t/node_modules/tree-sitter
npm ERR! gyp ERR! node -v v16.0.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

I've attached the complete log.

I'm running Mac OS X Darwin and the following versions:

$ node --version
v16.0.0

$ npm --version
7.10.0

$ gcc --version
configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Let me know what other information you would need.

@dcreager
Copy link
Contributor

dcreager commented May 3, 2021

It looks like this is related to nodejs/node#38367, with a regression introduced in node 16.

Other projects look like they're solving this by bumping the required C++ standard to C++14: sass/node-sass#3091 @maxbrunsfeld what's the easiest way to do that? Do we update the template bindings.gyp and then regenerate all of the grammars?

In the meantime, @johanrosenkilde, can you try downgrading to your node installation? (I'm on Linux, so this might be wrong, but I think the magic incantation is brew install node@14.)

@maxbrunsfeld
Copy link
Contributor

Maybe we need to add a change like this in the binding.gyp file of the Node Tree-sitter binding?

@johanrosenkilde
Copy link
Author

@dcreager Thanks a lot for the work-around! I couldn't get brew to install node@14 as the system-wide default, but using nvm I managed to run everything on Node 14 and it's back to working :-)

@ahlinc ahlinc added the bug label Aug 27, 2021
@ahlinc
Copy link
Contributor

ahlinc commented Sep 17, 2021

This issue seems where resolved by the following PR: tree-sitter/node-tree-sitter#92

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

No branches or pull requests

4 participants