cargo metadata
returns packages[].id
like "sample1 0.1.0 (path+file:///Users/Dev/Workshop/eonil/experiments/rust/sample1)"
. I have been thought it is a pkgid, but it was not. Cargo does not accept the id expression as a valid pkgid. You can check this behavior like this.
$ cargo build -p "sample1 0.1.0 (path+file:///Users/Dev/Workshop/eonil/experiments/rust/sample1)"
error: cannot parse '///Users/Dev/Workshop/eonil/experiments/rust/sample1)' as a semver
It's confusing that package[].id
returned by cargo metadata
cannot be used as a package identifier on other cargo commands. Is this an intended behavior? Or am I supposed to break the expression to get proper pkgid?