[Bug 1217424] New: node-gyp 21 errors out with SyntaxError

https://bugzilla.suse.com/show_bug.cgi?id=1217424 Bug ID: 1217424 Summary: node-gyp 21 errors out with SyntaxError Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: All OS: openSUSE Tumbleweed Status: NEW Severity: Major Priority: P5 - None Component: Development Assignee: screening-team-bugs@suse.de Reporter: brunopitrus@hotmail.com QA Contact: qa-bugs@suse.de Target Milestone: --- Found By: --- Blocker: --- After Tumbleweed upgraded to node 21.2.0, the vscode RPM started failing to build with the following error: [ 258s] Traceback (most recent call last): [ 258s] File "/usr/lib64/node_modules/npm21/node_modules/node-gyp/gyp/gyp_main.py", line 45, in <module> [ 258s] sys.exit(gyp.script_main()) [ 258s] ^^^^^^^^^^^^^^^^^ [ 258s] File "/usr/lib64/node_modules/npm21/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 688, in script_main [ 258s] return main(sys.argv[1:]) [ 258s] ^^^^^^^^^^^^^^^^^^ [ 258s] File "/usr/lib64/node_modules/npm21/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 680, in main [ 258s] return gyp_main(args) [ 258s] ^^^^^^^^^^^^^^ [ 258s] File "/usr/lib64/node_modules/npm21/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 647, in gyp_main [ 258s] [generator, flat_list, targets, data] = Load( [ 258s] ^^^^^ [ 258s] File "/usr/lib64/node_modules/npm21/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 157, in Load [ 258s] result = gyp.input.Load( [ 258s] ^^^^^^^^^^^^^^^ [ 258s] File "/usr/lib64/node_modules/npm21/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2987, in Load [ 258s] LoadTargetBuildFile( [ 258s] File "/usr/lib64/node_modules/npm21/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 400, in LoadTargetBuildFile [ 258s] build_file_data = LoadOneBuildFile( [ 258s] ^^^^^^^^^^^^^^^^^ [ 258s] File "/usr/lib64/node_modules/npm21/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 237, in LoadOneBuildFile [ 258s] build_file_data = eval(build_file_contents, {"__builtins__": {}}, None) [ 258s] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ 258s] File "/usr/lib64/node_modules/npm21/node_modules/node-gyp/gyp/gyp_main.py", line 7 [ 258s] import os [ 258s] ^^^^^^ [ 258s] SyntaxError: invalid syntax see full build log at https://build.opensuse.org/package/live_build_log/devel:tools:ide:vscode/cod... This is a regression from nodejs 21.1.0. -- You are receiving this mail because: You are on the CC list for the bug.

https://bugzilla.suse.com/show_bug.cgi?id=1217424 Bruno Pitrus <brunopitrus@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|screening-team-bugs@suse.de |amajer@suse.com -- You are receiving this mail because: You are on the CC list for the bug.

https://bugzilla.suse.com/show_bug.cgi?id=1217424 https://bugzilla.suse.com/show_bug.cgi?id=1217424#c1 --- Comment #1 from OBSbugzilla Bot <bwiedemann+obsbugzillabot@suse.com> --- This is an autogenerated message for OBS integration: This bug (1217424) was mentioned in https://build.opensuse.org/request/show/1133448 Factory / nodejs21 -- You are receiving this mail because: You are on the CC list for the bug.

https://bugzilla.suse.com/show_bug.cgi?id=1217424 https://bugzilla.suse.com/show_bug.cgi?id=1217424#c2 Peter Hill <zed.three@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |zed.three@gmail.com --- Comment #2 from Peter Hill <zed.three@gmail.com> --- I've been wrestling with this for ages, and discovered that the problem is this patch: https://build.opensuse.org/projects/devel:languages:nodejs/packages/nodejs22... Specifically the change to this file: `node-v21.7.1/deps/npm/node_modules/node-gyp/lib/configure.js` This adds a second call to `createBuildDir()` which causes `runGyp()` to duplicate arguments added to `argv` passed to `gyp.spawn` -- resulting in `gyp_main.py` getting passed as an argument to itself. This can be seen in the verbose logs: ``` npm error gyp info spawn args [ npm error gyp info spawn args '/usr/lib64/node_modules/npm22/node_modules/node-gyp/gyp/gyp_main.py', npm error gyp info spawn args 'binding.gyp', npm error gyp info spawn args '/usr/lib64/node_modules/npm22/node_modules/node-gyp/gyp/gyp_main.py', npm error gyp info spawn args 'binding.gyp', npm error gyp info spawn args '-f', npm error gyp info spawn args 'make', ``` Please can this patch be removed or reviewed and updated for the latest node-gyp? -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com