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

Unclear instructions to build ncc from source. #1198

Open
gl-yziquel opened this issue Jun 9, 2024 · 1 comment
Open

Unclear instructions to build ncc from source. #1198

gl-yziquel opened this issue Jun 9, 2024 · 1 comment

Comments

@gl-yziquel
Copy link

gl-yziquel commented Jun 9, 2024

I like to build from source. Even js code. I tried it here, somewhat naively. I would have loved more explicit instructions.

I get:

mini-me@virtucon ~/h/c/ncc (main) [1]> yarn install                                                                     
yarn install v1.22.21                                                                                                                                                                                                                         [1/4] Resolving packages...                                                                                            
[2/4] Fetching packages...                                 
[3/4] Linking dependencies...                                                                                                                                                                                                                 
warning Workspaces can only be enabled in private projects.                                                                                                                                                                                   
[4/4] Building fresh packages...                                                                                       
[-/15] ⡀ waiting...                                                                                                    
[7/15] ⡀ canvas                                                                                                                                                                                                                               [-/15] ⢀ waiting...                                                                                                                                                                                                                           
[11/15] ⢀ unix-dgram                                                                                                                                                                                                                          
warning Error running install script for optional dependency: "/home/mini-me/home/cellar/ncc/node_modules/unix-dgram: Command failed.                                                                                                         
Exit code: 1                                                                                                                                                                                                                                  
Command: node-gyp rebuild                                                                                              
Arguments:                                                                                                             
Directory: /home/mini-me/home/cellar/ncc/node_modules/unix-dgram                                                                                                                                                                              
Output:                                                                                                                
gyp info it worked if it ends with ok                                                                                                                                                                                                         
gyp info using [email protected]                                                                                                                                                                                                                 
gyp info using [email protected] | linux | x64                                                                               
(node:2459526) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead. 
(Use `node --trace-deprecation ...` to show where the warning was created)                                             
gyp info find Python using Python version 3.12.2 found at \"/home/mini-me/.pyenv/versions/3.12.2/bin/python3\"                                                                                                                                
gyp info spawn /home/mini-me/.pyenv/versions/3.12.2/bin/python3                                                        
gyp info spawn args [                                                                                                  
gyp info spawn args   '/home/mini-me/.config/yarn/global/node_modules/node-gyp/gyp/gyp_main.py',                                                                                                                                              
gyp info spawn args   'binding.gyp',                                                                                                                                                                                                          
gyp info spawn args   '-f',                                                                                                                                                                                                                   
gyp info spawn args   'make',                                                                                                                                                                                                                 
gyp info spawn args   '-I',                                                                                            
gyp info spawn args   '/home/mini-me/home/cellar/ncc/node_modules/unix-dgram/build/config.gypi',                                                                                                                                              
gyp info spawn args   '-I',                                                                                                                                                                                                                   gyp info spawn args   '/home/mini-me/.config/yarn/global/node_modules/node-gyp/addon.gypi',                                                                                                                                                   
gyp info spawn args   '-I',                                                                                                                                                                                                                   
gyp info spawn args   '/home/mini-me/.cache/node-gyp/22.2.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=/home/mini-me/.cache/node-gyp/22.2.0',                                          
gyp info spawn args   '-Dnode_gyp_dir=/home/mini-me/.config/yarn/global/node_modules/node-gyp',                                                                                                                                               gyp info spawn args   '-Dnode_lib_file=/home/mini-me/.cache/node-gyp/22.2.0/<(target_arch)/node.lib',                                                                                                                                         gyp info spawn args   '-Dmodule_root_dir=/home/mini-me/home/cellar/ncc/node_modules/unix-dgram',                       
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   'build',                                                                                         
gyp info spawn args   '-Goutput_dir=.'                                                                                                                                                                                                        
gyp info spawn args ]                                                                                                  
gyp info spawn make                                                                                                                                                                                                                           
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]                                                             
make: Entering directory '/home/mini-me/home/cellar/ncc/node_modules/unix-dgram/build'                                                                                                                                                        
  CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o                                                                                                                                                                                  
