mongodb / mongo-rust-driver

The official MongoDB Rust Driver
https://www.mongodb.com/docs/drivers/rust/current/
Apache License 2.0
1.44k stars 164 forks source link

RUST-1680: put `trust-dns-resolver` under feature flag #896

Open Logarithmus opened 1 year ago

Logarithmus commented 1 year ago

As far as I understand, this is only used for mongodb+srv:// connection strings. I don't use it, and trust-dns-resolver takes significant time to compile, and is whopping 34k lines of code! https://lib.rs/crates/trust-dns-resolver. So making it an optional dependency would be very appreciated. I can make a PR if you say my reasoning is correct.

abr-egn commented 1 year ago

Hi!

You're right that moving trust-dns-resolver to optional would make sense; unfortunately, that would be a breaking change, so we need to defer that to when we make a 3.0 release (won't be in the near future). I've filed https://jira.mongodb.org/browse/RUST-1680 to track it so we include it when we do get to that point!

Logarithmus commented 1 year ago

@abr-egn in fact we can make trust-dns-resolver feature enabled by default, this way it won't be a breaking change and everyone will be happy!

abr-egn commented 1 year ago

Even with that, it'll still be breaking for users who have disabled default features.