scylladb / scylladb/cpp-rs-driver

Prevent API regressions

Open
#319 1 comment 0 reactions 1 assignee View on GitHub

@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
  1. Create a C source file that calls ALL functions belonging to the driver's public API.
  2. 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).
  3. For the nonsupported group, create another C source file with stub implementations of all nonsupported functions.
  4. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.