-
Notifications
You must be signed in to change notification settings - Fork 229
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
rand
update to v0.8
#162
Comments
There's 2 (arguably 3) PRs open with this "fixed". The real problem is that a 0.x dependency is in the public API of a 1.x crate. This is becoming more of an issue in the ecosystem as crates hit 1.0 and it should be looked at how to avoid it in this crate. |
One option would be to just add a |
On the other hand the rand thing is already causing breakage, so just removing the parameter and calling it a "bug fix" would probably be acceptable in this case. |
Good thing about current |
For test purposes I like using |
reexport rand ? |
it's not that simple, unfortunately |
I don't see how, that why reexport exist. Thus that not a big problem one can use https://stackoverflow.com/a/58739076/7076153 |
As I said in an earlier comment, if you have a crate in the public API and bump it to a semver incompatible version, that is always a breaking change. This is the case with re-exports because there is the possibility of obtaining the same types directly. The solutions available are:
|
Reexporting also works. But I prefer removing it from the public api. |
I can see lots of PRs for reexporting rand but none yet for removing rand from the public api. Has anyone got a PR for this tucked away somewhere? |
Yes, see closed PRs. The main issue preventing a resolution of this issue is maintainers simply not caring |
I tried the Zcash ed25519-zebra library, but it doesn't work quite the same, and they don't have a similar library for curve25519. Really inconvenient that the maintainers dropped the ball here. |
You're free to fork projects, make changes, and publish them on crates.io (license permitting). This repo has recent activity so maybe talk about which solution is preferable rather than complain about the maintainers. |
Well I opened a PR, not really sure what else you want me to do. It is obvious from discussion around this issue that the maintainers don't care about this particular one. I stated it as a fact, you down voting my comment doesn't change that. |
And... closed it?... apparently. That's much less helpful to maintainers and other reviewers than leaving it open. FWIW, I like your closed PR's approach if it were combined with changing the feature flag setup to reference the rand version, too. Eg. |
@isislovecruft Do you have any views on this particular issue? / Are you looking for additional maintainers? |
GitHub let's you track your open PR's. I use it to keep track of my work. If I'd keep every unmerged PR open it would be less useful for me. |
Stay focus on the issue. Anyway yes the maintainer of this crates should give the lead cause no update on this issue and no PR merge since 1 year. |
Sorry for missing that closed PR! I know we've all got piles of work to do and a lot going on outside of coding life - life is never easy! Interestingly when quickcheck removed rand from their public api that lead to a lot of upgrade pain for people. Most are still not upgraded. Maybe that's less of a problem here? Will ripping out rand from the public api cripple the usability of the crate? If not it seems a worthy goal, but I note that the dependency is already an optional dependency at this stage so maybe just upgrading rand is ok? I don't mind either way but a decision on this point would be helpful. |
so there is a from_bytes that errors as it takes a slice. my preference would be to take a [u8; 32] and not error in the api (or alternatively provide a From<[u8; 32]> implementation). a generate method not exposing rand is useful, but I guess it's not essential. after a lot of messing about with boxed secrets etc, I've come to the conclusion that zeroizing bytes doesn't work reliably anyway, so I'd propose also deriving
|
@dvc94ch I'd recommend creating a new issue to discuss those changes (and linking it here if you like), but this one should stay focused on updating rand. |
@gilescope I looked into what you mentioned, I believe you mean this issue? BurntSushi/quickcheck#241 Not sure much came of the discussion. I've also read, not depending on the re-exported rand crate is shooting oneself in the foot? I'm not sure why, though... If a project needs rand, I would imagine it would be best to add the dependency within that project, and make sure the versions match across dependencies within the lockfile. That approach assumes some measure of coordination in other open source communities to prevent multiple versions of rand being included in compiled binaries... Which can be like herding cats in order to come up with the solutions that work best in each library that also depends on the same minor version. |
There are related. If you say generate should be disabled then make it convenient |
wondering about this as well o.o |
A work around I am using for the rand issue: let mut bytes = [0u8; 32];
rand::thread_rng().fill_bytes(&mut bytes);
let secret = ed25519_dalek::SecretKey::from_bytes(&bytes).expect("Invalid length");
let public: ed25519_dalek::PublicKey = (&secret).into();
let keypair = ed25519_dalek::Keypair { secret, public }; |
in case it's useful for anyone else... i threw together a quick compatibility layer for this somewhat familiar problem 😅 |
Thanks all for all the solutions and comments. We are on the case and releasing soon! This has been resolved in #223 |
Are there plans to release this change? The last release on crates.io is from 2020. Should I still use this crate or is it abandoned? |
2.0.0-pre.0 does have it published |
@pinkforest |
Full release isn't far away considering curve is already 4.0.0-rc.0 which had the major work - just tidying up things really If people would be able to test them that would be nice |
The package
rand
has been updated to v0.8.X.As this crate used rand v0.7.X it is not compatible with the current version (1.0.1) of this crate.
And will show error like this:
On the code that looks like this (similar to example code in documentation).
So for the next version of this crate the
rand
version should be updated.Current workaround is to downgrade to
rand
version 0.7.X.The text was updated successfully, but these errors were encountered: