Skip to content

Commit

Permalink
Merge branch 'master' into winxp
Browse files Browse the repository at this point in the history
  • Loading branch information
josephlr committed Jan 2, 2021
2 parents bcc53e2 + cadf11e commit 7183183
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 127 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ jobs:
target: ${{ matrix.target }}
toolchain: stable
override: true
- run: sudo apt install gcc-multilib
# update is needed to fix the 404 error on install, see:
# https://github.com/actions/virtual-environments/issues/675
- run: sudo apt-get update
- run: sudo apt-get install gcc-multilib
- run: cargo test --target ${{ matrix.target }}

windows-tests:
Expand Down
8 changes: 3 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ libc = { version = "0.2.64", default-features = false }
[target.'cfg(target_os = "wasi")'.dependencies]
wasi = "0.10"

[target.'cfg(all(target_arch = "wasm32", target_os = "unknown", cargo_web))'.dependencies]
stdweb = { version = "0.4.18", default-features = false, optional = true }
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown", not(cargo_web)))'.dependencies]
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
wasm-bindgen = { version = "0.2.62", default-features = false, optional = true }
js-sys = { version = "0.3", optional = true }
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown", not(cargo_web)))'.dev-dependencies]
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dev-dependencies]
wasm-bindgen-test = "0.3.18"

[features]
Expand All @@ -41,7 +39,7 @@ std = []
# Feature to enable fallback RDRAND-based implementation on x86/x86_64
rdrand = []
# Feature to enable JavaScript bindings on wasm32-unknown-unknown
js = ["stdweb", "wasm-bindgen", "js-sys"]
js = ["wasm-bindgen", "js-sys"]
# Feature to enable custom RNG implementations
custom = []
# Unstable feature to support being a libstd dependency
Expand Down
24 changes: 0 additions & 24 deletions src/cloudabi.rs

This file was deleted.

File renamed without changes.
17 changes: 6 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
//! | Dragonfly BSD | `*‑dragonfly` | [`/dev/random`][8]
//! | Solaris, illumos | `*‑solaris`, `*‑illumos` | [`getrandom()`][9] if available, otherwise [`/dev/random`][10]
//! | Fuchsia OS | `*‑fuchsia` | [`cprng_draw`][11]
//! | Redox | `*‑cloudabi` | [`rand:`][12]
//! | CloudABI | `*‑redox` | [`cloudabi_sys_random_get`][13]
//! | Redox | `*‑redox` | [`rand:`][12]
//! | Haiku | `*‑haiku` | `/dev/random` (identical to `/dev/urandom`)
//! | SGX | `x86_64‑*‑sgx` | [RDRAND][18]
//! | VxWorks | `*‑wrs‑vxworks‑*` | `randABytes` after checking entropy pool initialization with `randSecure`
Expand Down Expand Up @@ -68,9 +67,8 @@
//! that you are building for an environment containing JavaScript, and will
//! call the appropriate methods. Both web browser (main window and Web Workers)
//! and Node.js environments are supported, invoking the methods
//! [described above](#supported-targets). This crate can be built with either
//! the [wasm-bindgen](https://github.com/rust-lang/rust-bindgen) or
//! [cargo-web](https://github.com/koute/cargo-web) toolchains.
//! [described above](#supported-targets) using the
//! [wasm-bindgen](https://github.com/rust-lang/rust-bindgen) toolchain.
//!
//! This feature has no effect on targets other than `wasm32-unknown-unknown`.
//!
Expand Down Expand Up @@ -132,7 +130,6 @@
//! [10]: https://docs.oracle.com/cd/E86824_01/html/E54777/random-7d.html
//! [11]: https://fuchsia.dev/fuchsia-src/zircon/syscalls/cprng_draw
//! [12]: https://github.com/redox-os/randd/blob/master/src/main.rs
//! [13]: https://github.com/nuxinl/cloudabi#random_get
//! [14]: https://www.w3.org/TR/WebCryptoAPI/#Crypto-method-getRandomValues
//! [15]: https://nodejs.org/api/crypto.html#crypto_crypto_randombytes_size_callback
//! [16]: #webassembly-support
Expand All @@ -149,6 +146,8 @@
)]
#![no_std]
#![warn(rust_2018_idioms, unused_lifetimes, missing_docs)]
// `matches!` macro was added only in Rust 1.42, which is bigger than our MSRV
#![allow(clippy::match_like_matches_macro)]

#[macro_use]
extern crate cfg_if;
Expand Down Expand Up @@ -183,8 +182,6 @@ cfg_if! {
} else if #[cfg(any(target_os = "freebsd", target_os = "netbsd"))] {
mod util_libc;
#[path = "bsd_arandom.rs"] mod imp;
} else if #[cfg(target_os = "cloudabi")] {
#[path = "cloudabi.rs"] mod imp;
} else if #[cfg(target_os = "fuchsia")] {
#[path = "fuchsia.rs"] mod imp;
} else if #[cfg(target_os = "ios")] {
Expand All @@ -210,9 +207,7 @@ cfg_if! {
#[path = "rdrand.rs"] mod imp;
} else if #[cfg(all(feature = "js",
target_arch = "wasm32", target_os = "unknown"))] {
#[cfg_attr(cargo_web, path = "stdweb.rs")]
#[cfg_attr(not(cargo_web), path = "wasm-bindgen.rs")]
mod imp;
#[path = "js.rs"] mod imp;
} else if #[cfg(feature = "custom")] {
use custom as imp;
} else {
Expand Down
86 changes: 0 additions & 86 deletions src/stdweb.rs

This file was deleted.

0 comments on commit 7183183

Please sign in to comment.