Commit Graph

267 Commits

Author SHA1 Message Date
Artyom Pavlov cd3a987b9b Release v0.2.5 (#247) 2022-02-22 12:09:08 +00:00
Þórhallur Sverrisson cf02327ac9 Enable support for espidf (esp32 family of microcontrollers) (#245) 2022-02-05 00:55:59 +00:00
Joseph Richey e1a9c9e740 Merge pull request #246 from rust-random/cross_fix
Update cross URL
2022-01-29 18:12:01 -08:00
Артём Павлов [Artyom Pavlov] f49f083412 fix cross tests 2022-01-29 18:48:38 +03:00
Joseph Richey 21e03e8056 ios: Fix Error checking for SecRandomCopyBytes (#244)
Apple's documentation for SecRandomCopyBytes says that errSecSuccess is
returned on success, and all other values indicate failure.
  https://developer.apple.com/documentation/security/1399291-secrandomcopybytes

The SecBase.h header also clearly establishes that `errSecSuccess = 0`:
  https://opensource.apple.com/source/Security/Security-55471/sec/Security/SecBase.h.auto.html

Fixes #243

Signed-off-by: Joe Richey <joerichey@google.com>
2022-01-21 16:50:40 +00:00
Joseph Richey e6e7dd6048 Merge pull request #234 from mjhanninen/fix-webpack-dynamic-require-error
Fix Webpack warning caused by dynamic require
2022-01-13 18:58:40 -08:00
Joe Richey 8fad7c5ab4 js: Add comment explaining why we do this hack
Signed-off-by: Joe Richey <joerichey@google.com>
2022-01-13 18:48:09 -08:00
Artyom Pavlov b9c7c0c13d Release v0.2.4 (#238) 2022-01-13 21:46:24 +00:00
kpcyrd 9110af54d1 Fix get_rng_fd comment typo (#240) 2022-01-13 21:46:02 +00:00
Stewart Mackenzie ec445bb0ac Added x86_64-unknown-hermit support (#236) 2021-12-07 14:48:30 +00:00
Tomoaki Kawada f5e33009ed Add SOLID target support (#235) 2021-11-30 00:21:36 +00:00
Matti Hänninen 8372c165af Fix Webpack warning caused by dynamic require
Webpack supports dynamic importing only for some special cases in which
it is able to narrow down the set of packages to bundled.  In the
general case it just produces an empty (Webpack) context plus the
warning stating that "the request of a dependency is an expression."

Apparently the commit 120a1d7f changed the Javascript generated by
wasm-bindgen so that the binding for the `require` became:

```
module.require(getStringFromWasm0(arg0, arg1))
```

when it used to be:

```
getObject(arg0).require(getStringFromWasm0(arg1, arg2))
```

In the latter case Webpack did not even realize that this code imported
a package and, hence, did not try to bundle it.  The new code triggers
the bundling and because the dependency is fully dynamic Webpack has
problems with it.

This commit reverts partially the commit 120a1d7f so that the generated
binding obfuscates the `require` call enough to hide it from Webpack
again.
2021-10-15 21:03:35 +03:00
Cyborus04 0d0404be5a Use NonZeroU32::new_unchecked to convert wasi error (#233) 2021-10-15 03:57:40 +00:00
Joseph Richey e4004f41fa redox: Switch to /dev/urandom (#222)
Signed-off-by: Joe Richey <joerichey@google.com>
2021-10-14 18:16:03 -07:00
Joseph Richey 30308ae845 js: Explictly list all dependancies used with the "js" feature (#220)
This makes it easier to tell at a glance what parts of `wasm-bindgen`
are needed for `getrandom`.

See: https://github.com/tkaitchuck/aHash/issues/95#issuecomment-881152315

Signed-off-by: Joe Richey <joerichey@google.com>
2021-07-16 00:23:43 -07:00
Dirk Stolle dcf452bb14 fix some typos (#218) 2021-05-20 19:26:19 -07:00
Artyom Pavlov de51e2961d Release v0.2.3 (#211) 2021-05-20 08:00:44 +00:00
Joseph Richey 120a1d7f47 Imporve detection for Node JS (#215)
This uses `process.versions.node` to see if we are in Node.js rather
than using `global.self` to check if we are in a Browser.

This change also makes some minor `wasm_bindgen` improvements:
  - Use `js_sys::global()` to get the global object
  - Bind the node require as `module.require`
  - Improving error messages

Signed-off-by: Joe Richey <joerichey@google.com>
2021-05-20 08:00:20 +00:00
Joseph Richey 922d1de82d Fix Solaris CI (#216)
The new target is called `x86_64-pc-solaris`, but `cross` doesn't
support that yet, so just use `sparcv9-sun-solaris`.

See the following issues for more info:
  https://github.com/rust-lang/rust/issues/85098
  https://github.com/rust-lang/rust/pull/82216

Signed-off-by: Joe Richey <joerichey@google.com>
2021-05-14 12:04:30 +03:00
Tobias Klauser 24716865bd Fix dead link to NetBSD sysctl man page (#212)
Use the offical NetBSD man page URL https://man.netbsd.org

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2021-05-02 20:31:17 +00:00
Tobias Klauser 36d085a1f4 Add support for getrandom syscall on DragonFly BSD (#210)
DragonFly BSD supports the getrandom system call since version 5.7 [1].
Use it if available, otherwise fall back to /dev/random.

[1] https://leaf.dragonflybsd.org/cgi/web-man?command=getrandom

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2021-04-04 03:14:02 +00:00
Joseph Richey 0eb0be130e Update docs and compile_errors for wasm32-unknown-unknown (#209)
Signed-off-by: Joe Richey <joerichey@google.com>
2021-03-06 02:15:07 -08:00
Artyom Pavlov c4a0004e8b Replace build.rs with link attributes (#205) 2021-02-16 18:09:32 -08:00
Artyom Pavlov 9b2d55803e Fix WASI function name and doc link (#202) 2021-02-02 02:29:30 -08:00
Artyom Pavlov d79de0c95c Release v0.2.2 (#201) 2021-01-19 12:34:27 +00:00
Joseph Richey 27b5172a2e Merge pull request #200 from rust-random/doc_feature
Use doc_cfg to improve register_custom_getrandom docs
2021-01-19 02:56:00 -08:00
Joe Richey d7a0d580d4 Set doc(cfg(feature = "std")) on std trait impls
Signed-off-by: Joe Richey <joerichey@google.com>
2021-01-19 02:46:59 -08:00
Joe Richey 2cfbd8ee60 Modify doc tests to set docsrs
Signed-off-by: Joe Richey <joerichey@google.com>
2021-01-19 02:46:38 -08:00
Артём Павлов [Artyom Pavlov] 69634b700e Use doc_cfg to improve register_custom_getrandom docs 2021-01-18 01:00:23 +03:00
Joseph Richey 9a48bfabc0 Merge pull request #198 from rust-random/hermit
Add fixes for Caching and rustc-dep-of-std feature
2021-01-17 12:32:22 -08:00
Joe Richey 3661e9dc2a Properly forward rustc-dep-of-std feature
Signed-off-by: Joe Richey <joerichey@google.com>
2021-01-17 00:28:36 -08:00
Joe Richey 03cc4f704d Cache Cargo index and Rust build directory
Signed-off-by: Joe Richey <joerichey@google.com>
2021-01-17 00:28:30 -08:00
Joseph Richey 347a300215 Add test for custom RNG handler (#197)
See #194

This uses the fact that `wasm32-unknown-unknown` is an "unsupported" target. This means we can use the `"custom"` feature to define a custom handler, and then write tests to make sure that function is called.
2021-01-05 02:00:21 -08:00
Joseph Richey 9d7a76c19e Add Emscripten tests (#196)
See #194 

This installs (and caches) the emsdk toolchain at the last version compatible w/ stable rust. It also tests on both asmjs and wasm32, uses node by default, and works around an asm.js bug.
2021-01-05 01:38:44 -08:00
Joseph Richey e29ed04f28 Move tests to tests/ directory (#195)
Signed-off-by: Joe Richey <joerichey@google.com>
2021-01-03 22:24:48 -08:00
Joseph Richey 1c6749e1e3 Merge pull request #192 from rust-random/ci
Update Github Actions CI for the master branch
2021-01-03 22:03:25 -08:00
Joe Richey 7b8f2ba952 Note that installed binaries are precompiled 2021-01-03 21:26:32 -08:00
Joe Richey e593f43daa Clarify use of .cargo/config
Signed-off-by: Joe Richey <joerichey@google.com>
2021-01-03 20:48:13 -08:00
Joe Richey 7687498160 Only test macOS on stable
Most of the advantages from testing various Rust versions already come
from running those tests on Linux and Windows. There's very little
gain from also running these tests on macOS, while macOS jobs are the
slowest to schedule.

Signed-off-by: Joe Richey <joerichey@google.com>
2021-01-03 20:46:12 -08:00
Joe Richey ea73f5a975 Update CI
- Cleanup `tests.yml`
- Add better binary downloads
- Add minimal dependancies check
- Add tests for `custom` feature
- Build/Link for iOS
- Run cross tests on aarch64 linux and Android
- Link on Solaris and Netbsd
- Test wasm code on Node, Chrome, Firefox
- Test WASI
- No need for RDRAND feature on VxWorks

Signed-off-by: Joe Richey <joerichey@google.com>
2021-01-03 20:46:12 -08:00
Joe Richey d5186e0c86 Add Clippy msrv configuration file
This allows us to automatically ignore lints that are
incompatible with our MSRV.

Signed-off-by: Joe Richey <joerichey@google.com>
2021-01-03 20:46:12 -08:00
Joe Richey 3303349ef1 Use -Z build-std=core instead of xbuild
See: https://github.com/rust-osdev/cargo-xbuild#alternative-the-build-std-feature-of-cargo

Signed-off-by: Joe Richey <joerichey@google.com>
2021-01-03 20:46:12 -08:00
Artyom Pavlov 6c94834850 Remove outdated entries from Cargo.toml (#193) 2021-01-03 20:43:15 -08:00
Artyom Pavlov 95be9b40b4 Release v0.2.1 (#188)
Updates Changelog to include v0.1.16 changes as well
2021-01-03 19:52:26 -08:00
Joe Richey a37be0df31 Fix Target Triple
Signed-off-by: Joe Richey <joerichey@google.com>
2021-01-03 07:38:34 -08:00
Joe Richey a0d23eb34e Rename BCryptGenRandom impl to windows.rs 2021-01-03 07:38:34 -08:00
Joe Richey ffb7215995 Remove RtlGenRandom implementation
Also remove outdated comment from windows_uwp.rs
2021-01-03 07:38:34 -08:00
Joseph Richey b78e2e846d Update badges (#189)
Point the build status badges to point to Github Actions

Add badges for:
  - Downloads
  - License

Fix formatting to make updating easier

Signed-off-by: Joe Richey <joerichey@google.com>
2021-01-03 06:21:43 -08:00
Artyom Pavlov cadf11ecce Fix clippy warning (#187) 2021-01-02 15:20:56 -08:00
Artyom Pavlov 77740f8c45 remove direct stdweb support (#178) 2021-01-02 02:54:25 -08:00