-
Notifications
You must be signed in to change notification settings - Fork 186
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
0.2: Error and Testing improvements #120
Conversation
- Remove use of `--examples`, we do not have examples - Install drivers to $HOME - Use YAML expansion to avoid repeating testing configs - Make sure crates build with each feature set individually - Add missing targets to cross-platform build step - Check minimum version compatiblity with features _on_ - Gerate docs with "std" feature set
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.
Looks good to me.
One addition I'd like to see (@newpavlov?) is to prefix more of these error constants (e.g. RAND_SECURE_FATAL
) with the platform name (in this case VxWorks, which is mentioned in the error message).
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.
One addition I'd like to see is to prefix more of these error constants (e.g. RAND_SECURE_FATAL) with the platform name
Yes, sounds good to me.
BTW maybe we should fn internal_desc(error: Error) -> Option<&'static str> {
match error {
Error::UNSUPPORTED => Some("getrandom: this target is not supported"),
#[cfg(unix)]
Error::ERRNO_NOT_POSITIVE => Some("errno: did not return a positive value"),
Error::UNKNOWN_IO_ERROR => Some("Unknown std::io::Error"),
#[cfg(target_os = "ios")]
Error::SEC_RANDOM_FAILED => Some("SecRandomCopyBytes: call failed"),
#[cfg(target_os = "windows")]
Error::RTL_GEN_RANDOM_FAILED => Some("RtlGenRandom: call failed"),
// ....
_ => None,
}
} And I think we don't use |
Also remove Error::UNKNOWN_IO_ERROR constant
Also fixup documentation and error messages
Done, changed to
So removing the strings makes the release binary smaller, but removing the constants themselves should only make the I don't think we should remove the constants. As for removing the strings, doing it correctly for all of them is tricky (involving some gross
Done, removed. @dhardy, @newpavlov if you like the changes, feel free to merge this (once the CI is green). |
Agreed. Duplicating Changes look good to me. |
#109 contains a lot of fixes to the
Error
class and to our testing infrastructure that makes it harder to focus on the important changes in that PR.I split out the changes unrelated to Custom RNGs into this PR. I also fixed up the commits/messages to explain these changes (we should be sure to "merge" this PR not "squash" it). Also, this PR should be merged before #109
This PR:
Error
structError
constants--examples
, we do not have examplesstd
feature will be enabled when using docs.rs.