Coder Social home page Coder Social logo

Comments (4)

alexeiakimov avatar alexeiakimov commented on May 20, 2024

Thank you @kw217 for the detailed explanation. It seems that there is a subtle problem here - the version of bindgen utility. Since it is not specified, the new Rust code can be incompatible with the old one. In particular

  • in times of Cassandra driver 2.10 the bindgen mapped size_t to usize
  • later after rust-lang/rust-bindgen#1671 bindgen start to map size_t to some other type depending on the target platform. On my machine it is u64
  • it means that some functions from public API will have different signature, for example get_future_error_message
  • formally the new generated code is not backward compatible, although the original C++ drivers are backward compatible

The old behavior can be restored by using the --size_t-is-usize option with bindgen. @kw217 do you think it is necessary to preserve the original size_t -> usize binding, otherwise a new major version of the library should be released? Thank you.

from cassandra-sys-rs.

kw217 avatar kw217 commented on May 20, 2024

Thanks for the analysis. I think sticking with usize is the best approach. It will require a new major version anyway (since clients are forced to install a new libcassandra), but I'd prefer not to force them to make any other changes.

from cassandra-sys-rs.

kw217 avatar kw217 commented on May 20, 2024

FTR I've updated CONTRIBUTING.md to include my notes from above.

from cassandra-sys-rs.

kw217 avatar kw217 commented on May 20, 2024

Closing - #39 has upgraded the driver, and #41 has added the notes above to the docs.

from cassandra-sys-rs.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.