I have included a crate as dependency in my Cargo.toml
as:
bellman_ce = "=0.3.3"
How do I find which commit id this version of the package points to? Unfortunately, github repo is not tagged by version number.
I have included a crate as dependency in my Cargo.toml
as:
bellman_ce = "=0.3.3"
How do I find which commit id this version of the package points to? Unfortunately, github repo is not tagged by version number.
You can't. Crates on crates.io don't need to be built from a Git repo, and there is no built-in way to determine what commit a crate was built from. Most crates tag commits in their history where versions came from, but in this case looking at the Git history of Cargo.toml
is your only option.
I'm struggling with the same problem my self. I cannot find a way to get the exact commit id. However, it looks like you can go to the crates.io versions page (e.g., https://crates.io/crates/flexi_logger/versions) and there it will show when each version was published. You might be able to find the commit that corresponds to the version by searching the git history and try to find a commit around the time when the version was published.
I think what you're looking for is in the .cargo_vcs_info.json
file from the crate. It's created as part of cargo package
and is documented here: https://doc.rust-lang.org/cargo/commands/cargo-package.html#cargo_vcs_infojson-format. If you can find the source for the crate in question in your $HOME/.cargo/registry/src
it should be there.