- Executable file wiki_references/2017/software/Rust/src_from_GitHub/the_repository_clones/rust/cargo/src/doc/pkgid-spec.md — part of check-in [0105d215ce] at 2017-03-22 04:01:30 on branch trunk — Massive_Array_of_Internet_Disks Safe MaidSafe + Rust (user: martin_vahi) [ancestry] [annotate] [blame]
- Executable file wiki_references/2017/software/Rust/src_from_GitHub/the_repository_clones/rust/src/tools/cargo/src/doc/pkgid-spec.md — part of check-in [dee8e3e8ea] at 2017-05-19 18:47:53 on branch trunk — wiki reference upgrade (user: vhost7825ssh) [ancestry] [annotate] [blame]
% Package ID Specifications
Package ID specifications
Subcommands of Cargo frequently need to refer to a particular package within a dependency graph for various operations like updating, cleaning, building, etc. To solve this problem, Cargo supports Package ID Specifications. A specification is a string which is used to uniquely refer to one package within a graph of packages.
The formal grammar for a Package Id Specification is:
```notrust pkgid := pkgname | [ proto "://" ] hostname-and-path [ "#" ( pkgname | semver ) ] pkgname := name [ ":" semver ]
|proto := "http"||"git"||...|
Here, brackets indicate that the contents are optional.
These could all be references to a package
1.2.3 from the
Brevity of specifications
The goal of this is to enable both succinct and exhaustive syntaxes for referring to packages in a dependency graph. Ambiguous references may refer to one or more packages. Most commands generate an error if more than one package could be referred to with the same specification.