In file included from ../src/unix_dgram.cc:5:                                                                          
../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, GetterCallback, SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, imp::Sig)’:                         
../../nan/nan.h:2546:19: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>&, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local
<v8::Value>, const v8::PropertyCallbackInfo<void>&), v8::Local<v8::Object>&, v8::AccessControl&, v8::PropertyAttribute&)’
 2546 |   tpl->SetAccessor(                                                                                            
      |   ~~~~~~~~~~~~~~~~^                                
 2547 |       name                                         
      |       ~~~~                                         
 2548 |     , getter_                                      
      |     ~~~~~~~~~                                      
 2549 |     , setter_                                      
      |     ~~~~~~~~~                                      
 2550 |     , obj                                          
      |     ~~~~~                                          
 2551 |     , settings                                     
      |     ~~~~~~~~~~                                     
 2552 |     , attribute                                    
      |     ~~~~~~~~~~~                                    
 2553 | #if (NODE_MODULE_VERSION < NODE_16_0_MODULE_VERSION)                                                           
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                           
 2554 |     , signature                                    
      |     ~~~~~~~~~~~                                    
 2555 | #endif                                             
      | ~~~~~~                                             
 2556 |   );                                               
      |   ~
[...]
In file included from /home/mini-me/.cache/node-gyp/22.2.0/include/node/v8-array-buffer.h:12,                          
                 from /home/mini-me/.cache/node-gyp/22.2.0/include/node/v8.h:24:                                       
