-
Notifications
You must be signed in to change notification settings - Fork 432
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
Problems understanding getrandom_package #881
Comments
I think the renaming is necessary to have a feature called
This is not possible, because features and dependencies cannot share the same name. |
It is exactly that, a hack because of the way that Cargo works. I didn't want to rename the "feature" from My understanding is that you're unhappy because |
@dhardy thanks a lot for your clarification. Indeed i was only hoping for a clarification because i need to adjust the tooling. In this case adding support for renaming which wasn’t added initially. Thanks again! |
@gilligan have you found a solution for this problem? I am also a Nix user and have tried building my Rust package (which has this
@dhardy can you recommend a way to avoid this optional dependency/renaming scheme from destroying the Nix workflow? I don't actually depend on |
Well, I didn't forsee this hack breaking the nix tooling. @gilligan are you proposing to fix the tooling? Removing this |
The good news is that there is ongoing work to fix this already. There is a PR for nixpkgs which will be merged soon: NixOS/nixpkgs#68296 Ultimately i think rand authors shouldn’t have to do anything because renaming per se is of course a valid Cargo feature. If you take a look at nix-community/crate2nix#22 (comment) you can see how you can patch this for now. TL;DR everything should soon be fixed on the nix side of things. |
I have also made a PR in crate2nix to make use of NixOS/nixpkgs#68296: Any testing would be appreciated ;). |
Your PR is merged so I assume this has been sorted now. |
Hi, I'm a Nix user and recently the Rust/Nix tools i'm using (like crate2nix) broke because of changes introduced in
rand
- In the end it probably just boils down to missing renaming support and of course this is none of your concern/responsibility.However I would be really grateful if you could help me to understand how you are using
getrandom
/getrandom_package
because i am still confused about it.The first thing I dug up was this comment #800 (comment)
This of course refers to the following setup in the
Cargo.toml
:So
rand
is exposing agetrandom
feature which introduces a dependency ongetrandom_package
.getrandom_package
(which doesn't actually exist anywhere) is mapped/renamed to usegetrandom
. In addition to that thegetrandom
feature also introduces a dependency onrand_core/getrandom
.It would be great if someone could explain the motivation behind this to me. Couldn't this just be replaced with something like
Is the hack necessary to avoid some otherwise occurring breakage? I'd be most grateful if someone could explain this to me. I'm sorry if this is entirely obvious, i am not that experienced with Rust yet.
Thanks a lot in advance folks.
The text was updated successfully, but these errors were encountered: