Metadeps and dependencies


#1

If you have a crate that finds one or more dependencies via pkg-config, you might be interested in metadeps, which allows you to write your pkg-config dependencies declaratively in Cargo.toml rather than programmatically in build.rs.

metadeps is designed to pull in minimal additional dependencies beyond pkg-config; right now, it pulls in only two: toml 0.2 (with no extra dependencies), and error-chain. I’ve actually thought about dropping error-chain and hand-constructing a simple Error type instead, just to reduce dependencies further.

However, toml has a new version, 0.4, which now requires serde as a dependency. The Servo folks have asked about upgrading the dependency to the newer version of toml. I’m hesitant to upgrade and introduce the additional dependency into the dependency chains of library crates that use (or want to use) metadeps.

So, I’m seeking feedback on this. Would people prefer to see the dependencies kept as minimal as possible, to the point of ditching error-chain, and using either an older version of toml or an alternative toml parser to avoid pulling in serde? Or is this not actually an issue?

I’d welcome feedback either here or on the Reddit post.


#2

I’m not bothered by small dependencies in Rust projects. With Cargo they’re all handled more or less effortlessly. They’re mostly built in parallel and cached.

Non-trivial projects are likely to depend on error_chain and Serde anyway. I presume the (incremental) compilation will be cached and reused, so the extra overhead is negligible.