-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure FDB_API_VERSION dynamically #37
Conversation
VsnInfo = os:cmd("fdbcli --version"), | ||
{match, [ProtocolStr]} = re:run(VsnInfo, "protocol ([a-f0-9]*)", [{capture, [1], list}]), | ||
ProtocolVsn = list_to_integer(ProtocolStr, 16), | ||
APIVersionBytes = (ProtocolVsn band 16#0000000FFF00000) bsr 20, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's quite neat!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hah, I thought it seemed quite hacky, but looking at the way it's defined in FDB I suspect this ends up being pretty reliable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A very nice improvement
There is a note about 610 support but otherwise if the build passes +1
While we are technically green on 6.3 here, it seems there are a handful of changes in API version 630 that we ought to be accounting for: https://apple.github.io/foundationdb/api-version-upgrade-guide.html#api-version-630 Specifically:
|
Will squash the CI commits into one to clean up the history, but this is stacked on top of #33 so I think I may wait until that one is merged to proceed further. |
3d879cb
to
26986b3
Compare
This is the new name for ENABLE_SLOW_TASK_PROFILING.
This patch set dynamically detects the maximum API version supported by the installed FDB client library and builds the NIF wrapper against that version automatically.
Older API versions can still be selected at runtime as usual through the application environment; this just ensures we have the largest possible range at our disposal, without restricting the versions of the client library we can support with a single branch of this codebase.
Closes #34
Closes #38