Skip to content

Release Version 0.2 #162

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

Merged
merged 57 commits into from
Sep 10, 2020
Merged

Release Version 0.2 #162

merged 57 commits into from
Sep 10, 2020

Conversation

josephlr
Copy link
Member

@josephlr josephlr commented Sep 10, 2020

Fixes #98

It's finally done! I can't believe this started almost a year ago.

To preview docs:

git clone --single-branch --branch 0.2 https://github.com/rust-random/getrandom.git
cd getrandom
cargo doc --no-deps --features=std,custom --open

Release plan

After merging, this version will be released as getrandom 0.2

The last pre-0.2 commit (7dcb167) will be released as getrandom 0.1.15

josephlr and others added 30 commits October 15, 2019 23:40
* Fix CI to allow for PRs against 0.2 to be run

* Only impl std traits if feature is specified

* Fix l4re
Removes the “dummy” feature and “wasm32-unknown-unknown” dummy impl
Right now for each of `util_libc` and `use_file` we have a list of
`target_os` configs to determine if we build the module.

This PR moves these mod declarations into the main `cfg_if` statement
(the one that selects which implementation we use). This way, the mod
statements are kept in-sync with the implementations that use them.

Also, I merged together `target_os` cfgs that have the same
implementation. The downside to this is that the targets are no longer
in alphabetical order.

Also, this is only being applied to `0.2` as the `0.1` cfgs still have
to keep `std` around.
This feature isn't enabled by rand/rand_core and provides very little
error information that isn't already conveyed through our Error values.

This also simplifies the supported configuration space for getrandom.
We update the docs and CI to match this change.
We will use a more generic "cpu" mechanism to support these.

Signed-off-by: Joe Richey <[email protected]>
This allows freestanding targets to use getrandom.

Signed-off-by: Joe Richey <[email protected]>
- Cleanup .travis.yml
  - Loops over std/no_std targets
  - Remove deprecated/useless keys
  - No more `cd`, we just use `--package`.
- Improve tests
  - Main `getrandom` tests are now unit test modules instead of
    integration tests, making the code cleaner.
  - The custom RNG crates now use this common module as part of their
    integration tests.
  - No more weird test-only features needed to get the crate to build.

Signed-off-by: Joe Richey <[email protected]>
This allows us to verify the RDRAND implementation on Linux.

Signed-off-by: Joe Richey <[email protected]>
Also add tests for 32-bit x86
Split emscripten stuff into its own target and stop relying on cargo web
to download/manage then emscripten toolchain. We can just get it
ourselves. We also now run the emscripten tests.

Signed-off-by: Joe Richey <[email protected]>
Also make Error::code a const fn. These increase the Min Rust version to 1.33
- Use debug asserts in code
- Use normal asserts in tests
- Use *assert_eq! methods when possible
- Remove unnecessary asserts
As our minimum rust version is 1.33, we can just use `target_vendor`.
The type of the `rnd` parameter is SecRandomRef which is an alias for an
"Opaque Pointer". This is better represented in Rust as a c_void pointer.

We also know that kSecRandomDefault is NULL, so we can simplify the code.

https://developer.apple.com/documentation/security/1399291-secrandomcopybytes
https://developer.apple.com/documentation/security/secrandomref
https://developer.apple.com/documentation/swift/imported_c_and_objective-c_apis/using_imported_c_functions_in_swift
travis: Allow nightly builds to fail
josephlr and others added 18 commits July 21, 2020 13:31
Minimum supported kernel version got bumped to 2.6.32 in rust-lang/rust#74163
Older NetBSD kernels cannot handle buffers bigger than 256 bytes, and
all FreeBSD and NetBSD kernels only return up to 256 bytes per call.

Signed-off-by: Joe Richey <[email protected]>
Signed-off-by: Joe Richey <[email protected]>
rustwasm/wasm-bindgen#2305 released the bugfix for wasm-bindgen.

Signed-off-by: Joe Richey <[email protected]>
The main things here are clarifying how fallback functionatliy works.

Signed-off-by: Joe Richey <[email protected]>
Signed-off-by: Joe Richey <[email protected]>
Include more links, exampales, and clarify wording

Signed-off-by: Joe Richey <[email protected]>
This makes sure we get a good compiler error if we give a bad path.

Signed-off-by: Joe Richey <[email protected]>
Copy link
Member

@newpavlov newpavlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also add a changelog entry?

@dhardy
Copy link
Member

dhardy commented Sep 10, 2020

🎉

Maybe there should be a 0.1 branch now?

@josephlr
Copy link
Member Author

Maybe there should be a 0.1 branch now?

That's the plan, I'll add it

@josephlr
Copy link
Member Author

Maybe also add a changelog entry?

Done

Signed-off-by: Joe Richey <[email protected]>
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

Successfully merging this pull request may close these issues.

Tracking issue for 0.2.0
5 participants