Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Ground Controller Lvl 2
Message 1 of 8

Feature request: Support Cargo.toml for dependency graph

Dependency graph has support for Java, JS, Ruby, Python, and .NET. But adding support for Rust doesn't seem like it would be too hard. Cargo.toml files are divided into sections and have 1 section titled dependencies that is followed by a list of names of all Rust "crates" that are dependencies. The name of a Rust "crate" can also be found in the Cargo.toml file under the section titled pacakge. Here's an example.

 

[package]
name = "my_crate"

[dependencies]
this_other_crate = 0.0.6
some_other_crate = 2.0.3
still_another_crate = 0.3.0
7 Replies
Highlighted
Moderator
Message 2 of 8

Re: Feature request: Support Cargo.toml for dependency graph

Hi @calebwin ,

 

Thanks for this feedback! We're always working to improve GitHub and the GitHub Community Forum, and we consider every suggestion we receive. I've logged your feature request in our internal feature request list. Though I can't guarantee anything or share a timeline for this, I can tell you that it's been shared with the appropriate teams for consideration.

 

Cheers!

Highlighted
Copilot Lvl 2
Message 3 of 8

Re: Feature request: Support Cargo.toml for dependency graph

I would love to see this happening too. I've been working extensively on a rust project and support for cargo dependency graph would really complete the experience. No rush but any news?

Highlighted
Ground Controller Lvl 1
Message 4 of 8

Re: Feature request: Support Cargo.toml for dependency graph

I agree this would be awesome!

Highlighted
Copilot Lvl 3
Message 5 of 8

Re: Feature request: Support Cargo.toml for dependency graph

Kudos for not saying "i forwarded it" and marking it as resolved...

 

Yes, i'm being spiteful, sorry. Just a bit frustrated with the state of some other feature requests.

Highlighted
Copilot Lvl 2
Message 6 of 8

Re: Feature request: Support Cargo.toml for dependency graph

If this is added, I think it should be noted that Cargo.lock could be preferred to Cargo.toml when present. Cargo.lock contains structured data on the entire dependency graph, including versions used, while Cargo.toml only contains version constraints.

 

If your environment can run commands, I also highly recommend Cargo's metadata command.

cargo metadata --format-version=1

 

It parses Cargo.toml and Cargo.lock files, does dependency resolution if Cargo.lock is not present, and outputs json.

 

The output is stable, and it's documented at https://doc.rust-lang.org/cargo/commands/cargo-metadata.html.

Highlighted
Ground Controller Lvl 1
Message 7 of 8

Re: Feature request: Support Cargo.toml for dependency graph

As a member of the Cargo Team, plese reach out to the team if we can be of assistance!

Highlighted
Ground Controller Lvl 1
Message 8 of 8

Re: Feature request: Support Cargo.toml for dependency graph

I just want to point out that there can be more than one `dependencies` section. This is common when specifying different dependencies for different features, architectures, etc.

See this for an example. The rest of the page is good information for how dependencies can be specified.

In addition, there can be dev-dependencies and build-dependencies.