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

Fails with new Cargo.lock format #436

Closed
otavio opened this issue Dec 18, 2019 · 4 comments · Fixed by #438
Closed

Fails with new Cargo.lock format #436

otavio opened this issue Dec 18, 2019 · 4 comments · Fixed by #438
Assignees

Comments

@otavio
Copy link

otavio commented Dec 18, 2019

cargo has enabled the new format by default[1] and this causes the cbindgen to fail to parse the dependencies.

  1. Turn the new lock file format on by default rust-lang/cargo#7579

It fails at https://github.com/eqrion/cbindgen/blob/master/src/bindgen/cargo/cargo.rs#L125 as the new format does not has the version annotated on the same line.

@emilio
Copy link
Collaborator

emilio commented Dec 19, 2019

Thanks for filing, will take a look.

@est31
Copy link

est31 commented Dec 19, 2019

One could switch to the cargo crate to parse the Cargo.lock format, but this would hopelessly inflate the number of dependencies as it would include everything cargo is depending on. Ideally, one could ask the cargo maintainers to extract the Cargo.lock parsing code into a separate crate and to then use that.

@emilio emilio self-assigned this Dec 20, 2019
emilio added a commit to emilio/cbindgen that referenced this issue Dec 20, 2019
Lockfile v2 only includes version numbers if they're conflicting.

Fixes mozilla#436
@emilio
Copy link
Collaborator

emilio commented Dec 20, 2019

I had to catch up with the lockfile changes, but I think #438 should be enough.

@otavio
Copy link
Author

otavio commented Dec 22, 2019

I had to catch up with the lockfile changes, but I think #438 should be enough.

I tested the PR and it worked just fine. Thanks for looking at it.

emilio added a commit that referenced this issue Dec 29, 2019
Lockfile v2 only includes version numbers if they're conflicting.

Fixes #436
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 a pull request may close this issue.

3 participants