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

termux android MDB_USE_ROBUST error #318

Open
nikolajiang opened this issue Dec 5, 2024 · 0 comments
Open

termux android MDB_USE_ROBUST error #318

nikolajiang opened this issue Dec 5, 2024 · 0 comments

Comments

@nikolajiang
Copy link

nikolajiang commented Dec 5, 2024

Android currently lacks Robust Mutex support, so it will fail to build lmdb-js in termux(android) app (the defaut option of use_robust is true in binding.gyp).

when use 'ng new' to init angular 19, which use lmdb-js, it has an error like :

../dependencies/lmdb/libraries/liblmdb/mdb.c:463:41: warning: implicit declaration of function 'pthread_mutex_consistent'; did you mean 'pthread_mutex_init'? [-Wimplicit-function-declaration]
  463 | #define mdb_mutex_consistent(mutex)     pthread_mutex_consistent(mutex)
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~
../dependencies/lmdb/libraries/liblmdb/mdb.c:13022:31: note: in expansion of macro 'mdb_mutex_consistent'
13022 |                         rc2 = mdb_mutex_consistent(mutex);
      |                               ^~~~~~~~~~~~~~~~~~~~
make: *** [lmdb.target.mk:132: Release/obj.target/lmdb/dependencies/lmdb/libraries/liblmdb/mdb.o] Error 1
make: Leaving directory '/data/data/com.termux/files/home/test-angular/node_modules/lmdb/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.<anonymous> (/data/data/com.termux/files/home/test-angular/node_modules/node-gyp/lib/build.js:216:23)
gyp ERR! System Linux 4.9.186-perf-g10af704
gyp ERR! command \"/data/data/com.termux/files/usr/bin/node\" \"/data/data/com.termux/files/home/test-angular/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"
gyp ERR! cwd /data/data/com.termux/files/home/test-angular/node_modules/lmdb
gyp ERR! node -v v22.8.0
gyp ERR! node-gyp -v v11.0.0
gyp ERR! not ok"

Whether it is necessary to make use_robust default to be true in the binding.gyp? Even if there is already relevant code in file mdb.c

#ifndef MDB_USE_ROBUST
/* Android currently lacks Robust Mutex support. So does glibc < 2.4. */
# if defined(MDB_USE_POSIX_MUTEX) && (defined(__ANDROID__) || \
	(defined(__GLIBC__) && GLIBC_VER < 0x020004))
#  define MDB_USE_ROBUST	0
# else
#  define MDB_USE_ROBUST	1
# endif
#endif /* !MDB_USE_ROBUST */
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

1 participant