Open
Description
Motivation
#318 revealed a bug: two functions were missing #[no_mangle]
attribute, which effectively made them absent from the API.
How can we prevent bugs arising involving deletion of a function belonging to the API?
Note: in the case of materialized views API, those functions were there, but with mangled names; so effectively, they were missing from the API.
Idea
- Create a C source file that calls ALL functions belonging to the driver's public API.
- Divide the full API of the original CPP Driver into two categories:
- supported or quasi-supported.
- by quasi-supported I mean functions that we implement, but they "do nothing" (because they are similarly no-ops in CPP Driver, or it's otherwise acceptable that we make them no-ops in CPP-Rust Driver).
- nonsupported (not implemented).
- supported or quasi-supported.
- For the nonsupported group, create another C source file with stub implementations of all nonsupported functions.
- Assert that combination
(test_file.c, nonsupported_stubs.c, cpp-rust-driver.a)
links successfully.- for supported functions, we make sure that they are indeed exposed by the driver. Otherwise linker shouts at unresolved references.
- for nonsupported functions, we make sure that they are indeed NOT exposed by the driver. Otherwise linker shouts at multiple symbols with the same name.