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

Can't build crate with dependency num 0.4.0 #182

Closed
sledgehammervampire opened this issue Apr 9, 2021 · 5 comments
Closed

Can't build crate with dependency num 0.4.0 #182

sledgehammervampire opened this issue Apr 9, 2021 · 5 comments

Comments

@sledgehammervampire
Copy link

I get this error

error[E0432]: unresolved import `num_rational::BigRational`
  --> src/lib.rs:68:9
   |
68 | pub use num_rational::BigRational;
   |         ^^^^^^^^^^^^^^-----------
   |         |             |
   |         |             help: a similar name exists in the module: `Rational`
   |         no `BigRational` in the root

when trying to nix-build the generated Cargo.nix. However cargo build works fine.

@pandaman64
Copy link
Contributor

Dupe of #146

pandaman64 added a commit to pandaman64/crate2nix that referenced this issue Apr 22, 2021
When Cargo sees a dependency feature `opt_crate/feat` for an optional dependency `opt_crate`,
it implicitly adds `opt_crate` to the feature set for the current crate.
For example, `num-rational` crate relies on this behavior for importing `num-bigint`, which is optional.
This patch lets crate2nix mimic this behavior.

Closes nix-community#146 and nix-community#182.
kolloch pushed a commit that referenced this issue Apr 24, 2021
When Cargo sees a dependency feature `opt_crate/feat` for an optional dependency `opt_crate`,
it implicitly adds `opt_crate` to the feature set for the current crate.
For example, `num-rational` crate relies on this behavior for importing `num-bigint`, which is optional.
This patch lets crate2nix mimic this behavior.

Closes #146 and #182.
@kolloch
Copy link
Collaborator

kolloch commented Apr 24, 2021

Hey @1000teslas,

thank you so much for reporting this!

@pandaman64 has fixed this in a recent PR. Would you help by retesting it with the master version?

Thank you.

@kolloch kolloch closed this as completed Apr 24, 2021
@sledgehammervampire
Copy link
Author

seems like it works fine. thanks.

@kolloch
Copy link
Collaborator

kolloch commented Apr 24, 2021

Awesome, thanks for getting back to us!

@bbigras
Copy link
Contributor

bbigras commented Apr 27, 2021

I had the same problem and master also fixed it. Thanks for the quick fix!

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

No branches or pull requests

4 participants