AMD64 Windows Version 4.4.1 fails to build: `npm ERR! gyp ERR! not ok`, VS Build Tool Errors

Aperta
#736 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
go, javascript, node.js
Ambito
build-system, cli

Direzione di ricerca

Inizia riproducendo fastly compute build su AMD64 Windows con la versione segnalata di Fastly CLI v4.4.1, Node.js 19.2.0 e gli strumenti di Visual Studio installati. Esamina come la CLI verifica e invoca la toolchain JavaScript locale e la dipendenza tree-sitter; il lavoro è completato quando il progetto JavaScript iniziale viene compilato correttamente senza gli errori node-gyp segnalati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug help wanted

Version

PS C:\Users\User\Downloads\test> fastly version
Fastly CLI version v4.4.1 (b10aa45)
Built with go version go1.18.8 linux/amd64

What happened

This was originally reported by a customer and I was able to reproduce it by spinning up a Windows 11 VM where I

  • Installed Fastly CLI (AMD64) v 4.4.1
  • Installed 64 bit Git via https://git-scm.com/download/win, changing no settings
  • Installed Node JS via https://nodejs.org/en/, checking the box to install build tools.
  • Tried to build the initial JavaScript project after running fastly compute init

Attached is the output I got after type in fastly compute build.

The workaround the customer is using is building in Fastly/CLI version 3.X.X but it appears there may be issues there as well. It's unclear.
Their working theory is that 4.X.X introduced a dependency to node-gyp which introduces a dependency to VS Build Tools. They've found lots of folks have had problems getting these to work together(IE: https://stackoverflow.com/questions/63046241/vs-code-gyp-err-find-vs)

At this point in time the workaround I am suggesting is to use WSL.

Workarounds that didn't work include:

  • Powershell admin mode
  • Developer Console , with all the extra path variables set

Now what's interesting is that Cmake did run, suggesting the dev tools are in the path.

PS C:\Users\User\Downloads\test> fastly compute build
Initializing...
Verifying package manifest...
Verifying local javascript toolchain...

ERROR: error during execution process:

