Skip to content

Make features additive #52

Closed
Closed
@chmp

Description

@chmp

Currently the features are non additive. E.g., using arrow-50 and arrow-49 will select arrow=50. In large dependency trees this may cause issues as multiple crates might select different versions of the underlying crates.

User A builds a crate on top of serde_arrow using say the arrow48 feature and user B else builds a crate on top of serde_arrow using the arrow49 feature. As soon as someone combines both of these crates, feature unification will select both the arrow48 and arrow49 features. In this case, serde_arrow will select the arrow=49 depedency and user A's crate will break, in probably hard to diagnose ways. Library authors should be able to select a fixed arrow version and stick with it, regardless of the larger context of the program.

Potential interface

  • stick with one fixed arrow version for each major version of serde_arrow
  • track only this fixed version using the shorthand functions
  • export a versioned module for each supported version
  • e.g., serde_arrow::to_arrow => fixed version, serde_arrow::arrow_49::to_arrow => arrow=49

Option 1: Generate wrappers

  • Generate the wrappers for each arrow version, e.g., using macros or templates.
  • Generate code for each activated version
  • Re-export the maximum version as the "default" (current interface)
  • Instruct library authors to use the specific versions
  • Add a @generated marker to the generated files (see Include @generated in output file capnproto/capnproto-rust#153)

Option 2: Use FFI

Only maintain support for the latest arrow version and use the FFI interface to convert between version?

Alternatives

  1. Give up supporting multiple different arrow versions and simply default to latest.

Notes

  • Piggy back of marrow, design interface around it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions