Skip to content

rustdoc-based tools hardcode --all-features, breaking crates with mutually-exclusive features #59

@phoxwupsh

Description

@phoxwupsh

All the rustdoc-JSON–backed tools (search_items, search_items_preview, search_items_fuzzy, get_item_details, get_item_docs, get_item_source, list_crate_items, and the implicit caching in cache_crate_from_cratesio) appear to build the crate's documentation with --all-features (or otherwise enable every declared feature). Unlike structure, these tools expose no feature-control parameters (features, no_default_features, all_features), so this behavior cannot be turned off.

This permanently breaks any crate that declares mutually-exclusive features, because --all-features activates conflicting features simultaneously and the rustdoc build fails to compile.

Reproduction

Crate: chromiumoxide 0.9.1

  • structure with no_default_features: trueworks.
  • search_items / get_item_details / list_crate_items / caching → fail to compile.

Root cause

chromiumoxide forwards two intentionally mutually-exclusive features down to chromiumoxide_fetcher:

# chromiumoxide/Cargo.toml
default = ["bytes"]                       # neither fetcher nor zip on by default
zip0    = ["chromiumoxide_fetcher/zip0"]
zip8    = ["chromiumoxide_fetcher/zip8"]

chromiumoxide_fetcher declares the SAME zip crate twice under renamed deps (zip0 = zip 0.6, zip8 = zip 8) and re-exports ZipArchive from whichever one is enabled:

// chromiumoxide_fetcher/src/runtime/zip/mod.rs
#[cfg(feature = "zip0")]
pub use zip0::ZipArchive;
#[cfg(feature = "zip8")]
pub use zip8::ZipArchive;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions