cucumber / language-server

Cucumber Language Server
MIT License
33 stars 19 forks source link

CI: is it time to let go of Node 14? #97

Closed olleolleolle closed 4 months ago

olleolleolle commented 5 months ago

🤔 What's the problem you've observed?

npm install hits problems running Python code that gyp started executing, not understanding the rU mode specifier - that seems like a Python version support issue somewhere.

✨ Do you have a proposal for making it better?

Um, perhaps node 14 is too old for this fast-moving landscape?

📚 Any additional context?

here is where I saw the build error https://github.com/cucumber/language-server/pull/94

node 16.x passes.

``` > tree-sitter-c-sharp@0.20.0 install /Users/runner/work/language-server/language-server/node_modules/tree-sitter-c-sharp > node-gyp rebuild Traceback (most recent call last): File "/Users/runner/hostedtoolcache/node/14.21.3/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 50, in sys.exit(gyp.script_main()) ^^^^^^^^^^^^^^^^^ File "/Users/runner/hostedtoolcache/node/14.21.3/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main return main(sys.argv[1:]) ^^^^^^^^^^^^^^^^^^ File "/Users/runner/hostedtoolcache/node/14.21.3/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main return gyp_main(args) ^^^^^^^^^^^^^^ File "/Users/runner/hostedtoolcache/node/14.21.3/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 520, in gyp_main [generator, flat_list, targets, data] = Load( ^^^^^ File "/Users/runner/hostedtoolcache/node/14.21.3/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 136, in Load result = gyp.input.Load(build_files, default_variables, includes[:], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/runner/hostedtoolcache/node/14.21.3/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2782, in Load LoadTargetBuildFile(build_file, data, aux_data, File "/Users/runner/hostedtoolcache/node/14.21.3/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 391, in LoadTargetBuildFile build_file_data = LoadOneBuildFile(build_file_path, data, aux_data, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/runner/hostedtoolcache/node/14.21.3/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 234, in LoadOneBuildFile build_file_contents = open(build_file_path, 'rU').read() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid mode: 'rU' while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: `gyp` failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/Users/runner/hostedtoolcache/node/14.21.3/x64/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16) gyp ERR! stack at ChildProcess.emit (events.js:400:28) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12) gyp ERR! System Darwin 21.6.0 gyp ERR! command "/Users/runner/hostedtoolcache/node/14.21.3/x64/bin/node" "/Users/runner/hostedtoolcache/node/14.21.3/x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/runner/work/language-server/language-server/node_modules/tree-sitter-c-sharp gyp ERR! node -v v14.21.3 gyp ERR! node-gyp -v v5.1.1 gyp ERR! not ok > tree-sitter-cli@0.20.7 install /Users/runner/work/language-server/language-server/node_modules/tree-sitter-cli > node install.js Downloading https://github.com/tree-sitter/tree-sitter/releases/download/v0.20.7/tree-sitter-macos-x64.gz File "/Users/runner/hostedtoolcache/node/14.21.3/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main return main(sys.argv[1:]) ^^^^^^^^^^^^^^^^^^ File "/Users/runner/hostedtoolcache/node/14.21.3/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main return gyp_main(args) ^^^^^^^^^^^^^^ File "/Users/runner/hostedtoolcache/node/14.21.3/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 520, in gyp_main [generator, flat_list, targets, data] = Load( ^^^^^ File "/Users/runner/hostedtoolcache/node/14.21.3/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 136, in Load result = gyp.input.Load(build_files, default_variables, includes[:], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/runner/hostedtoolcache/node/14.21.3/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2782, in Load LoadTargetBuildFile(build_file, data, aux_data, File "/Users/runner/hostedtoolcache/node/14.21.3/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 391, in LoadTargetBuildFile build_file_data = LoadOneBuildFile(build_file_path, data, aux_data, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/runner/hostedtoolcache/node/14.21.3/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 234, in LoadOneBuildFile build_file_contents = open(build_file_path, 'rU').read() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid mode: 'rU' while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: `gyp` failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/Users/runner/hostedtoolcache/node/14.21.3/x64/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16) gyp ERR! stack at ChildProcess.emit (events.js:400:28) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12) gyp ERR! System Darwin 21.6.0 gyp ERR! command "/Users/runner/hostedtoolcache/node/14.21.3/x64/bin/node" "/Users/runner/hostedtoolcache/node/14.21.3/x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/runner/work/language-server/language-server/node_modules/tree-sitter-ruby gyp ERR! node -v v14.21.3 gyp ERR! node-gyp -v v5.1.1 gyp ERR! not ok > @cucumber/language-server@1.4.0 prepare /Users/runner/work/language-server/language-server > husky install file:///Users/runner/work/language-server/language-server/node_modules/husky/bin.mjs:14 ;(o.scripts ||= {}).prepare = 'husky' ^^^ SyntaxError: Unexpected token '||=' at Loader.moduleStrategy (internal/modules/esm/translators.js:149:18) at async link (internal/modules/esm/module_job.js:67:21) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @cucumber/language-server@1.4.0 prepare: `husky install` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @cucumber/language-server@1.4.0 prepare script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/runner/.npm/_logs/2024-02-28T22_49_53_945Z-debug.log Error: Process completed with exit code 1. ```
kieran-ryan commented 5 months ago

Thanks for raising @olleolleolle - feel free to raise a PR on this. Otherwise I'll loop back on this when i can. Thanks!

Based on a previous issue observed with the Language Service, would be interested to understand the root cause in case anything to watch for with node-gyp dependency management.