Genie
Genie

Reputation: 129

How to use subpackage of nested Cargo.toml git project?

I want to use the package substrate-test-runtime-client from the substrate GitHub repo.

[dependency]
substrate-test-runtime-client = [git = "https://github.com/paritytech/substrate.git", branch = "master"]

Above Cargo.toml syntax doesn't resolve the issue. How can I extract, compile, and use a subpackage of umbrella package.

Upvotes: 0

Views: 1114

Answers (1)

Ross MacArthur
Ross MacArthur

Reputation: 5449

You are on the right track. You need to use curly brackets to specify an inline TOML table.

So either add the following to your Cargo.toml file.

[dependencies]
substrate-test-runtime-client = { git = "https://github.com/paritytech/substrate.git", branch = "master" }

Or use this which is equivalent

[dependencies.substrate-test-runtime-client]
git = "https://github.com/paritytech/substrate.git"
branch = "master"

Cargo will crawl the downloaded repository looking for a package called substrate-test-runtime-client. See here.

Upvotes: 2

Related Questions