scylladb / scylladb/cpp-rs-driver
Prevent API regressions
Open
@wprzytula is already working on this.
Since Jun 6, 2025.
area/testing
- Dominant language
- C++
- Stars
- 26
- Forks
- 19
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 7
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.