Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow crate users to opt out of some platform support
We have gotten several inbound tickets with users expressing concern over the inclusion of `cxx` to support the haiku platform. Additionally, for my personal use, I would prefer to be able to prune things like `wasm-bindgen` from my lockfile when not expressly enabling Wasm platform support, similar to the approach the `getrandom` crate takes. This commit adds cargo features which allow disabling platform support for each platform that requires a third party dependency. Currently, that set of platforms is: - android - all apple targets - haiku - wasm - windows This commit adds a new default feature, `platform-all`, which retains the existing behavior of all platforms being enabled by default. `platform-all` is a meta feature which enables all of the other platform support features. For example, to disable haiku support, users would add the following to their `Cargo.toml`: ```toml iana-time-zone = { version = "0.2", default-features = false, features = ["platform-android", "platform-apple", "platform-wasm", "platform-windows"] } ``` The addition of a new default feature is a breaking change because it may break the build for folks currently depending on this crate with `default-features = false`. I'm not sure if this is the direction we want to go, but it would address the ask from these tickets: - #89 - #88 I know that cargo won't build deps unless compiling for a particular platform, but practically, most users don't want or need Haiku or Wasm support. These targets have heavy dependencies which end up in the lock file. Deps in the lock file have a carrying cost in terms of supply chain risk and need for patching/updating.
- Loading branch information