Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Cargo.lock from workspace root #181

Merged
merged 1 commit into from
Jul 31, 2018
Merged

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