Comments (9)
Tested on Conrod.
The dev dependencies are includes in the graph appear similar to normal dependencies.
from cargo-graph.
Here is an image of the generated graph with the command:
cargo graph --manifest-file Cargo.toml --dev-deps=false | dot -Tpng > Cargo.png
from cargo-graph.
Project::parse_root_deps
looks right.
I wonder whether it should be any filtering in Project::parse_lock_file
or the filtering is done when rendering the graph.
from cargo-graph.
Seems that all are added as build dependencies https://github.com/kbknapp/cargo-graph/blob/master/src/project.rs#L111
from cargo-graph.
Same here
Octavo:
from cargo-graph.
I think that a simple for loop might not be enough to do the filtering.
- All packages depended on by a dev-dependency should count as
DevKind::Dev
unless it is depended on by a dependency - Packages might come in any order in Cargo.lock
I suggest the following:
- Loop through all packages, build a
HashMap
storingOption<DevKind>
per package name. - Loop while any entry in the
HashMap
gets changes, checking each dependency per package. - The final loop, filtering using the
HashMap
.
from cargo-graph.
The algorithm will "fill" the graph similar to a paint bucket algorithm, marking the dev-dependencies but overriding them as dependencies if they get are depended on by a normal dependency.
from cargo-graph.
Thanks for all the input! I'll start looking into this as well. Since I don't use many dev-deps it's difficult to test without picking crates I'm less familiar with. If you find the issue before me, put in a PR, I'm all about some contributors π
from cargo-graph.
@bvssvni I think you're correct
EDIT: closed by mistake
from cargo-graph.
Related Issues (20)
- module graphs? HOT 4
- dependency versions HOT 2
- "duplicated" regular and dev-dependencies are not separated HOT 9
- Panic in DepGraph::render_to HOT 2
- ErdΕs-style graph painting HOT 2
- Panic when a crate has dev-dependencies
- Not deterministic
- Show multiple instances of the same crate separately
- Some dependencies are wrong HOT 1
- cargo graph does not work with cargo workspaces HOT 5
- Optional dependency marked as non-optional HOT 1
- Compile error with rustc 1.15.0-nightly (ebeee0e27 2016-12-04)
- Compile error with rustc 1.15.0-nightly (ebeee0e27 2016-12-04)
- Differentiate dependencies by source HOT 2
- No root table found for toml file HOT 15
- cargo-graph generates incompatible dot files in powershell HOT 3
- Graph only path dependencies (or other filtering) HOT 1
- duplicate key: `version` HOT 2
- Does not work with Cargo 1.41 toml format HOT 1
- Add ability to color deps, not just lines
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cargo-graph.