canonical / go-dqlite

Go bindings for libdqlite
https://dqlite.io
Apache License 2.0
432 stars 69 forks source link

internal/bindings: Fall back if dqlite_node_set_auto_recovery is missing #279

Closed cole-miller closed 1 year ago

cole-miller commented 1 year ago

This uses weak linkage to implement a graceful fallback at run time when the dqlite_node_set_auto_recovery symbol is not provided by libdqlite. With this merged, we can cut a release of go-dqlite without increasing the minimum supported libdqlite version.

Signed-off-by: Cole Miller cole.miller@canonical.com

cole-miller commented 1 year ago

@MathieuBordere -- I did experiment with doing this without the weak symbol trick, but that seems to be a necessary ingredient. Otherwise the resulting undefined symbol error from the dynamic loader can't be handled.