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

build VSCode got stuck in node-gyp #160864

Closed
ouliuquan opened this issue Sep 14, 2022 · 10 comments
Closed

build VSCode got stuck in node-gyp #160864

ouliuquan opened this issue Sep 14, 2022 · 10 comments
Assignees
Labels
engineering VS Code - Build / issue tracking / etc. vscode-build VS Code build process issues

Comments

@ouliuquan
Copy link

ouliuquan commented Sep 14, 2022

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version:1.71.1
  • OS Version:Microsoft Windows 11 10.0.22000 Build 22000 x64-based PC

Steps to Reproduce:

1.git clone --depth 1 --branch 1.71.1 https://github.com/microsoft/vscode.git
2.yarn
#nodejs/node-gyp#2732
#TryGhost/node-sqlite3#1635

@vscodenpa
Copy link

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.71.1. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@ouliuquan
Copy link
Author

I am create issue in other repo to help find out what's wrong, but still got no answer, hope someone can help me throught this.
Here is my newest log:

PS D:\Repos\vscode> yarn
yarn install v1.22.19
$ node build/npm/preinstall.js                                                                                                                                                                                   yarn install v1.22.19                                                                                                                                                                                            [1/4] Resolving packages...                                                                                                                                                                                      success Already up-to-date.                                                                                                                                                                                      Done in 0.10s.                                                                                                                                                                                                   gyp info it worked if it ends with ok
gyp info using node-gyp@8.4.1
gyp info using node@16.17.0 | win32 | x64
gyp info ok
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "@microsoft/1ds-core-js > @microsoft/applicationinsights-core-js@2.8.3" has unmet peer dependency "tslib@*".
warning " > xterm-addon-canvas@0.2.0-beta.17" has incorrect peer dependency "xterm@^5.0.0".
warning " > xterm-addon-search@0.10.0-beta.5" has incorrect peer dependency "xterm@^5.0.0".
warning " > xterm-addon-serialize@0.8.0-beta.5" has incorrect peer dependency "xterm@^5.0.0".
warning " > xterm-addon-unicode11@0.4.0-beta.5" has incorrect peer dependency "xterm@^5.0.0".
warning " > xterm-addon-webgl@0.13.0-beta.37" has incorrect peer dependency "xterm@^5.0.0".
warning " > gulp-postcss@9.0.0" has unmet peer dependency "postcss@^8.0.0".
[4/4] Building fresh packages...
[1/18] ⠐ @parcel/watcher
[6/18] ⠐ native-keymap
[3/18] ⠐ @vscode/sqlite3
[4/18] ⠐ keytar
error D:\Repos\vscode\node_modules\@vscode\sqlite3: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: D:\Repos\vscode\node_modules\@vscode\sqlite3
Output:
D:\Repos\vscode\node_modules\@vscode\sqlite3>if not defined npm_config_node_gyp (node "D:\Program\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using node-gyp@9.0.0
gyp info using node@16.17.0 | win32 | x64
gyp info find Python using Python version 3.10.6 found at "D:\Program Files\Python310\python.exe"
gyp info find VS using VS2019 (16.11.32802.440) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"
gyp info find VS run with --verbose for detailed information
gyp info spawn D:\Program Files\Python310\python.exe
gyp info spawn args [
gyp info spawn args   'D:\\Program\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\Repos\\vscode\\node_modules\\@vscode\\sqlite3\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\Program\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\SmartOne\\AppData\\Local\\node-gyp\\Cache\\19.0.12\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\SmartOne\\AppData\\Local\\node-gyp\\Cache\\19.0.12',
gyp info spawn args   '-Dnode_gyp_dir=D:\\Program\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\SmartOne\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\19.0.12\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=D:\\Repos\\vscode\\node_modules\\@vscode\\sqlite3',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'D:\\Repos\\vscode\\node_modules\\@vscode\\sqlite3\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args   'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64'
gyp info spawn args ]
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“-m”开关。
  unpack_sqlite_dep
  'D:\Program' 不是内部或外部命令,也不是可运行的程序
  或批处理文件。
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB8066: “..\..\deps\sqlite-autoconf-3360000.tar.gz”的自定义生成已退出,代
码为 1。 [D:\Repos\vscode\node_modules\@vscode\sqlite3\build\deps\action_before_build.vcxproj]
  nothing.c
  win_delay_load_hook.cc
  nothing.vcxproj -> D:\Repos\vscode\node_modules\@vscode\sqlite3\build\Release\\nothing.lib
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (D:\Program\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Windows_NT 10.0.22000
gyp ERR! command "D:\\Program\\nodejs\\node.exe" "D:\\Program\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Repos\vscode\node_modules\@vscode\sqlite3




PS D:\Repos\vscode>

@ouliuquan
Copy link
Author

I also build a minimal project to reproduce error, mainly using the @vscode/sqlite3, the error seems the same.https://github.com/ouliuquan/testsqlite3

@ouliuquan
Copy link
Author

It seems be related to this issue, about the no-ASCII support lack of node-gyp:
https://github.com/microsoft/vscode/wiki/How-to-Contribute:
Warning: Make sure your profile path only contains ASCII letters, e.g. John, otherwise, it can lead to node-gyp usage problems (nodejs/node-gyp/issues#297)

But my path:
C:\\Users\\SmartOne\\AppData\\Local\\node-gyp\\Cache\\19.0.12\\include\\node\\common.gypi
D:\Repos\vscode
D:\\Program\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py
is full ASCII English, I even cut the space Program Files to Program, so this is wired.

@ouliuquan
Copy link
Author

In order to rule out the no-ASCII problem, I buy an English Version Windows Server 2022 on the cloud, clean.
But the question still happen in building my minimal repo https://github.com/ouliuquan/testsqlite3. Hope for some help.

This is my newest log:

PS C:\Repo\testsqlite3> yarn
yarn install v1.22.19
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error C:\Repo\testsqlite3\node_modules\@vscode\sqlite3: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: C:\Repo\testsqlite3\node_modules\@vscode\sqlite3
Output:
C:\Repo\testsqlite3\node_modules\@vscode\sqlite3>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using node-gyp@9.0.0
gyp info using node@16.17.0 | win32 | x64
gyp info find Python using Python version 3.10.7 found at "C:\Program Files\Python310\python.exe"
gyp info find VS using VS2022 (17.3.32901.215) found at:
gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Program Files\Python310\python.exe
gyp info spawn args [
gyp info spawn args   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Repo\\testsqlite3\\node_modules\\@vscode\\sqlite3\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Administrator\\AppData\\Local\\node-gyp\\Cache\\16.17.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Administrator\\AppData\\Local\\node-gyp\\Cache\\16.17.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\16.17.0\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Repo\\testsqlite3\\node_modules\\@vscode\\sqlite3',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Repo\\testsqlite3\\node_modules\\@vscode\\sqlite3\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args   'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64'
gyp info spawn args ]
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
  nothing.c
  win_delay_load_hook.cc
  nothing.vcxproj -> C:\Repo\testsqlite3\node_modules\@vscode\sqlite3\build\Release\\nothing.lib
  unpack_sqlite_dep
  'C:\Program' is not recognized as an internal or external command,
  operable program or batch file.
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB8066: Custom build for '..\..\deps\sqlite-autoconf-3360000.tar.gz' exited with code 1. [C:\Repo\testsqlite3\node_modules\@vscode\sqlite3\build\deps\action_before_build.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Windows_NT 10.0.20348
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Repo\testsqlite3\node_modules\@vscode\sqlite3
gyp ERR! node -v v16.17.0
gyp ERR! node-gyp -v v9.0.0
gyp ERR! not ok
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
PS C:\Repo\testsqlite3>

@ouliuquan ouliuquan changed the title build VSCode using yarn got stuck in @vscode/sqlite3 build VSCode got stuck in node-gyp Sep 14, 2022
@lszomoru lszomoru assigned deepak1556 and unassigned lszomoru Sep 14, 2022
@lszomoru
Copy link
Member

@deepak1556, could you take a look? Thank you!

@deepak1556
Copy link
Collaborator

The native module has an intermediate step that tries to extract an archive using a python script, and the python executable is found in this way https://github.com/microsoft/vscode-node-sqlite3/blob/15e3606959a08cc5d78046cf9de533b3f53d5f63/deps/sqlite3.gyp#L65. Since we are not adding any quotes around the executable path, in your case C:\Program Files\Python310\python.exe becomes C:\Program and leads to unrecognizable command error.

There seems to be PR microsoft/vscode-node-sqlite3#24 to address this issue, you can apply that change locally to get past the error. @bpasero do we want to merge the above PR and make a new release or do we focus on dropping our fork microsoft/vscode-node-sqlite3#11 which would also resolve this issue.

@deepak1556 deepak1556 added vscode-build VS Code build process issues engineering VS Code - Build / issue tracking / etc. labels Sep 16, 2022
@bpasero
Copy link
Member

bpasero commented Sep 16, 2022

Yeah lets get the change into our fork and bump the version. Dropping our fork is a considerable effort that I currently have no time for.

@ouliuquan
Copy link
Author

Since I changed my Python path to D:\Program\Python310\python.exe(remove the space), it works well.
Thank you Robo, @deepak1556 .

@bpasero
Copy link
Member

bpasero commented Sep 16, 2022

Closing as upstream.

@bpasero bpasero closed this as not planned Won't fix, can't repro, duplicate, stale Sep 16, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
engineering VS Code - Build / issue tracking / etc. vscode-build VS Code build process issues
Projects
None yet
Development

No branches or pull requests

5 participants