Skip to content

New feature resolver triggers extra downloads sometimes. #8776

@ehuss

Description

@ehuss

Problem
The new feature resolver -Zfeatures can trigger downloads of packages that aren't needed. Some examples in Cargo's testsuite are:

  • cfg::ignore_version_from_other_platform
  • offline::offline_unused_target_dep
  • registry::only_download_relevant

Possible Solution(s)
The problem is this line which is checking if a package is a proc-macro. That line should probably be moved down into the map, but that doesn't completely solve the problem.

This will probably be tricky to fix. The check for proc-macro needs to be deferred until after other filter checks (like if the dependency is optional). The deps() method will probably need to be changed to accommodate smarter filtering.

Notes

cargo 1.48.0-nightly (9d1a4863a 2020-10-05)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-features2Area: issues specifically related to the v2 feature resolverC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions