I’ve been looking to make some small improvements to the build system for our FDB Erlang bindings, one of which is to dynamically set
FDB_API_VERSION based on the version of the underlying C library available at build time. As you might expect, the goal is to allow users who have the latest FDB client installed to use the current API, while ensuring the bindings still build successfully without any code changes on systems that are using older versions.
So the question is, what’s the best way to extract the maximum supported version? I see a few options:
- the 6.3.x releases include
foundationdb-clientso we could extract the client version from there and map it to an API version
fdbcli --versionincludes a
fdb00b062010001- are the bytes in that field documented? The API Version is certainly buried in there.
fdb_c_version.py looks like it is probably an extraction of the dance that
fdbcliis doing to derive the protocol version, but it too reports the protocol in this format that is not quite the same as what we need to supply for
I see other out-of-tree maintainers struggling with similar issues, so I’m hoping we can come up with some best practice that we can apply uniformly across the out-of-tree bindings. My guess would be to parse the protocol field of the fdbcli output.