From d985876f1d27466a8f1399c2f5a2a7bba67c1bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Fri, 5 Apr 2024 15:36:10 +0300 Subject: [PATCH 1/7] Release v0.2.13 --- .cargo/config | 10 +--------- .cargo/config.toml | 9 +++++++++ CHANGELOG.md | 5 +++-- Cargo.toml | 2 +- src/lib.rs | 17 ++++++++++++++++- 5 files changed, 30 insertions(+), 13 deletions(-) mode change 100644 => 120000 .cargo/config create mode 100644 .cargo/config.toml diff --git a/.cargo/config b/.cargo/config deleted file mode 100644 index be3061ab..00000000 --- a/.cargo/config +++ /dev/null @@ -1,9 +0,0 @@ -# Allow normal use of "cargo run" and "cargo test" on these wasm32 platforms. -[target.wasm32-unknown-unknown] -runner = 'wasm-bindgen-test-runner' -[target.wasm32-wasi] -runner = 'wasmtime' - -# Just run on node by default (that's where emscripten is tested) -[target.'cfg(target_os = "emscripten")'] -runner = 'node' diff --git a/.cargo/config b/.cargo/config new file mode 120000 index 00000000..2a9bffb7 --- /dev/null +++ b/.cargo/config @@ -0,0 +1 @@ +.cargo/config.toml \ No newline at end of file diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..be3061ab --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,9 @@ +# Allow normal use of "cargo run" and "cargo test" on these wasm32 platforms. +[target.wasm32-unknown-unknown] +runner = 'wasm-bindgen-test-runner' +[target.wasm32-wasi] +runner = 'wasmtime' + +# Just run on node by default (that's where emscripten is tested) +[target.'cfg(target_os = "emscripten")'] +runner = 'node' diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f2191cf..0e8a50b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## [0.2.13] - 2024-04-07 ### Added - `linux_disable_fallback` crate feature to disable `/dev/urandom`-based fallback on Linux and - Android targets. Enabling this feature bumps minimum supported Linux kernel version to 4.17 and + Android targets. Enabling this feature bumps minimum supported Linux kernel version to 3.17 and Android API level to 23 (Marshmallow). [#396] ### Changed @@ -433,6 +433,7 @@ Publish initial implementation. ## [0.0.0] - 2019-01-19 Publish an empty template library. +[0.2.13]: https://github.com/rust-random/getrandom/compare/v0.2.12...v0.2.13 [0.2.12]: https://github.com/rust-random/getrandom/compare/v0.2.11...v0.2.12 [0.2.11]: https://github.com/rust-random/getrandom/compare/v0.2.10...v0.2.11 [0.2.10]: https://github.com/rust-random/getrandom/compare/v0.2.9...v0.2.10 diff --git a/Cargo.toml b/Cargo.toml index ba174c6e..bf04ec5b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "getrandom" -version = "0.2.12" # Also update html_root_url in lib.rs when bumping this +version = "0.2.13" # Also update html_root_url in lib.rs when bumping this edition = "2018" authors = ["The Rand Project Developers"] license = "MIT OR Apache-2.0" diff --git a/src/lib.rs b/src/lib.rs index 85603655..991be27b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -47,6 +47,21 @@ //! This prevents a crate from overriding a secure source of randomness //! (either accidentally or intentionally). //! +//! ## `/dev/urandom` fallback on Linux and Android +//! +//! On Linux targets the fallback is present only for the following `target_arch`es: +//! `aarch64`, `arm`, `powerpc`, `powerpc64`, `s390x`, `x86`, `x86_64`. Other supported +//! `target_arch`es [require](https://doc.rust-lang.org/stable/rustc/platform-support.html) +//! kernel versions which support `getrandom` system call, so fallback is not needed. +//! +//! On Android targets the fallback is present only for the following `target_arch`es: +//! `aarch64`, `arm`, `x86`, `x86_64`. Other `target_arch`es (e.g. RISC-V) require +//! sufficiently high API levels. +//! +//! The fallback can be disabled by enabling the `linux_disable_fallback` crate feature. +//! Note that doing so will bump minimum supported Linux kernel version to 3.17 and +//! Android API level to 23 (Marshmallow). +//! //! ### RDRAND on x86 //! //! *If the `rdrand` Cargo feature is enabled*, `getrandom` will fallback to using @@ -189,7 +204,7 @@ #![doc( html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", html_favicon_url = "https://www.rust-lang.org/favicon.ico", - html_root_url = "https://docs.rs/getrandom/0.2.12" + html_root_url = "https://docs.rs/getrandom/0.2.13" )] #![no_std] #![warn(rust_2018_idioms, unused_lifetimes, missing_docs)] From c10679ce3bdedb8b2830c4973e741f97ecf0a109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Fri, 5 Apr 2024 16:07:33 +0300 Subject: [PATCH 2/7] Tweak web tests --- .github/workflows/tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2c62424c..2649ab2c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -250,6 +250,9 @@ jobs: - name: Test (Firefox) run: wasm-pack test --headless --firefox --features=js,test-in-browser - name: Test (Chrome) + # We get spurious failures, see: + # https://github.com/rust-random/getrandom/issues/400 + continue-on-error: true run: wasm-pack test --headless --chrome --features=js,test-in-browser - name: Test (Edge) if: runner.os == 'Windows' @@ -258,8 +261,6 @@ jobs: run: wasm-pack test --headless --chrome --chromedriver $Env:EDGEWEBDRIVER\msedgedriver.exe --features=js,test-in-browser - name: Test (Safari) if: runner.os == 'macOS' - # Safari tests are broken: https://github.com/rustwasm/wasm-bindgen/issues/3004 - continue-on-error: true run: wasm-pack test --headless --safari --features=js,test-in-browser - name: Test (custom getrandom) run: wasm-pack test --node --features=custom From bd3bd42da05000407e5be10ea42611f032755c66 Mon Sep 17 00:00:00 2001 From: Artyom Pavlov Date: Sat, 6 Apr 2024 02:12:18 +0300 Subject: [PATCH 3/7] Apply `continue-on-error: true` for the whole Web Windows job --- .github/workflows/tests.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2649ab2c..6f45600f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -229,6 +229,9 @@ jobs: host: x86_64-unknown-linux-musl - os: windows-2022 host: x86_64-pc-windows-msvc + # We get spurious failures on Windows, see: + # https://github.com/rust-random/getrandom/issues/400 + continue-on-error: true - os: macos-12 host: x86_64-apple-darwin runs-on: ${{ matrix.os }} @@ -250,14 +253,8 @@ jobs: - name: Test (Firefox) run: wasm-pack test --headless --firefox --features=js,test-in-browser - name: Test (Chrome) - # We get spurious failures, see: - # https://github.com/rust-random/getrandom/issues/400 - continue-on-error: true run: wasm-pack test --headless --chrome --features=js,test-in-browser - name: Test (Edge) - if: runner.os == 'Windows' - # Edge has flaky failures: "driver failed to bind port during startup" - continue-on-error: true run: wasm-pack test --headless --chrome --chromedriver $Env:EDGEWEBDRIVER\msedgedriver.exe --features=js,test-in-browser - name: Test (Safari) if: runner.os == 'macOS' From c61ea4e794e8bd13d42eb0f300e955103ac10d56 Mon Sep 17 00:00:00 2001 From: Artyom Pavlov Date: Sat, 6 Apr 2024 02:12:56 +0300 Subject: [PATCH 4/7] Update release date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e8a50b3..f07e915c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.2.13] - 2024-04-07 +## [0.2.13] - 2024-04-06 ### Added - `linux_disable_fallback` crate feature to disable `/dev/urandom`-based fallback on Linux and Android targets. Enabling this feature bumps minimum supported Linux kernel version to 3.17 and From dc2e225d10a73a9e70aaf29f31d9493f0548f696 Mon Sep 17 00:00:00 2001 From: Artyom Pavlov Date: Sat, 6 Apr 2024 02:15:33 +0300 Subject: [PATCH 5/7] Test Edge only on Windows --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6f45600f..fa39a911 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -255,6 +255,7 @@ jobs: - name: Test (Chrome) run: wasm-pack test --headless --chrome --features=js,test-in-browser - name: Test (Edge) + if: runner.os == 'Windows' run: wasm-pack test --headless --chrome --chromedriver $Env:EDGEWEBDRIVER\msedgedriver.exe --features=js,test-in-browser - name: Test (Safari) if: runner.os == 'macOS' From ac803377a8b7ecf6e81dee03ae2e9e8f79d33637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Sat, 6 Apr 2024 02:30:19 +0300 Subject: [PATCH 6/7] Fix path in `.cargo/config` symlink --- .cargo/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cargo/config b/.cargo/config index 2a9bffb7..ab8b69cb 120000 --- a/.cargo/config +++ b/.cargo/config @@ -1 +1 @@ -.cargo/config.toml \ No newline at end of file +config.toml \ No newline at end of file From b93791b9c44280b9e86000eaed9f5b9728d5491d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Sat, 6 Apr 2024 02:32:56 +0300 Subject: [PATCH 7/7] Update wasmpack to v0.12.1 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fa39a911..40db0124 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -243,7 +243,7 @@ jobs: - name: Install precompiled wasm-pack shell: bash run: | - VERSION=v0.11.0 + VERSION=v0.12.1 URL=https://github.com/rustwasm/wasm-pack/releases/download/${VERSION}/wasm-pack-${VERSION}-${{ matrix.host }}.tar.gz wget -O - $URL | tar -xz --strip-components=1 -C ~/.cargo/bin wasm-pack --version