/home/mini-me/.cache/node-gyp/22.2.0/include/node/v8-local-handle.h: In instantiation of ‘v8::Local<T>::Local(v8::Local<S>) [with S = v8::Data; T = v8::Value]’:                                                                              
../../nan/nan_callbacks_12_inl.h:175:53:   required from here                                                          
/home/mini-me/.cache/node-gyp/22.2.0/include/node/v8-local-handle.h:269:42: error: static assertion failed: type check 
  269 |     static_assert(std::is_base_of<T, S>::value, \"type check\");                                               
      |                                          ^~~~~     
/home/mini-me/.cache/node-gyp/22.2.0/include/node/v8-local-handle.h:269:42: note: ‘std::integral_constant<bool, false>::value’ evaluates to false                                                                                             
make: *** [unix_dgram.target.mk:108: Release/obj.target/unix_dgram/src/unix_dgram.o] Error 1                           
make: Leaving directory '/home/mini-me/home/cellar/ncc/node_modules/unix-dgram/build'                                  
gyp ERR! build error                                                                                                   
gyp ERR! stack Error: `make` failed with exit code: 2                                                                  
gyp ERR! stack     at ChildProcess.onExit (/home/mini-me/.config/yarn/global/node_modules/node-gyp/lib/build.js:203:23)                                                                                                                       
gyp ERR! stack     at ChildProcess.emit (node:events:520:28)                                                                                                                                                                                  
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)                                                                                                                                                        
gyp ERR! System Linux 6.5.0-28-generic                                                                                                                                                                                                        
gyp ERR! command \"/home/mini-me/.local/share/nvm/v22.2.0/bin/node\" \"/home/mini-me/.yarn/bin/node-gyp\" \"rebuild\"  
gyp ERR! cwd /home/mini-me/home/cellar/ncc/node_modules/unix-dgram                                                     
[-/15] ⠄ waiting...                                                                                                                                                                                                                           
[7/15] ⠄ canvas                                                                                                        
[-/15] ⡀ waiting...                                                                                                    
[-/15] ⡀ waiting...                                                                                                                                                                                                                           
error /home/mini-me/home/cellar/ncc/node_modules/canvas: Command failed.                                               
Exit code: 1                                               
Command: node-pre-gyp install --fallback-to-build --update-binary                                                      
Arguments:                                                                                                                                                                                                                                    
Directory: /home/mini-me/home/cellar/ncc/node_modules/canvas                                                           
Output:                                                                                                                
node-pre-gyp info it worked if it ends with ok                                                                                                                                                                                                
node-pre-gyp info using [email protected]                                                                                                                                                                                                    
node-pre-gyp info using [email protected] | linux | x64                                                                                                                                                                                             
(node:2459510) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.                                                                                                                  
(Use `node --trace-deprecation ...` to show where the warning was created)                                             
node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v127-linux-glibc-x64.tar.gz                                                                                                     
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v127-linux-glibc-x64.tar.gz                                                                
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v127 ABI, glibc) (falling back to source compile with node-gyp)                                                                                  
node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v127-linux-glibc-x64.tar.gz                                                              
gyp info it worked if it ends with ok                      
gyp info using [email protected]                                                                                          
gyp info using [email protected] | linux | x64                                                                               
gyp info ok                                                                                                            
gyp info it worked if it ends with ok                      
gyp info using [email protected]                                                                                                                                                                                                                 
gyp info using [email protected] | linux | x64                   
(node:2459593) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead. 
(Use `node --trace-deprecation ...` to show where the warning was created)                                             
gyp info find Python using Python version 3.12.2 found at "/home/mini-me/.pyenv/versions/3.12.2/bin/python3"                                                                                                                                  
gyp info spawn /home/mini-me/.pyenv/versions/3.12.2/bin/python3
gyp info spawn args [                                                                                                  
gyp info spawn args   '/home/mini-me/home/cellar/ncc/node_modules/node-gyp/gyp/gyp_main.py',                           
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',                                
gyp info spawn args   'make',
gyp info spawn args   '-I',                                
gyp info spawn args   '/home/mini-me/home/cellar/ncc/node_modules/canvas/build/config.gypi',                           
gyp info spawn args   '-I',                                
gyp info spawn args   '/home/mini-me/home/cellar/ncc/node_modules/node-gyp/addon.gypi',                                
gyp info spawn args   '-I',                                
gyp info spawn args   '/home/mini-me/.cache/node-gyp/22.2.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=/home/mini-me/.cache/node-gyp/22.2.0',                                          
gyp info spawn args   '-Dnode_gyp_dir=/home/mini-me/home/cellar/ncc/node_modules/node-gyp',                            
gyp info spawn args   '-Dnode_lib_file=/home/mini-me/.cache/node-gyp/22.2.0/<(target_arch)/node.lib',                  
gyp info spawn args   '-Dmodule_root_dir=/home/mini-me/home/cellar/ncc/node_modules/canvas',                           
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   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]                                      
gyp info ok                                                
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info spawn make                                        
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/mini-me/home/cellar/ncc/node_modules/canvas/build'                                     
  SOLINK_MODULE(target) Release/obj.target/canvas-postbuild.node                                                       
  COPY Release/canvas-postbuild.node
  CXX(target) Release/obj.target/canvas/src/backend/Backend.o                                                          
In file included from ../src/backend/Backend.h:6,
                 from ../src/backend/Backend.cc:1:
../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, GetterCallback, SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, imp::Sig)’:
../../nan/nan.h:2546:19: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>&, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local
<v8::Value>, const v8::PropertyCallbackInfo<void>&), v8::Local<v8::Object>&, v8::AccessControl&, v8::PropertyAttribute&)’
 2546 |   tpl->SetAccessor(                                
      |   ~~~~~~~~~~~~~~~~^                                
 2547 |       name                                         
      |       ~~~~                                         
 2548 |     , getter_                                      
      |     ~~~~~~~~~                                      
 2549 |     , setter_                                      
      |     ~~~~~~~~~                                      
 2550 |     , obj                                          
      |     ~~~~~                                          
 2551 |     , settings                                     
      |     ~~~~~~~~~~                                     
 2552 |     , attribute                                    
      |     ~~~~~~~~~~~                                    
 2553 | #if (NODE_MODULE_VERSION < NODE_16_0_MODULE_VERSION)                                                           
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                           
 2554 |     , signature                                    
      |     ~~~~~~~~~~~                                    
 2555 | #endif                                             
      | ~~~~~~                                             
 2556 |   );                                               
      |   ~                                                
