claytonrcarter / tree-sitter-phpdoc

PHPDoc grammar for tree-sitter
22 stars 10 forks source link

Error when compiling #8

Closed camilledejoye closed 2 years ago

camilledejoye commented 2 years ago

Hello,

The compilation fail for this parser, I was wondering if you would have any idea about why. Here is the complete log on failure:

0 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install' ]
1 info using npm@8.3.2
2 info using node@v17.3.0
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/home/cdejoye/.local/share/nvim/tree-sitter-phpdoc/.npmrc Completed in 3ms
10 timing config:load:project Completed in 4ms
11 timing config:load:file:/home/cdejoye/.npmrc Completed in 2ms
12 timing config:load:user Completed in 2ms
13 timing config:load:file:/usr/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 12ms
19 timing npm:load:configload Completed in 12ms
20 timing npm:load:setTitle Completed in 0ms
21 timing config:load:flatten Completed in 2ms
22 timing npm:load:display Completed in 2ms
23 verbose logfile /home/cdejoye/.npm/_logs/2022-01-22T10_10_35_704Z-debug-0.log
24 timing npm:load:logFile Completed in 4ms
25 timing npm:load:timers Completed in 0ms
26 timing npm:load:configScope Completed in 0ms
27 timing npm:load Completed in 19ms
28 timing arborist:ctor Completed in 0ms
29 silly logfile start cleaning logs, removing 1 files
30 timing idealTree:init Completed in 16ms
31 warn old lockfile
31 warn old lockfile The package-lock.json file was created with an old version of npm,
31 warn old lockfile so supplemental metadata must be fetched from the registry.
31 warn old lockfile
31 warn old lockfile This is a one-time fix-up, please be patient...
31 warn old lockfile
32 silly inflate node_modules/nan
33 silly inflate node_modules/tree-sitter-cli
34 silly inflate node_modules/tree-sitter-php
35 http fetch GET 200 https://registry.npmjs.org/nan 264ms (cache revalidated)
36 http fetch GET 200 https://codeload.github.com/tree-sitter/tree-sitter-php/tar.gz/50c6951130d6de7f8e17dd4f60b66f29d482dde1 374ms (cache revalidated)
37 http fetch GET 200 https://registry.npmjs.org/tree-sitter-cli 940ms (cache revalidated)
38 timing idealTree:inflate Completed in 15962ms
39 timing idealTree:userRequests Completed in 0ms
40 silly idealTree buildDeps
41 timing idealTree:#root Completed in 0ms
42 timing idealTree:buildDeps Completed in 1ms
43 timing idealTree:fixDepFlags Completed in 0ms
44 timing idealTree Completed in 15980ms
45 timing reify:loadTrees Completed in 15980ms
46 timing reify:diffTrees Completed in 1ms
47 silly reify moves {}
48 timing reify:retireShallow Completed in 1ms
49 timing reify:createSparse Completed in 2ms
50 timing reify:loadBundles Completed in 0ms
51 silly audit bulk request {
51 silly audit   nan: [ '2.14.0' ],
51 silly audit   'tree-sitter-cli': [ '0.17.3' ],
51 silly audit   'tree-sitter-php': [ '0.19.0' ]
51 silly audit }
52 timing reifyNode:node_modules/tree-sitter-cli Completed in 12ms
53 timing reifyNode:node_modules/nan Completed in 22ms
54 http fetch GET 200 https://codeload.github.com/tree-sitter/tree-sitter-php/tar.gz/50c6951130d6de7f8e17dd4f60b66f29d482dde1 263ms (cache revalidated)
55 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 308ms
56 timing auditReport:getReport Completed in 310ms
57 silly audit report {}
58 timing auditReport:init Completed in 0ms
59 timing reify:audit Completed in 311ms
60 timing reifyNode:node_modules/tree-sitter-php Completed in 13430ms
61 timing reify:unpack Completed in 13430ms
62 timing reify:unretire Completed in 1ms
63 timing build:queue Completed in 3ms
64 timing build:link:node_modules/tree-sitter-cli Completed in 3ms
65 timing build:link Completed in 3ms
66 info run tree-sitter-cli@0.17.3 install node_modules/tree-sitter-cli node install.js
67 info run tree-sitter-php@0.19.0 install node_modules/tree-sitter-php node-gyp rebuild
68 info run tree-sitter-php@0.19.0 install { code: 1, signal: null }
69 timing reify:rollback:createSparse Completed in 15ms
70 timing reify:rollback:retireShallow Completed in 0ms
71 timing command:install Completed in 31873ms
72 verbose stack Error: command failed
72 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
72 verbose stack     at ChildProcess.emit (node:events:390:28)
72 verbose stack     at maybeClose (node:internal/child_process:1062:16)
72 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
73 verbose pkgid tree-sitter-php@0.19.0
74 verbose cwd /home/cdejoye/.local/share/nvim/tree-sitter-phpdoc
75 verbose Linux 5.16.1-arch1-1
76 verbose argv "/usr/bin/node" "/usr/bin/npm" "install"
77 verbose node v17.3.0
78 verbose npm  v8.3.2
79 error code 1
80 error path /home/cdejoye/.local/share/nvim/tree-sitter-phpdoc/node_modules/tree-sitter-php
81 error command failed
82 error command sh -c node-gyp rebuild
83 error make: Entering directory '/home/cdejoye/.local/share/nvim/tree-sitter-phpdoc/node_modules/tree-sitter-php/build'
83 error   CC(target) Release/obj.target/tree_sitter_php_binding/src/parser.o
83 error   CXX(target) Release/obj.target/tree_sitter_php_binding/src/scanner.o
83 error   CXX(target) Release/obj.target/tree_sitter_php_binding/bindings/node/binding.o
83 error make: Leaving directory '/home/cdejoye/.local/share/nvim/tree-sitter-phpdoc/node_modules/tree-sitter-php/build'
84 error gyp info it worked if it ends with ok
84 error gyp info using node-gyp@8.4.1
84 error gyp info using node@17.3.0 | linux | x64
84 error gyp info find Python using Python version 3.10.1 found at "/usr/bin/python3"
84 error gyp info spawn /usr/bin/python3
84 error gyp info spawn args [
84 error gyp info spawn args   '/usr/lib/node_modules/node-gyp/gyp/gyp_main.py',
84 error gyp info spawn args   'binding.gyp',
84 error gyp info spawn args   '-f',
84 error gyp info spawn args   'make',
84 error gyp info spawn args   '-I',
84 error gyp info spawn args   '/home/cdejoye/.local/share/nvim/tree-sitter-phpdoc/node_modules/tree-sitter-php/build/config.gypi',
84 error gyp info spawn args   '-I',
84 error gyp info spawn args   '/usr/lib/node_modules/node-gyp/addon.gypi',
84 error gyp info spawn args   '-I',
84 error gyp info spawn args   '/home/cdejoye/.cache/node-gyp/17.3.0/include/node/common.gypi',
84 error gyp info spawn args   '-Dlibrary=shared_library',
84 error gyp info spawn args   '-Dvisibility=default',
84 error gyp info spawn args   '-Dnode_root_dir=/home/cdejoye/.cache/node-gyp/17.3.0',
84 error gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/node-gyp',
84 error gyp info spawn args   '-Dnode_lib_file=/home/cdejoye/.cache/node-gyp/17.3.0/<(target_arch)/node.lib',
84 error gyp info spawn args   '-Dmodule_root_dir=/home/cdejoye/.local/share/nvim/tree-sitter-phpdoc/node_modules/tree-sitter-php',
84 error gyp info spawn args   '-Dnode_engine=v8',
84 error gyp info spawn args   '--depth=.',
84 error gyp info spawn args   '--no-parallel',
84 error gyp info spawn args   '--generator-output',
84 error gyp info spawn args   'build',
84 error gyp info spawn args   '-Goutput_dir=.'
84 error gyp info spawn args ]
84 error gyp info spawn make
84 error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
84 error In file included from ../src/parser.c:1:
84 error ../src/parser.c: In function ‘ts_lex_keywords’:
84 error ../src/tree_sitter/parser.h:135:8: warning: variable ‘eof’ set but not used [-Wunused-but-set-variable]
84 error   135 |   bool eof = false;             \
84 error       |        ^~~
84 error ../src/parser.c:4804:3: note: in expansion of macro ‘START_LEXER’
84 error  4804 |   START_LEXER();
84 error       |   ^~~~~~~~~~~
84 error ../src/scanner.cc: In member function ‘bool {anonymous}::Scanner::scan_encapsed_part_string(TSLexer*, bool)’:
84 error ../src/scanner.cc:183:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
84 error   183 |           if (is_after_variable) {
84 error       |           ^~
84 error ../src/scanner.cc:194:9: note: here
84 error   194 |         case '[':
84 error       |         ^~~~
84 error In file included from ../bindings/node/binding.cc:3:
84 error ../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
84 error ../../nan/nan.h:2298:7: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
84 error  2298 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
84 error       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84 error In file included from ../../nan/nan.h:2884,
84 error                  from ../bindings/node/binding.cc:3:
84 error ../../nan/nan_typedarray_contents.h: In constructor ‘Nan::TypedArrayContents<T>::TypedArrayContents(v8::Local<v8::Value>)’:
84 error ../../nan/nan_typedarray_contents.h:34:43: error: ‘class v8::ArrayBuffer’ has no member named ‘GetContents’
84 error    34 |       data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
84 error       |                                           ^~~~~~~~~~~
84 error In file included from ../bindings/node/binding.cc:2:
84 error ../bindings/node/binding.cc: At global scope:
84 error /home/cdejoye/.cache/node-gyp/17.3.0/include/node/node.h:843:7: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Object>)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
84 error   843 |       (node::addon_register_func) (regfunc),                          \
84 error       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84 error /home/cdejoye/.cache/node-gyp/17.3.0/include/node/node.h:877:3: note: in expansion of macro ‘NODE_MODULE_X’
84 error   877 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
84 error       |   ^~~~~~~~~~~~~
84 error ../bindings/node/binding.cc:26:1: note: in expansion of macro ‘NODE_MODULE’
84 error    26 | NODE_MODULE(tree_sitter_php_binding, Init)
84 error       | ^~~~~~~~~~~
84 error make: *** [tree_sitter_php_binding.target.mk:118: Release/obj.target/tree_sitter_php_binding/bindings/node/binding.o] Error 1
84 error gyp ERR! build error 
84 error gyp ERR! stack Error: `make` failed with exit code: 2
84 error gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:194:23)
84 error gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
84 error gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
84 error gyp ERR! System Linux 5.16.1-arch1-1
84 error gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
84 error gyp ERR! cwd /home/cdejoye/.local/share/nvim/tree-sitter-phpdoc/node_modules/tree-sitter-php
84 error gyp ERR! node -v v17.3.0
84 error gyp ERR! node-gyp -v v8.4.1
84 error gyp ERR! not ok
85 verbose exit 1
86 timing npm Completed in 32031ms
87 verbose unfinished npm timer reify 1642846235860
88 verbose unfinished npm timer reify:build 1642846265280
89 verbose unfinished npm timer build 1642846265280
90 verbose unfinished npm timer build:deps 1642846265280
91 verbose unfinished npm timer build:run:install 1642846265287
92 verbose unfinished npm timer build:run:install:node_modules/tree-sitter-cli 1642846265287
93 verbose unfinished npm timer build:run:install:node_modules/tree-sitter-php 1642846265293
94 verbose code 1
95 error A complete log of this run can be found in:
clason commented 2 years ago

This is due to the outdated nan dependency; upgrading to 2.15.0 fixes this. (You can do this locally with a simple npm update.)

claytonrcarter commented 2 years ago

Hi, sorry for the trouble. I just released 0.0.6 which includes the nan update. Can you try that? Closing this now, but please reopen if that doesn't help.

camilledejoye commented 2 years ago

I confirm it's fixed, thanks.