npm notice
npm notice New major version of npm available! 8.19.3 -> 9.2.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.2.0>
npm notice Run `npm install -g npm@9.2.0` to update!
npm notice
npm ERR! code 1
npm ERR! path C:\Users\User\Downloads\test\node_modules\tree-sitter
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c prebuild-install || node-gyp rebuild
npm ERR! Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
npm ERR!   lib.c
npm ERR! C:\Users\User\Downloads\test\node_modules\tree-sitter\vendor\tree-sitter\lib\src\query.c(3135,51): warning C4018: '>': signed/unsigned mismatch [C:\Users\User\Downloads\test\node_modules\tree-sitter\build\tree_sitter.vcxproj]
npm ERR!   win_delay_load_hook.cc
npm ERR!   tree_sitter.vcxproj -> C:\Users\User\Downloads\test\node_modules\tree-sitter\build\Release\\tree_sitter.lib
npm ERR!   binding.cc
npm ERR!   conversions.cc
npm ERR!   language.cc
npm ERR!   logger.cc
npm ERR! C:\Users\User\Downloads\test\node_modules\tree-sitter\src\logger.cc(44,21): error C2039: 'CreationContext': is not a member of 'v8::Function' [C:\Users\User\Downloads\test\node_modules\tree-sitter\build\tree_sitter_runtime_binding.vcxproj]
npm ERR! C:\Users\User\AppData\Local\node-gyp\Cache\19.2.0\include\node\v8-microtask-queue.h(18,7): message : see declaration of 'v8::Function' [C:\Users\User\Downloads\test\node_modules\tree-sitter\build\tree_sitter_runtime_binding.vcxproj]
npm ERR! C:\Users\User\Downloads\test\node_modules\tree-sitter\src\logger.cc(44,8): error C2665: 'Nan::Call': no overloaded function could convert all the argument types [C:\Users\User\Downloads\test\node_modules\tree-sitter\build\tree_sitter_runtime_binding.vcxproj]
npm ERR! C:\Users\User\Downloads\test\node_modules\nan\nan.h(1865,30): message : could be 'v8::MaybeLocal<v8::Value> Nan::Call(const Nan::Callback &,int,v8::Local<v8::Value> [])' [C:\Users\User\Downloads\test\node_modules\tree-sitter\build\tree_sitter_runtime_binding.vcxproj]
npm ERR! C:\Users\User\Downloads\test\node_modules\tree-sitter\src\logger.cc(44,8): message : 'v8::MaybeLocal<v8::Value> Nan::Call(const Nan::Callback &,int,v8::Local<v8::Value> [])': cannot convert argument 1 from 'v8::Local<v8::Function>' to 'const Nan::Callback &' [C:\Users\User\Downloads\test\node_modules\tree-sitter\build\tree_sitter_runtime_binding.vcxproj]
npm ERR! C:\Users\User\Downloads\test\node_modules\tree-sitter\src\logger.cc(44,13): message : Reason: cannot convert from 'v8::Local<v8::Function>' to 'const Nan::Callback' [C:\Users\User\Downloads\test\node_modules\tree-sitter\build\tree_sitter_runtime_binding.vcxproj]
npm ERR! C:\Users\User\Downloads\test\node_modules\tree-sitter\src\logger.cc(44,13): message : No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called [C:\Users\User\Downloads\test\node_modules\tree-sitter\build\tree_sitter_runtime_binding.vcxproj]
npm ERR! C:\Users\User\Downloads\test\node_modules\tree-sitter\src\logger.cc(44,8): message : while trying to match the argument list '(v8::Local<v8::Function>, int, v8::Local<v8::Value> [3])' [C:\Users\User\Downloads\test\node_modules\tree-sitter\build\tree_sitter_runtime_binding.vcxproj]
npm ERR! C:\Users\User\Downloads\test\node_modules\tree-sitter\src\logger.cc(51,62): error C2039: 'CreationContext': is not a member of 'v8::Function' [C:\Users\User\Downloads\test\node_modules\tree-sitter\build\tree_sitter_runtime_binding.vcxproj]
npm ERR! C:\Users\User\AppData\Local\node-gyp\Cache\19.2.0\include\node\v8-microtask-queue.h(18,7): message : see declaration of 'v8::Function' [C:\Users\User\Downloads\test\node_modules\tree-sitter\build\tree_sitter_runtime_binding.vcxproj]
npm ERR! C:\Users\User\Downloads\test\node_modules\tree-sitter\src\logger.cc(51,44): error C2672: 'v8::Local<v8::Object>::Cast': no matching overloaded function found [C:\Users\User\Downloads\test\node_modules\tree-sitter\build\tree_sitter_runtime_binding.vcxproj]
npm ERR! C:\Users\User\AppData\Local\node-gyp\Cache\19.2.0\include\node\v8-local-handle.h(236,29): message : could be 'v8::Local<v8::Object> v8::Local<v8::Object>::Cast(v8::Local<S>)' [C:\Users\User\Downloads\test\node_modules\tree-sitter\build\tree_sitter_runtime_binding.vcxproj]
npm ERR! prebuild-install WARN install No prebuilt binaries found (target=19.2.0 runtime=node arch=x64 libc= platform=win32)
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.1.0
npm ERR! gyp info using node@19.2.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.11.0 found at "C:\Python311\python.exe"
npm ERR! gyp http GET https://nodejs.org/download/release/v19.2.0/node-v19.2.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v19.2.0/node-v19.2.0-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v19.2.0/SHASUMS256.txt
npm ERR! gyp http GET https://nodejs.org/download/release/v19.2.0/win-arm64/node.lib
npm ERR! gyp http GET https://nodejs.org/download/release/v19.2.0/win-x64/node.lib
npm ERR! gyp http GET https://nodejs.org/download/release/v19.2.0/win-x86/node.lib
npm ERR! gyp http 200 https://nodejs.org/download/release/v19.2.0/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v19.2.0/win-x86/node.lib
npm ERR! gyp http 200 https://nodejs.org/download/release/v19.2.0/win-x64/node.lib
npm ERR! gyp http 404 https://nodejs.org/download/release/v19.2.0/win-arm64/node.lib
npm ERR! gyp info find VS using VS2022 (17.4.33122.133) found at:
npm ERR! gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Python311\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'C:\\Program Files\\nodejs\\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   'msvs',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\User\\Downloads\\test\\node_modules\\tree-sitter\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\User\\AppData\\Local\\node-gyp\\Cache\\19.2.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=C:\\Users\\User\\AppData\\Local\\node-gyp\\Cache\\19.2.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\User\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\19.2.0\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\User\\Downloads\\test\\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   'C:\\Users\\User\\Downloads\\test\\node_modules\\tree-sitter\\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'build/binding.sln',
npm ERR! gyp info spawn args   '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args   '/nologo',
npm ERR! gyp info spawn args   '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:201:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! gyp ERR! System Windows_NT 10.0.22000
npm ERR! 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"
npm ERR! gyp ERR! cwd C:\Users\User\Downloads\test\node_modules\tree-sitter
npm ERR! gyp ERR! node -v v19.2.0
npm ERR! gyp ERR! node-gyp -v v9.1.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Local\npm-cache\_logs\2022-12-12T23_33_01_311Z-debug-0.log.

If you believe this error is the result of a bug, please file an issue: https://github.com/fastly/cli/issues/new?labels=bug&template=bug_report.md
PS C:\Users\User\Downloads\test>
Lingua principale
Go
Stelle
164
Fork
80
Merge medio
14h 22m
PR unite (30g)
17

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fastly/cli

Tutte le issue di fastly/cli

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.