ejdb
ejdb copied to clipboard
EJDB2 Python Bindings
I tried to write my own python bindings ( It's the first time I've needed/wanted to write bindings from scratch :smile: ) using the precompiled ejdb2 and the headers after compiling the project from source, but I haven't been able to get this all working using cython or cffi. I also started to try and add a new binding into the project and its build tools incase that was easier, but my C IDE (JetBrains CLion) doesn't like the current project layout... something about the include paths for static compilation #include <ejdb2/iowow/iwkv.h> rubs it the wrong way...
So for now, I'm just going to put my polite request for python bindings into the issue tracker in the hopes someone else has the time to work it out, or knows how and has the time to do it.
Thank you for the request Samuel! We are on the way of implementation Rust and Python bindings hope will release it September. I will check sample project in CLion and will back shortly.
Great to hear Python and Rust bindings are on the way!
On the topic of CLion, it seems to be confused by some of the header paths, like the the use of #include <ejdb2/iowow/iwkv.h> as part of linking iowow statically. If theres any advice you have about getting the repo/project to open and build with CLion, I'm happy to give it a shot.
- CLion builds project without problems - just open the project, then run
Build -> Build Project - After first build run
Reload CMake Projectand you will be able to navigate to#include <ejdb2/iowow/iwkv.h>it located inbuild/includedirectory
here is the python binding I created:
https://github.com/shi-yan/ejdb2rs/tree/master/python
it works on my local machine, but I ran into issues when trying to publish it to the public package repository.
they have very strict restriction regarding what libraries you could link. to support very old linux distributions, they could only link very old glibc.
the problem is, ejdb doesn't build with old glibc:
some issues I saw:
src/extern_iowow/src/platform/unix/unix.c:103:34: error: ‘struct stat’ has no member named ‘st_atim’; did you mean ‘st_atime’?
103 | fs->atime = _IW_TIMESPEC2MS(st.st_atim);
src/extern_iowow/src/log/iwlog.h:141:14: error: unknown type name ‘locale_t’
141 | FILE *out, locale_t locale, iwlog_lvl lvl, iwrc ecode,
the suggested way of building python package is using a docker container:
https://github.com/PyO3/maturin#manylinux-and-auditwheel
which has only glibc 2.17
ldd --version ldd
ldd (GNU libc) 2.17
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
to move forward, need to make sure ejdb can build under this docker container:
quay.io/pypa/manylinux2014_x86_64
https://stackoverflow.com/questions/59451069/binary-wheel-cant-be-uploaded-on-pypi-using-twine
@shi-yan https://github.com/pypa/cibuildwheel is a convenient way to build those wheels (with github actions for example). It will use the appropriate Docker containers automatically under Linux.
Thank you for the link, however the issue isn't how to build wheels, the issue is on the ejdb side.