Skip to content

Conversation

@Elarnon
Copy link
Contributor

@Elarnon Elarnon commented Jul 26, 2018

cbindgen currently assumes that the Cargo.lock is in directly in the
crate directory as a sibling to Cargo.toml; however that is usually
not the case inside a workspace.

Instead, this PR extracts the workspace root from the output of cargo metadata [1] (already used to get a list of packages) and uses the
Cargo.lock from there.

  1. This is available since Rust 1.24; see Add workspace root to metadata command. rust-lang/cargo#4940

cbindgen currently assumes that the `Cargo.lock` is in directly in the
crate directory as a sibling to `Cargo.toml`; however that is usually
not the case inside a workspace.

Instead, this PR extracts the workspace root from the output of `cargo
metadata` [1] (already used to get a list of packages) and uses the
`Cargo.lock` from there.

 1. This is available since Rust 1.24; see rust-lang/cargo#4940
@eqrion
Copy link
Collaborator

eqrion commented Jul 31, 2018

This looks good, thanks!

@eqrion eqrion merged commit ba589a8 into mozilla:master Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants