Conversation

Jarkko Sakkinen

When cargo publish -p tpm2_cli , I need to

tpm2_call = "0.1.1"

… while building locally:

tpm2_call = { path = "../tpm2_call" }

How to sort this out in “idiomatic manner”?

#rust #rustlang

5
1
0

I sorted this out for the moment that changed the dependency to the form expected by cargo publish: https://crates.io/crates/tpm2_cli

So, main goal for 0.1.2 is to fix this glitch ;-)

0
0
0

@jarkko On top of what was said, try using a release tool like `cargo release`. It will take care of updating the `version` field, update the lockfile, tag, etc. It is dry-run by default and with extra verbosity, you can see exactly what it will do so there are no surprises (even showing diffs of files that will be changed)

1
0
0

@jarkko you can just have both in the cargo.toml entry and local builds will use the path while published builds will use the published dependency.

0
0
1
@alilleybrinker ok it was *that* idiomatic :-O thanks!
0
0
1
@epage ok, thanks, i'll check it out!
0
0
0

@jarkko I cannot see other replies that may have answered this already but cargo should support both of those being present at the same time for the dependency

https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#local-paths-in-published-crates

0
0
0