[...]
In file included from /home/mini-me/.cache/node-gyp/22.2.0/include/node/v8-array-buffer.h:12,                          
                 from /home/mini-me/.cache/node-gyp/22.2.0/include/node/v8.h:24:                                       
/home/mini-me/.cache/node-gyp/22.2.0/include/node/v8-local-handle.h: In instantiation of ‘v8::Local<T>::Local(v8::Local<S>) [with S = v8::Data; T = v8::Value]’:
../../nan/nan_callbacks_12_inl.h:175:53:   required from here                                                          
/home/mini-me/.cache/node-gyp/22.2.0/include/node/v8-local-handle.h:269:42: error: static assertion failed: type check 
  269 |     static_assert(std::is_base_of<T, S>::value, "type check");                                                 
      |                                          ^~~~~
/home/mini-me/.cache/node-gyp/22.2.0/include/node/v8-local-handle.h:269:42: note: ‘std::integral_constant<bool, false>::value’ evaluates to false
make: *** [canvas.target.mk:159: Release/obj.target/canvas/src/backend/Backend.o] Error 1                              
make: Leaving directory '/home/mini-me/home/cellar/ncc/node_modules/canvas/build'                                      
gyp ERR! build error                                       
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/mini-me/home/cellar/ncc/node_modules/node-gyp/lib/build.js:203:23)    
gyp ERR! stack     at ChildProcess.emit (node:events:520:28)                                                           
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)                                 
gyp ERR! System Linux 6.5.0-28-generic
gyp ERR! command "/home/mini-me/.local/share/nvm/v22.2.0/bin/node" "/home/mini-me/home/cellar/ncc/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--update-binary" "--module=/home/mini-me/home/cellar/ncc/node_modules/
canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/home/mini-me/home/cellar/ncc/node_modules/canvas/build/Release" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v127"
gyp ERR! cwd /home/mini-me/home/cellar/ncc/node_modules/canvas                                                         
gyp ERR! node -v v22.2.0                                   
gyp ERR! node-gyp -v v9.4.0                                
gyp ERR! not ok                                            
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/home/mini-me/.local/share/nvm/v22.2.0/bin/node /home/mini-me/home/cellar/ncc/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --update-binary --module=/home/mini-me/home/ce
llar/ncc/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/mini-me/home/cellar/ncc/node_modules/canvas/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-
v127' (1)                                                  
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/mini-me/home/cellar/ncc/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:520:28)                                                  
node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1105:16)                                        
node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:305:5)                         
node-pre-gyp ERR! System Linux 6.5.0-28-generic
node-pre-gyp ERR! command "/home/mini-me/.local/share/nvm/v22.2.0/bin/node" "/home/mini-me/home/cellar/ncc/node_modules/canvas/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--update-binary"
node-pre-gyp ERR! cwd /home/mini-me/home/cellar/ncc/node_modules/canvas                                                
node-pre-gyp ERR! node -v v22.2.0
node-pre-gyp ERR! node-pre-gyp -v v1.0.5
node-pre-gyp ERR! not ok                                   
Failed to execute '/home/mini-me/.local/share/nvm/v22.2.0/bin/node /home/mini-me/home/cellar/ncc/node_modules/node-gyp 
@styfle
Copy link
Member

styfle commented Jun 10, 2024

I think newer Node.js versions are failing in CI right now.

You can try Node.js 18 since that was passing https://github.com/vercel/ncc/actions/runs/7873890228/job/21482233308

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants