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

Failed install Debian 12 using scripts (gyp errors) #537

Closed
minnixtx opened this issue May 12, 2024 · 10 comments
Closed

Failed install Debian 12 using scripts (gyp errors) #537

minnixtx opened this issue May 12, 2024 · 10 comments

Comments

@minnixtx
Copy link

Describe the Bug
Install fails using script with gyp related errors

To Reproduce
Run script using "curl -o- https://raw.githubusercontent.com/NuSkooler/enigma-bbs/master/misc/install.sh | bash"

Expected Behavior
Enigma installs

Actual Behavior
Install fails

Environment
Fresh Debian 12.5 install, intel atom quad core, 16GB eMMC storage, 2GB RAM

Part of the error:

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 (/home/minnix/.nvm/versions/node/v14.21.3/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 Linux 6.1.0-21-amd64
gyp ERR! command "/home/minnix/.nvm/versions/node/v14.21.3/bin/node" "/home/minnix/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/minnix/enigma-bbs/node_modules/cpu-features
gyp ERR! node -v v14.21.3
gyp ERR! node-gyp -v v5.1.1
gyp ERR! not ok 

Full log is attached.
2024-05-12T06_31_03_813Z-debug.log

@ellisgl
Copy link

ellisgl commented May 13, 2024

IIRC there is a version mismatch with Node and Python, and it trying use Python calls that are no longer valid.

@minnixtx
Copy link
Author

IIRC there is a version mismatch with Node and Python, and it trying use Python calls that are no longer valid.

Any idea how I could resolve this?

@NuSkooler
Copy link
Owner

I'll try to take a look later today, but time is currently quite pressed. If needed, you can use the manual instructions. Really, the script setups up Node Version Manager (nvm), Node installed under NVM for your user, and a few deps. If you cat the script, it should be fairly self explanatory (see the steps at the bottom of the script).

Python needs to be present for node gyp to build some things, but Python 2.7 or 3.x should both work.

@minnixtx
Copy link
Author

Manual install fails. Python is installed. Below is error log.

Errors
minnix@bbs:~/enigma-bbs$ npm install
npm warn deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm warn deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm error code 1
npm error path /home/minnix/enigma-bbs/node_modules/node-pty
npm error command failed
npm error command sh -c node-gyp rebuild
npm error make: Entering directory '/home/minnix/enigma-bbs/node_modules/node-pty/build'
npm error   CXX(target) Release/obj.target/pty/src/unix/pty.o
npm error make: Leaving directory '/home/minnix/enigma-bbs/node_modules/node-pty/build'
npm error gyp info it worked if it ends with ok
npm error gyp info using [email protected]
npm error gyp info using [email protected] | linux | x64
npm error (node:5381) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
npm error (Use `node --trace-deprecation ...` to show where the warning was created)
npm error gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3"
npm error gyp http GET https://nodejs.org/download/release/v22.1.0/node-v22.1.0-headers.tar.gz
npm error gyp http 200 https://nodejs.org/download/release/v22.1.0/node-v22.1.0-headers.tar.gz
npm error gyp http GET https://nodejs.org/download/release/v22.1.0/SHASUMS256.txt
npm error gyp http 200 https://nodejs.org/download/release/v22.1.0/SHASUMS256.txt
npm error gyp info spawn /usr/bin/python3
npm error gyp info spawn args [
npm error gyp info spawn args   '/home/minnix/enigma-bbs/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',
npm error gyp info spawn args   '-I',
npm error gyp info spawn args   '/home/minnix/enigma-bbs/node_modules/node-pty/build/config.gypi',
npm error gyp info spawn args   '-I',
npm error gyp info spawn args   '/home/minnix/enigma-bbs/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args   '-I',
npm error gyp info spawn args   '/home/minnix/.cache/node-gyp/22.1.0/include/node/common.gypi',
npm error gyp info spawn args   '-Dlibrary=shared_library',
npm error gyp info spawn args   '-Dvisibility=default',
npm error gyp info spawn args   '-Dnode_root_dir=/home/minnix/.cache/node-gyp/22.1.0',
npm error gyp info spawn args   '-Dnode_gyp_dir=/home/minnix/enigma-bbs/node_modules/node-gyp',
npm error gyp info spawn args   '-Dnode_lib_file=/home/minnix/.cache/node-gyp/22.1.0/<(target_arch)/node.lib',
npm error gyp info spawn args   '-Dmodule_root_dir=/home/minnix/enigma-bbs/node_modules/node-pty',
npm error gyp info spawn args   '-Dnode_engine=v8',
npm error gyp info spawn args   '--depth=.',
npm error gyp info spawn args   '--no-parallel',
npm error gyp info spawn args   '--generator-output',
npm error gyp info spawn args   'build',
npm error gyp info spawn args   '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error gyp info spawn make
npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm error In file included from ../src/unix/pty.cc:20:
npm error ../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local, v8::Local, GetterCallback, SetterCallback, v8::Local, v8::AccessControl, v8::PropertyAttribute, imp::Sig)’:
npm error ../../nan/nan.h:2548:19: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local&, void (*&)(v8::Local, const v8::PropertyCallbackInfo&), void (*&)(v8::Local, v8::Local, const v8::PropertyCallbackInfo&), v8::Local&, v8::AccessControl&, v8::PropertyAttribute&)’
npm error  2548 |   tpl->SetAccessor(
npm error       |   ~~~~~~~~~~~~~~~~^
npm error  2549 |       name
npm error       |       ~~~~         
npm error  2550 |     , getter_
npm error       |     ~~~~~~~~~      
npm error  2551 |     , setter_
npm error       |     ~~~~~~~~~      
npm error  2552 |     , obj
npm error       |     ~~~~~          
npm error  2553 |     , settings
npm error       |     ~~~~~~~~~~     
npm error  2554 |     , attribute
npm error       |     ~~~~~~~~~~~    
npm error  2555 | #if (NODE_MODULE_VERSION < NODE_16_0_MODULE_VERSION)
npm error       | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error  2556 |     , signature
npm error       |     ~~~~~~~~~~~    
npm error  2557 | #endif
npm error       | ~~~~~~             
npm error  2558 |   );
npm error       |   ~                
npm error In file included from /home/minnix/.cache/node-gyp/22.1.0/include/node/v8-function.h:15,
npm error                  from /home/minnix/.cache/node-gyp/22.1.0/include/node/v8.h:33,
npm error                  from /home/minnix/.cache/node-gyp/22.1.0/include/node/node.h:73,
npm error                  from ../../nan/nan.h:62:
npm error /home/minnix/.cache/node-gyp/22.1.0/include/node/v8-template.h:1049:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
npm error  1049 |   void SetAccessor(
npm error       |        ^~~~~~~~~~~
npm error /home/minnix/.cache/node-gyp/22.1.0/include/node/v8-template.h:1052:61: note:   no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
npm error  1052 |       Local data = Local(), PropertyAttribute attribute = None,
npm error       |                                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
npm error /home/minnix/.cache/node-gyp/22.1.0/include/node/v8-template.h:1055:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
npm error  1055 |   void SetAccessor(
npm error       |        ^~~~~~~~~~~
npm error /home/minnix/.cache/node-gyp/22.1.0/include/node/v8-template.h:1058:61: note:   no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
npm error  1058 |       Local data = Local(), PropertyAttribute attribute = None,
npm error       |                                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
npm error ../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local, v8::Local, GetterCallback, SetterCallback, v8::Local, v8::AccessControl, v8::PropertyAttribute)’:
npm error ../../nan/nan.h:2594:19: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local&, void (*&)(v8::Local, const v8::PropertyCallbackInfo&), void (*&)(v8::Local, v8::Local, const v8::PropertyCallbackInfo&), v8::Local&, v8::AccessControl&, v8::PropertyAttribute&)’
npm error  2594 |   tpl->SetAccessor(
npm error       |   ~~~~~~~~~~~~~~~~^
npm error  2595 |       name
npm error       |       ~~~~         
npm error  2596 |     , getter_
npm error       |     ~~~~~~~~~      
npm error  2597 |     , setter_
npm error       |     ~~~~~~~~~      
npm error  2598 |     , obj
npm error       |     ~~~~~          
npm error  2599 |     , settings
npm error       |     ~~~~~~~~~~     
npm error  2600 |     , attribute
npm error       |     ~~~~~~~~~~~    
npm error  2601 |   );
npm error       |   ~                
npm error /home/minnix/.cache/node-gyp/22.1.0/include/node/v8-template.h:1049:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
npm error  1049 |   void SetAccessor(
npm error       |        ^~~~~~~~~~~
npm error /home/minnix/.cache/node-gyp/22.1.0/include/node/v8-template.h:1052:61: note:   no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
npm error  1052 |       Local data = Local(), PropertyAttribute attribute = None,
npm error       |                                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
npm error /home/minnix/.cache/node-gyp/22.1.0/include/node/v8-template.h:1055:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
npm error  1055 |   void SetAccessor(
npm error       |        ^~~~~~~~~~~
npm error /home/minnix/.cache/node-gyp/22.1.0/include/node/v8-template.h:1058:61: note:   no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
npm error  1058 |       Local data = Local(), PropertyAttribute attribute = None,
npm error       |                                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
npm error ../src/unix/pty.cc: In function ‘void pty_after_waitpid(uv_async_t*)’:
npm error ../src/unix/pty.cc:609:9: warning: ‘void* memset(void*, int, size_t)’ writing to an object of type ‘class Nan::Persistent’ with no trivial copy-assignment [-Wclass-memaccess]
npm error   609 |   memset(&baton->cb, -1, sizeof(baton->cb));
npm error       |   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error In file included from ../../nan/nan.h:411:
npm error ../../nan/nan_persistent_12_inl.h:12:40: note: ‘class Nan::Persistent’ declared here
npm error    12 | template class Persistent :
npm error       |                                        ^~~~~~~~~~
npm error ../src/unix/pty.cc: At global scope:
npm error /home/minnix/.cache/node-gyp/22.1.0/include/node/node.h:1224:7: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local, v8::Local, void*)’} [-Wcast-function-type]
npm error  1224 |       (node::addon_register_func) (regfunc),                          \
npm error       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error /home/minnix/.cache/node-gyp/22.1.0/include/node/node.h:1258:3: note: in expansion of macro ‘NODE_MODULE_X’
npm error  1258 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
npm error       |   ^~~~~~~~~~~~~
npm error ../src/unix/pty.cc:826:1: note: in expansion of macro ‘NODE_MODULE’
npm error   826 | NODE_MODULE(pty, init)
npm error       | ^~~~~~~~~~~
npm error make: *** [pty.target.mk:110: Release/obj.target/pty/src/unix/pty.o] Error 1
npm error gyp ERR! build error 
npm error gyp ERR! stack Error: `make` failed with exit code: 2
npm error gyp ERR! stack     at ChildProcess.onExit (/home/minnix/enigma-bbs/node_modules/node-gyp/lib/build.js:194:23)
npm error gyp ERR! stack     at ChildProcess.emit (node:events:520:28)
npm error gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm error gyp ERR! System Linux 6.1.0-21-amd64
npm error gyp ERR! command "/home/minnix/.nvm/versions/node/v22.1.0/bin/node" "/home/minnix/enigma-bbs/node_modules/.bin/node-gyp" "rebuild"
npm error gyp ERR! cwd /home/minnix/enigma-bbs/node_modules/node-pty
npm error gyp ERR! node -v v22.1.0
npm error gyp ERR! node-gyp -v v8.4.1
npm error gyp ERR! not ok

