Skip to content

Prevent API regressions #319

Open
@wprzytula

Description

@wprzytula

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.

Metadata

Metadata

Assignees

Labels

area/testingRelated to unit/integration testing

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions