EmbarkStudios / EmbarkStudios/krates

`Krates::direct_dependencies` returns transitive dependencies enabled by feature-gates

Open
#116 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
78
Forks
20
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
When a feature-gate enables a new transitive dependency via a direct dependency, the transitive dependency is listed in the output of `Krates::direct_dependencies`.

**To Reproduce**
A minimal reproduction exists in this repo: https://github.com/BatmanAoD/krates-direct-deps-bug

To reproduce from scratch:

* create a set of crates such that:
* `a` depends on `b`
* `b` has a feature gate that enables one or more dependencies that `a` does not depend on directly
* use `Krates::direct_dependencies` to get the direct dependencies of `a`

**Expected behavior**
Only dependencies listed in the manifest for `a` should be included.

**Device:**
- OS: MacOS
- Version: v0.21.3

Contributor guide

Open the contributing guide

Research direction

Start by running the minimal reproduction linked in the issue and inspect the Krates::direct_dependencies entry point. Trace how feature-gated transitive dependencies enter the result when one crate depends on another. Done means the output contains only dependencies listed directly in the requesting crate's manifest, including for the described feature-gate setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.