kbknapp / cargo-graph

A cargo subcommand for creating GraphViz DOT files and dependency graphs
BSD 3-Clause "New" or "Revised" License
216 stars 16 forks source link

No root table found for toml file #40

Open f-fr opened 6 years ago

f-fr commented 6 years ago

When running cargo graph on an arbitrary project I receive the following error message:

% cargo graph
error: No root table found for toml file

I have no idea what this error means or how I can get more information about the problem. Any ideas?

remram44 commented 6 years ago

This is caused by recent changes to Cargo. #38 fixes the issue.

Trolldemorted commented 6 years ago

unfortunately cargo install still installs an older version - could you push a new one?

shaleh commented 6 years ago

Yes please. I came to submit the same issue.

aochagavia commented 6 years ago

Same here

ChristopherMacGown commented 6 years ago

Until a new version is pushed, you can add the following to your Cargo.lock to get around the issue temporarily.

[root]
name="your-package-name"

Doing so will cause other cargo commands to fail, however. That's because future/current cargo will see that as duplicating the project definition.

laumann commented 6 years ago

@ChristopherMacGown Thanks for the tip!

I had to add version as well to Cargo.lock, like so:

[root]
name="your-package-name"
version="package-version"

worked like a charm.

SimonSapin commented 6 years ago

cargo +nightly install --git https://github.com/kbknapp/cargo-graph --force worked for me.

chisophugis commented 6 years ago

I just tripped on this. What is the status? According to the earlier comment #38 fixes this, which was merged like 6 months ago.

sstelfox commented 6 years ago

Ditto, ended up going with the forced git install.

crawford commented 6 years ago

Bump.

spearman commented 5 years ago

Is this the same as error: No name for package in toml file ?

Boscop commented 5 years ago

Any update on this?

tjyang commented 5 years ago

I was able to get it going by following steps on a CentOS 7 OS.

[pi@centos7 cargo-count]$ ls -l *.png -rw-rw-r-- 1 pi pi 59023 Feb 21 07:00 cargo-count.png -rw-rw-r-- 1 pi pi 144496 Feb 21 07:10 rainbow-graph.png [pi@centos7 cargo-count]$

mrcnski commented 5 years ago

You can use my fork instead, which includes the fix for this (as well as for many, many other bugs), plus has some new features (plus is actually maintained).

cargo install cargo-deps

See the new features with

cargo deps -h
tjyang commented 5 years ago

Thanks @m-cat for your pointer. I will follow cargo-deps instead.

[pi@centos7 cargo-deps]$ cargo  deps -h
cargo-deps 1.0.3
Marcin S. <marcin.swieczkowski@gmail.com>:Kevin K. <kbknapp@gmail.com>:Max New <maxsnew@gmail.com>
Cargo subcommand for building dependency graphs of Rust projects.

USAGE:
    cargo deps [FLAGS] [OPTIONS]

FLAGS:
        --all-deps            Include all dependencies in the graph. Can be used with --no-regular-deps
        --build-deps          Include build dependencies in the graph (purple)
        --dev-deps            Include dev dependencies in the graph (blue)
    -h, --help                Prints help information
        --include-orphans     Don't purge orphan nodes (yellow). This is useful in some workspaces
    -I, --include-versions    Include the dependency version on nodes
        --no-regular-deps     Exclude regular dependencies from the graph
        --optional-deps       Include optional dependencies in the graph (red)
    -V, --version             Prints version information

OPTIONS:
    -o, --dot-file <PATH>           Output file [default: stdout]
        --filter <DEPNAMES>...      Only display provided deps
        --manifest-path <PATH>      Specify location of manifest file [default: Cargo.toml]
        --subgraph <DEPNAMES>...    Group provided deps in their own subgraph
        --subgraph-name <NAME>      Optional name of subgraph
[pi@centos7 cargo-deps]$