npm error A complete log of this run can be found in: /home/minnix/.npm/_logs/2024-05-15T16_35_18_931Z-debug-0.log

@NuSkooler
Copy link
Owner

NuSkooler commented May 16, 2024

@minnixtx Thanks for the log! What version of Node did you install?

npm error ../../nan/nan.h: In function 'void Nan::SetAccessor(v8::Local, v8::Local, GetterCallback, SetterCallback, v8::Local, v8::AccessControl, v8::PropertyAttribute, imp::Sig)':
npm error ../../nan/nan.h:2548:19: error: no matching function for call to 'v8::ObjectTemplate::SetAccessor(v8::Local&, void (*&)(v8::Local, const v8::PropertyCallbackInfo&), void (*&)(v8::Local, v8::Local, const v8::PropertyCallbackInfo&), v8::Local&, v8::AccessControl&, v8::PropertyAttribute&)'

This looks like a incorrect Node version, most likely.

@minnixtx
Copy link
Author

With the manual install it was the most recent version, 22.1.0. When I used the script it installed 14.x. Which version do you recommend?

@minnixtx
Copy link
Author

I just wanted to add that install succeeded on Debian 11. So the issue seems to be Debian 12 itself. I'll close this and open a new issue specifically for Debian 12.

@NuSkooler
Copy link
Owner

