During the build of ldb 2.0.7 in Debian mipsel, ppc64el, ia64, powerpc and ppc64 (riscv64 fails for another reason, and can be ignored), [1], the tests fail with: Could not open environment for bin/st/tmp/tmp0n0e2arg/guidindexpackv1.ldb: (-30793) MDB_INVALID: File is not an LMDB file Repacking database from v1 to v2 format (first record OU=GUIDPFTEST10,DC=SAMBA,DC=ORG) Could not open environment for bin/st/tmp/tmp0n0e2arg/guidindexpackv1.ldb: (-30793) MDB_INVALID: File is not an LMDB file Repacking database from v2 to v1 format (first record OU=GUIDPFTEST9,DC=SAMBA,DC=ORG) Could not open environment for bin/st/tmp/tmp0n0e2arg/guidindexpackv1.ldb: (-30793) MDB_INVALID: File is not an LMDB file Could not open environment for bin/st/tmp/tmp0n0e2arg/guidindexpackv1.ldb: (-30793) MDB_INVALID: File is not an LMDB file Could not open environment for bin/st/tmp/tmp0n0e2arg/guidindexpackv1.ldb: (-30793) MDB_INVALID: File is not an LMDB file Could not open environment for bin/st/tmp/tmp0n0e2arg/guidindexpackv1.ldb: (-30793) MDB_INVALID: File is not an LMDB file Repacking database from v1 to v2 format (first record OU=GUIDPFTEST10,DC=SAMBA,DC=ORG) ltdb: tdb(bin/st/tmp/tmp0n0e2arg/guidindexpackv1.ldb): tdb_transaction_setup_recovery: transaction data over new region boundary ltdb: tdb(bin/st/tmp/tmp0n0e2arg/guidindexpackv1.ldb): tdb_transaction_prepare_commit: failed to setup recovery data Failure during prepare_write): Corrupt database -> Operations error ltdb: tdb(bin/st/tmp/tmp0n0e2arg/guidindexpackv1.ldb): tdb_transaction_cancel: no transaction ECould not open environment for bin/st/tmp/tmpvbu_3y3p/guidpackformattest.ldb: (-30793) MDB_INVALID: File is not an LMDB file Could not open environment for bin/st/tmp/tmpvbu_3y3p/guidpackformattest.ldb: (-30793) MDB_INVALID: File is not an LMDB file Could not open environment for bin/st/tmp/tmpvbu_3y3p/guidpackformattest.ldb: (-30793) MDB_INVALID: File is not an LMDB file Could not open environment for bin/st/tmp/tmpvbu_3y3p/guidpackformattest.ldb: (-30793) MDB_INVALID: File is not an LMDB file Repacking database from v2 to v1 format (first record OU=GUIDPFTEST0,DC=SAMBA,DC=ORG) Could not open environment for bin/st/tmp/tmpvbu_3y3p/guidpackformattest.ldb: (-30793) MDB_INVALID: File is not an LMDB file Could not open environment for bin/st/tmp/tmpvbu_3y3p/guidpackformattest.ldb: (-30793) MDB_INVALID: File is not an LMDB file Could not open environment for bin/st/tmp/tmpvbu_3y3p/guidpackformattest.ldb: (-30793) MDB_INVALID: File is not an LMDB file Could not open environment for bin/st/tmp/tmpvbu_3y3p/guidpackformattest.ldb: (-30793) MDB_INVALID: File is not an LMDB file Repacking database from v1 to v2 format (first record OU=GUIDPFTEST2,DC=SAMBA,DC=ORG) Could not open environment for bin/st/tmp/tmpvbu_3y3p/guidpackformattest.ldb: (-30793) MDB_INVALID: File is not an LMDB file Could not open environment for bin/st/tmp/tmpvbu_3y3p/guidpackformattest.ldb: (-30793) MDB_INVALID: File is not an LMDB file Repacking database from v2 to v1 format (first record OU=GUIDPFTEST1,DC=SAMBA,DC=ORG) Could not open environment for bin/st/tmp/tmpvbu_3y3p/guidpackformattest.ldb: (-30793) MDB_INVALID: File is not an LMDB file Could not open environment for bin/st/tmp/tmpvbu_3y3p/guidpackformattest.ldb: (-30793) MDB_INVALID: File is not an LMDB file Repacking database from v1 to v2 format (first record OU=GUIDPFTEST4,DC=SAMBA,DC=ORG) Could not open environment for bin/st/tmp/tmpvbu_3y3p/guidpackformattest.ldb: (-30793) MDB_INVALID: File is not an LMDB file Could not open environment for bin/st/tmp/tmpvbu_3y3p/guidpackformattest.ldb: (-30793) MDB_INVALID: File is not an LMDB file Could not open environment for bin/st/tmp/tmpvbu_3y3p/guidpackformattest.ldb: (-30793) MDB_INVALID: File is not an LMDB file Could not open environment for bin/st/tmp/tmpvbu_3y3p/guidpackformattest.ldb: (-30793) MDB_INVALID: File is not an LMDB file Repacking database from v2 to v1 format (first record OU=GUIDPFTEST5,DC=SAMBA,DC=ORG) Could not open environment for bin/st/tmp/tmpvbu_3y3p/guidpackformattest.ldb: (-30793) MDB_INVALID: File is not an LMDB file Could not open environment for bin/st/tmp/tmpvbu_3y3p/guidpackformattest.ldb: (-30793) MDB_INVALID: File is not an LMDB file . ====================================================================== ERROR: test_guid_indexed_v1_db (__main__.GUIDIndexAndPackFormatTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/python/repack.py", line 197, in test_guid_indexed_v1_db self.toggle_guidindex_check_pack() File "tests/python/repack.py", line 123, in toggle_guidindex_check_pack self.set_guid_indexing(enable=enable) File "tests/python/repack.py", line 76, in set_guid_indexing self.l.modify(modmsg) _ldb.LdbError: (1, 'Failure during prepare_write): Corrupt database -> Operations error') https://buildd.debian.org/status/fetch.php?pkg=ldb&arch=mipsel&ver=2%3A2.0.7-1&stamp=1569296738&raw=0 https://buildd.debian.org/status/fetch.php?pkg=ldb&arch=ppc64el&ver=2%3A2.0.7-1&stamp=1569273968&raw=0 [1]: https://buildd.debian.org/status/package.php?p=ldb&suite=experimental
It seems that lib/ldb/tests/guidindexpackv1.ldb is arch-specific. What to do? - Having different ldb depending on the arch (or endianness, or something else)? - Building the ldb with a python script? - Ensure that the ldb format is arch-independent (harder)?
I've tested: ldbsearch -d0 -H tests/guidindexpackv1.ldb '(|(objectClass=*)(distinguishedName=*))' > debian/guidindexpackv1.ldif Then, during build: bin/ldbadd -H tests/guidindexpackv1-debian.ldb < debian/guidindexpackv1.ldif make test But this failed with: ====================================================================== FAIL: test_guid_indexed_v1_db (__main__.GUIDIndexAndPackFormatTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/python/repack.py", line 185, in test_guid_indexed_v1_db self.assertEqual(len(guid_keys), self.num_recs_added) AssertionError: 0 != 10 It seems that the DB created with ldbadd is already packed with v2. How can I force v2 with ldbadd?
(In reply to Mathieu Parent from comment #2) I've also patched tests/python/repack.py to use tests/guidindexpackv1-debian.ldb, of course.