On 32-bit system, ./configure gives:
Checking for a 64-bit host to support lmdb : not found
--without-ldb-lmdb implied as this host is not 64-bit
Then make test fails:
make test called, but ldb was built --without-ldb-lmdb
LMDB works on 32-bit system. So why ?
Complete build log:
There reason is probably (lib/ldb/ldb_mdb/ldb_mdb.c line 688):
688 const size_t mmap_size = 8LL * GIGABYTE;
734 * Currently we set a 8Gb maximum database size
735 * via the constant mmap_size above
737 ret = mdb_env_set_mapsize(*env, mmap_size);
Couldn't we use only 2GB for mmap_size on 32bit?
We would have to use a tiny map size, like 256MB or so, because we map multiple databases and because LMDB has not reopen call, we map them multiple times.
The only way we could possibly use LMDB on a 32 bit host is if the host OS provides the lmdb lib built in the slower VL32 mode.
This is sad.
How can we still allow "make test" to success?
Created attachment 14508 [details]
2GB-on-32bit -> failure
I can confirm that even with 256MB, make test fails with a lot of:
Failed to connect to 'mdb://apitest.ldb' with backend 'mdb': Could not open DB apitest.ldb: Cannot allocate memory
Created attachment 14509 [details]
256MB-on-32bit -> success
Oups, previous patch was 2GB.
Actually, 256MB works.
Andrew, could we skip only the lmdb tests instead? Current status with no coverage on 32bit will hide future regressions.
Created attachment 14516 [details]
Skip LMDB tests when not HAVE_LMDB
I took a different path: skip LMDB tests when support is not available.
Patch is against ldb only and should be ported to the whole samba tree.
Andrew, what do you think?
(In reply to Mathieu Parent from comment #7)
I'm still nervous, because in broader Samba we have had actual tests silently vanish this way.
In particular, in waf env.FOO is  if FOO was never set.
So, I'll accept this if a C and python test is written such that if the HAVE_LMDB is wrong, it fails. So if HAVE_LMDB is 0, then it tries to crate an lmdb and checks for the correct error code.
(In reply to Andrew Bartlett from comment #8)
Done, and push as Gitlab MR: https://gitlab.com/samba-team/samba/merge_requests/266