snippetbashTip
cargo metadata — Output the workspace members and resolved dependencies of current package as JSON. Note: The output
Viewed 0 times
thecommandandclimembersworkspacecargo metadataoutput
Problem
How to use the
cargo metadata command: Output the workspace members and resolved dependencies of current package as JSON. Note: The output format is subject to change in future versions of Cargo. More information: <https://doc.rust-lang.org/cargo/commands/cargo-metadata.html>.Solution
cargo metadata — Output the workspace members and resolved dependencies of current package as JSON. Note: The output format is subject to change in future versions of Cargo. More information: <https://doc.rust-lang.org/cargo/commands/cargo-metadata.html>.Print the workspace members and resolved dependencies of the current package:
cargo metadataPrint only the workspace members and do not fetch dependencies:
cargo metadata --no-depsPrint metadata in a specific format based on the specified version:
cargo metadata --format-version {{version}}Print metadata with the
resolve field including dependencies only for the given target triple (Note: The packages array will still include the dependencies for all targets):cargo metadata --filter-platform {{target_triple}}Code Snippets
Print the workspace members and resolved dependencies of the current package
cargo metadataPrint only the workspace members and do not fetch dependencies
cargo metadata --no-depsPrint metadata in a specific format based on the specified version
cargo metadata --format-version {{version}}Print metadata with the `resolve` field including dependencies only for the given target triple (Note: The `packages` array will still include the dependencies for all targets)
cargo metadata --filter-platform {{target_triple}}Context
tldr-pages: common/cargo metadata
Revisions (0)
No revisions yet.