diff --git a/Cargo.lock b/Cargo.lock index afe9e33..b4a29a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -989,9 +989,9 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "registry-conformance" -version = "0.5.1" +version = "0.5.2" source = "sparse+https://integer32llc.github.io/registry-conformance/" -checksum = "e7832c5e5390f7d9546f65df6b36758bd755c82310c43255a741e8bd9524101c" +checksum = "7bf0349976913b09e95602e5dcab7f99a6792c389404e972582a6bf387656b7a" dependencies = [ "base64", "futures", diff --git a/Cargo.toml b/Cargo.toml index 23eef7a..6794546 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ lint_groups_priority = { level = "allow", priority = 1 } # Remove after 1.80. ht [workspace.dependencies] argh = { version = "0.1.12", default-features = false } -registry-conformance = { version = "0.5.0", registry = "registry-conformance" } +registry-conformance = { version = "0.5.2", registry = "registry-conformance" } snafu = { version = "0.8.2", default-features = false, features = ["rust_1_65", "std"] } tokio = { version = "1.37.0", default-features = false, features = ["macros", "process", "rt-multi-thread"] } diff --git a/src/main.rs b/src/main.rs index f5924c1..9d486e1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1014,9 +1014,33 @@ enum ExtractRootCargoTomlError { fn adapt_cargo_toml_to_index_entry( global: &Global, config: &ConfigV1, - cargo_toml: cargo_toml::Root, + mut cargo_toml: cargo_toml::Root, checksum_hex: String, ) -> index_entry::Root { + // Remove features that refer to dev-dependencies as we don't + // track those anyway. + { + // Ignore dependencies that also occur as a regular or build + // dependency, as we *do* track those. + let reg_dep_names = cargo_toml.dependencies.keys(); + let build_dep_names = cargo_toml.build_dependencies.keys(); + let mut only_dev_dep_names = cargo_toml.dev_dependencies.keys().collect::>(); + for name in reg_dep_names.chain(build_dep_names) { + only_dev_dep_names.remove(name); + } + + for name in only_dev_dep_names { + // We don't care about the official package name here as the + // feature syntax has to match the user-specified dependency + // name. + let prefix = format!("{name}/"); + + for enabled in cargo_toml.features.values_mut() { + enabled.retain(|enable| !enable.starts_with(&prefix)); + } + } + } + let mut deps: Vec<_> = cargo_toml .dependencies .into_iter() @@ -1126,6 +1150,9 @@ mod cargo_toml { #[serde(default)] pub build_dependencies: Dependencies, + #[serde(default)] + pub dev_dependencies: Dependencies, + #[serde(default)] pub target: BTreeMap, }