Git Product home page Git Product logo

Comments (9)

bvssvni avatar bvssvni commented on August 23, 2024

Tested on Conrod.

The dev dependencies are includes in the graph appear similar to normal dependencies.

from cargo-graph.

bvssvni avatar bvssvni commented on August 23, 2024

Here is an image of the generated graph with the command:

cargo graph --manifest-file Cargo.toml --dev-deps=false | dot -Tpng > Cargo.png

cargo

from cargo-graph.

bvssvni avatar bvssvni commented on August 23, 2024

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.

bvssvni avatar bvssvni commented on August 23, 2024

Seems that all are added as build dependencies https://github.com/kbknapp/cargo-graph/blob/master/src/project.rs#L111

from cargo-graph.

hauleth avatar hauleth commented on August 23, 2024

Same here

Octavo:

image

from cargo-graph.

bvssvni avatar bvssvni commented on August 23, 2024

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:

  1. Loop through all packages, build a HashMap storing Option<DevKind> per package name.
  2. Loop while any entry in the HashMap gets changes, checking each dependency per package.
  3. The final loop, filtering using the HashMap.

from cargo-graph.

bvssvni avatar bvssvni commented on August 23, 2024

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.

kbknapp avatar kbknapp commented on August 23, 2024

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.

kbknapp avatar kbknapp commented on August 23, 2024

@bvssvni I think you're correct

EDIT: closed by mistake

from cargo-graph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.