@minnixtx I'm running 18 on my board, but newer versions are known to break, yes. A round of updates will need to be done to get it to work I imagine.

@crhultay
Copy link
Contributor

crhultay commented Nov 6, 2024

My workaround was (Ubuntu Server 24.04):
Install Python3.10 Build Dependencies

sudo apt install bzip2 libncurses-dev libffi-dev libz-dev libssl-dev libbz2-dev libreadline-dev libsqlite3-dev liblzma-dev

Install pyenv

curl https://pyenv.run | bash
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
pyenv install 3.10
pyenv local 3.10

Re-ran Enigma Installation Script
... installation completed with no errors

It is possible that I will need to insert 'pyenv local 3.10' in the startup script before the BBS starts; however, this proves that the issue with https://github.com/microsoft/node-pty per microsoft/node-pty#646 not being compatible with Python > 3.10 is solved.

We could consider adding this to the installation script, since the future of Python is virtual environments rather than using the system environment. This decouples the dependency on the OS Python interpreter.

crhultay added a commit to crhultay/enigma-bbs that referenced this issue Nov 25, 2024
Added selection menu to install all steps, or individual
Added reference to autoexec.sh
Added Python Runtime Environment installation workflow

The new Python workflow will allow users to run ENiGMA½ on modern Linux distributions such as Ubuntu 24.04 per my note in NuSkooler#537.

It is my strong recommendation that we offer the user the use of pyenv, as this will decouple the distribution's Python interpreter from that of ENiGMA½ -- this will make the software more portable. It is poor advice to give a user that they upgrade their OS Python Interpreter; doing so can break the operating system if there are incompatibilities.
@crhultay
Copy link
Contributor

Raised #580

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

4 participants