Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make features additive #52

Open
Tracked by #238
chmp opened this issue May 14, 2023 · 0 comments
Open
Tracked by #238

Make features additive #52

chmp opened this issue May 14, 2023 · 0 comments

Comments

@chmp
Copy link
Owner

chmp commented May 14, 2023

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant