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

buildRustCrate does not handle renames #68249

Closed
danieldk opened this issue Sep 7, 2019 · 2 comments
Closed

buildRustCrate does not handle renames #68249

danieldk opened this issue Sep 7, 2019 · 2 comments
Labels
0.kind: bug Something is broken

Comments

@danieldk
Copy link
Contributor

danieldk commented Sep 7, 2019

Describe the bug

buildRustCrate and accompanying tools such as Carnix, does not handle renames in Cargo.toml. This is likely to become a more serious issue for users of buildRustCrate soon, since rand 0.7.0 uses a rename:

getrandom_package = { version = "0.1.1", package = "getrandom", optional = true }

In such cases, the right invocation of rustc adds an extern option like the following:

--extern getrandom_package=[...]/libgetrandom-[...].rlib

However, buildRustCrate with Carnix-generated files currently adds

--extern getrandom=[...]/libgetrandom-[...].rlib

This issue has been reported in the bug trackers of Carnix and crate2nix, but I thought it would be good to have an issue in the nixpkgs issue tracker in case people run into this issue.

https://nest.pijul.com/pmeunier/carnix/discussions/35
nix-community/crate2nix#22

To Reproduce

  1. Use carnix to generate nix files from a Cargo.toml that has rand == 0.7 as a transitive dependency.
  2. Build using nix-build

Expected behavior

The build succeeds, because it adds the correct --extern argument.

@danieldk danieldk added the 0.kind: bug Something is broken label Sep 7, 2019
@gilligan
Copy link
Contributor

gilligan commented Sep 7, 2019

i created the issues with carnix and crate2nix and have since also created a little test project: https://github.com/gilligan/rs-nix-test

I guess i might be able to fix/add support for this in crate2nix but I prefer to not touch the carnix code base and haven't received any feedback from the author despite multiple attempts on different channels.

@danieldk
Copy link
Contributor Author

Fixed in #68296

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants