Skip to content

Conversation

@Saplyn
Copy link

@Saplyn Saplyn commented Nov 7, 2025

What does this PR try to resolve?

Before, resolve_all_features() isn't filtering dependencies, as it uses the set returned by Resolve::deps() directly which is mostly unfiltered. This PR fixes it by having the set goes through PackageSet::filter_deps()'s filter.

Note that this patch changed resolve_all_features()'s function signature as well as made PackageSet::filter_deps() public.

Close #15399

How to test and review this PR?

As described in #15399, cargo test --frozen should not panic (doesn't try to download unneeded deps) when does the following:

git clone https://github.com/hickory-dns/hickory-dns
cd hickory-dns
git checkout v0.25.1
mkdir .cargo_home
CARGO_HOME=.cargo_home cargo fetch --locked --target=x86_64-unknown-linux-gnu
CARGO_HOME=.cargo_home cargo test --frozen -p hickory-resolver

More discussion on Zulip chat.

@rustbot rustbot added the A-cargo-targets Area: selection and definition of targets (lib, bins, examples, tests, benches) label Nov 7, 2025
@epage
Copy link
Contributor

epage commented Nov 7, 2025

Not sure I'm in a good place to give feedback on the change itself at this time but wanted to highlight PR expectations (https://doc.crates.io/contrib/process/working-on-cargo.html#submitting-a-pull-request)

  • A test will be needed for this
  • It is really helpful if you create a test in its own commit that shows the panic and then put this commit on top that removes the panic. Then the diff between these two commits shows how behavior changed. This allows you to verify the test is testing the right thing and gives a good demonstration of the fix

@Saplyn
Copy link
Author

Saplyn commented Nov 8, 2025

Thanks! I'll look into how to write a test for this pr and try implementing it before making it ready for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cargo-targets Area: selection and definition of targets (lib, bins, examples, tests, benches)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cargo test requires windows-only dependency on linux

3 participants