Closed Drup closed 4 years ago
Alternative proposal: pick a version of lmdb, and bundle it.
There is a bug fixed in lmdb 0.9.21. That's why I did 48b676c7deea699bac9985018badc36bc79a8295. I'm wondering if this somehow stopped working. I'll try to fix it with #20. I don't yet see the need for conditional compilation or bundling a specific version yet. Its not our job to fix bugs in the lmdb backend by working around them in the binding. The only problem we are facing at the moment are failing tests in CI. But they are supposed to fail, because they trigger a bug. I would rather "recommend-depend" on lmdb >=0.9.21.
Its not our job to fix bugs in the lmdb backend by working around them in the binding.
Well, that would be a strong point towards bundling a version of lmdb in the library. This would allow us to choose the version, and upgrade it at your own pace.
The point I was trying to make is that we should not work around bugs in the lmdb backend by any means. This includes bundling lmdb, too. The other point was that there is currently no need to take action in that direction, because the binding will compile even on older versions of the back-end lmdb. Just the tests will fail, and rightfully do so. The only problem we face at the moment is CI using a buggy lmdb. I would rather fix this in CI.
Nice. Travis works again in #20. :satisfied:
Well, the reason I propose conditional compilation and/or bundling is not to walk around bugs, it's to be able to bind functions in newer versions of lmdb.
Ah, ok. That's sensible. At the moment I'm hoping for the backend api to stay stable :sweat:
Since the lmdb backend as well as the stubs are written in C, we can use the C preprocessor and MDB_VERSION_*
macros to do conditional compilation - at least on the C stubs side of things. On non-availability of some feature in the backend we would then be able to raise an exception like Invalid_argument "not supported by this version of lmdb, need at least 0.9.21"
.
This won't allow changes in the OCaml interface obviously, and therefore only allow to fail at runtime.
Can we close this issue for now?
The problem is still the same, I don't see why we should close. It's almost impossible to distribute the library without either bundling, or handling multiple version of the C library.
Can you elaborate? What problem are we facing now? Is this a blocker for release?
Yes, it is a blocker: the ocaml bindings have to be compatible with the installed version of lmdb, which is installed by the system, and thus we don't have control over its version.
Either we bundle lmdb, and choose a specific version, or we make sure we are compatible with many versions.
I believe we are compatible with many versions. Debian oldstable uses 0.9.14. You think this would be a reasonable version to start support? I can do some tests this evening.
I tested lmdb 0.9.14
…0.9.24
. This is what I found:
mdb_env_copy2
and others.liblmdb.so
shared library is binary-compatible over all those versions. So that a test executable built with 0.9.14
can at runtime be linked to 0.9.24
and vice versa.0.9.19
has failing tests fold_right_all
and *_all
0.9.16
also fails on walk dup
The oldest lmdb versions I could find on Unix distributions are
0.9.14
0.9.17
0.9.14
in 2015, is now at 0.9.24
0.9.14
Bundling lmdb is problematic, because at least on OpenBSD it needs to be patched to always use WRITE_MAP
due to the missing unified buffer cache on OpenBSD. OpenBSD ships with a patched version we can rely on. I don't know about other OSes.
Ok, this is fairly convincing. I feel like we should try to test that in CI, but it's always complicated.
Since I'm pretty annoyed of errors in travis that I cannot reproduce locally I'm very reluctant to adding complexity to the travis scripts.x
If you want to ensure we stay compatible with let's say 0.9.17
, we could just remove the update to 0.9.21
from .travis-ci.sh
and tweak the test cases to allow failure on lmdb <0.9.21
.
Could you please clarify what you actually want to test.
Could you please clarify what you actually want to test.
The different systems, with their different lmdb versions. We do not have to do this now, just something that would be good.
Ok. I see. Testing builds against different versions of lmdb is not difficult to script. But this has nothing to do with conditional compilation. So may we close this issue now?
You really want to close all the issues. :D
Yes, we can
@madroach I think we really need something like that for reliability, especially in CI.