Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-1208

Clean up and future-proof features

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 3.0.0
    • Affects Version/s: None
    • Component/s: None

      We're currently in a difficult position regarding our feature flags. Our recommendation for users who want to use our sync API has been to disable default features and add features = [sync] to their Cargo.toml. The sync feature enables the async-std-runtime feature, because we originally only supported sync with async-std. However, this presented a problem when adding support for using the tokio runtime with the sync API in RUST-995. Ideally we'd remove the enabling of async-std from the sync feature and allow users to specify a runtime themselves, but doing so would mean breaking any code that enables sync as described above, as no async runtime would be enabled. Because of this we needed to introduce a separate tokio-sync feature, which adds unnecessary verbosity to our set of features. When we do a 3.0 release we should clean up our features by removing tokio-sync and updating sync not to pull in any runtimes.

      In addition to cleaning up these issues, we should also audit our dependencies to see if there's anything we should move behind feature flags to avoid future situations like these.

      Update: this work should also entail removing the bson-related feature flags from the driver and documenting that users should add bson as a direct dependency instead. (https://github.com/mongodb/mongo-rust-driver/issues/909)

            Assignee:
            abraham.egnor@mongodb.com Abraham Egnor
            Reporter:
            isabel.atkinson@mongodb.com Isabel Atkinson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: