-
Notifications
You must be signed in to change notification settings - Fork 182
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
Update docs for 0.2 Release #135
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start on this.
ee3b7ba
to
d8acc8b
Compare
@dhardy |
@newpavlov I 100% agree. I'll get this ready for final review ASAP. I also now have a strong work reason (briansmith/ring#744 (comment)) to make sure getrandom 0.2 is out asap |
@newpavlov @dhardy the docs are complete and are ready for review |
The main things here are clarifying how fallback functionatliy works. Signed-off-by: Joe Richey <joerichey@google.com>
@stevenrutherford you've used this branch before, can you take a look at the docs. |
Signed-off-by: Joe Richey <joerichey@google.com>
Include more links, exampales, and clarify wording Signed-off-by: Joe Richey <joerichey@google.com>
Signed-off-by: Joe Richey <joerichey@google.com>
@newpavlov one last question (then we can merge this). Right now the documented way to use a custom-RNG crate is:
An alternative way to do things would be:
Do you think we should recommend the current approach or the alternative approach? I think the alternative approch better mimics common patterns with EDIT: The alternative approach probably makes it harder to get linker errors, at the cost of having the user do more in the binary crate. |
Hm, I agree that the second approach is closer to the global allocator and panic handlers, plus it feels "less magic". We could reduce amount of setup a bit, by suggesting that use dummy_getrandom::{always_fail, getrandom::register_custom_getrandom};
register_custom_getrandom!(always_fail); But I am not sure if it's worth the trouble. |
Signed-off-by: Joe Richey <joerichey@google.com>
Signed-off-by: Joe Richey <joerichey@google.com>
Signed-off-by: Joe Richey <joerichey@google.com>
This makes sure we get a good compiler error if we give a bad path. Signed-off-by: Joe Richey <joerichey@google.com>
Signed-off-by: Joe Richey <joerichey@google.com>
That was my thinking as well, docs have been updated to show the second approach. I also added a check in the macro (8e1ab1a) that the function has the exact correct signature. This makes the error messages much better if you feed it a bad function.
Ya I agree. I think keeping it sort of close to how |
Moving the binding to the binary crate does avoid possible confusion about how custom RNG crates work, and about what happens if multiple custom RNG crates were enabled. On the other hand it's a bit strange and inconvenient putting the binding in a binary crate if the binary crate doesn't use |
I agree it's a little inconvenient, but it does make things less magical. It's also consistent with the "js" and "rdrand" features, which are also enabled by directly depending on getrandom (even if the user was only using rand). Fundamentally, if a user is doing this, they need to know they are overriding getrandom, otherwise they'll have issues/conflicts down the road. I also like this approach because it's compatible with the eventual introduction of a |
Signed-off-by: Joe Richey <joerichey@google.com>
Final PR for 0.2 adding all the docs about the
"rdrand"
,"js"
, and"custom"
features.To preview what will go up on crates.io, run:
Signed-off-by: Joe Richey joerichey@google.com