myTermux
myTermux copied to clipboard
`LINK` env variable conflicts with make
The latest version of gemini-cli was failing to install npm install -g @google/gemini-cli/, and after investing, I saw:
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/node-pty/build'
CXX(target) Release/obj.target/pty/src/unix/pty.o
../src/unix/pty.cc:609:10: warning: first argument in call to 'memset' is a
pointer to non-trivially copyable type 'Nan::Persistent<v8::Function>' [-Wnontrivial-memcall]
609 | memset(&baton->cb, -1, sizeof(baton->cb));
| ^
../src/unix/pty.cc:609:10: note: explicitly cast the pointer to silence this
warning
609 | memset(&baton->cb, -1, sizeof(baton->cb));
| ^
| (void*)
../src/unix/pty.cc:826:1: warning: cast from 'void
(*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)' (aka 'void (*)(Local<v8::Object>)') to
'node::addon_register_func'
(aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void *)') converts to incompatible
function type [-Wcast-function-type-mismatch]
826 | NODE_MODULE(pty, init)
| ^~~~~~~~~~~~~~~~~~~~~~
/data/data/com.termux/files/home/.cache/node-gyp/22.20.0/include/node/node.h:1278:3: note:
expanded from macro 'NODE_MODULE'
1278 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/data/data/com.termux/files/home/.cache/node-gyp/22.20.0/include/node/node.h:1244:7: note:
expanded from macro 'NODE_MODULE_X'
1244 | (node::addon_register_func) (regfunc), \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
SOLINK_MODULE(target) Release/obj.target/pty.node
make: https://github.com/mayTermux: No such file or directory
make: *** [pty.target.mk:137: Release/obj.target/pty.node] Error 127
make: Leaving directory '/data/data/com.termux/files/usr/lib/node_modules/@google/gemini-cli/node_modules/node-pty/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
https://github.com/mayTermux/myTermux/blob/e5e1475bcda53694d35ffab97c2001913a52cc63/.zshrc#L15..L16
After I unset LINK, it installed fine.
For my particular issue, the problem was due to a reference in the Makefile for node-pty, but I recall running into this issue once before with something else, and it seems that LINK is a common environment variable used in Makefiles: https://github.com/search?q=%22LINK.target+%3F%3D+%24%28LINK%29%22&type=code