Stream: t-compiler/help

Topic: cargo metadata and pkgid

eonil (Nov 02 2019 at 13:59, on Zulip):

Hello, I'm new here to ask a question.

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

I am not sure about shell scripting bug, but I believe this code is okay.

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?

eonil (Nov 02 2019 at 14:07, on Zulip):

Here doesn't seem to be a place to ask this kind of question. I'm gonna move this question to user forum. I'm sorry. I can't find delete button.

Last update: Sep 18 2020 at 21:00UTC