Repository: gfx-rs/wgpu (language: rust)

Issue:
chore(deps): bump getrandom from 0.2.15 to 0.3.1 in the patch-updates group across 1 directory
Bumps the patch-updates group with 1 update in the / directory: [getrandom](https://github.com/rust-random/getrandom).

Updates `getrandom` from 0.2.15 to 0.3.1
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md">getrandom's changelog</a>.</em></p>
<blockquote>
<h2>[0.3.1] - 2025-01-28</h2>
<h3>Fixed</h3>
<ul>
<li>Build error on Android <a href="https://redirect.github.com/rust-random/getrandom/issues/588">#588</a></li>
</ul>
<p><a href="https://redirect.github.com/rust-random/getrandom/issues/588">#588</a>: <a href="https://redirect.github.com/rust-random/getrandom/pull/588">rust-random/getrandom#588</a></p>
<h2>[0.3.0] - 2025-01-25</h2>
<h3>Breaking Changes</h3>
<h4>Changed</h4>
<ul>
<li>Bump MSRV to 1.63 <a href="https://redirect.github.com/rust-random/getrandom/issues/542">#542</a></li>
<li>Rename <code>getrandom</code> and <code>getrandom_uninit</code> functions to <code>fill</code> and <code>fill_uninit</code> respectively <a href="https://redirect.github.com/rust-random/getrandom/issues/532">#532</a></li>
</ul>
<h4>Removed</h4>
<ul>
<li><code>wasm32-wasi</code> target support (use <code>wasm32-wasip1</code> or <code>wasm32-wasip2</code> instead) <a href="https://redirect.github.com/rust-random/getrandom/issues/499">#499</a></li>
<li><code>linux_disable_fallback</code>, <code>rdrand</code>, <code>js</code>, <code>test-in-browser</code>, and <code>custom</code> crate features
in favor of configuration flags <a href="https://redirect.github.com/rust-random/getrandom/issues/504">#504</a></li>
<li><code>register_custom_getrandom!</code> macro <a href="https://redirect.github.com/rust-random/getrandom/issues/504">#504</a></li>
<li>Implementation of <code>From&lt;NonZeroU32&gt;</code> for <code>Error</code> and <code>Error::code</code> method <a href="https://redirect.github.com/rust-random/getrandom/issues/507">#507</a></li>
<li>Internet Explorer 11 support <a href="https://redirect.github.com/rust-random/getrandom/issues/554">#554</a></li>
<li>Target-specific assocciated <code>Error</code> constants <a href="https://redirect.github.com/rust-random/getrandom/issues/562">#562</a></li>
</ul>
<h3>Changed</h3>
<ul>
<li>Use <code>ProcessPrng</code> on Windows 10 and up, and use <code>RtlGenRandom</code> on older Windows versions <a href="https://redirect.github.com/rust-random/getrandom/issues/415">#415</a></li>
<li>Do not use locale-specific <code>strerror_r</code> for retrieving error code descriptions <a href="https://redirect.github.com/rust-random/getrandom/issues/440">#440</a></li>
<li>Avoid assuming <code>usize</code> is the native word size in the <code>rdrand</code> backend <a href="https://redirect.github.com/rust-random/getrandom/issues/442">#442</a></li>
<li>Do not read from <code>errno</code> when <code>libc</code> did not indicate error on Solaris <a href="https://redirect.github.com/rust-random/getrandom/issues/448">#448</a></li>
<li>Switch from <code>libpthread</code>'s mutex to <code>futex</code> on Linux and to <code>nanosleep</code>-based wait loop
on other targets in the <code>use_file</code> backend <a href="https://redirect.github.com/rust-random/getrandom/issues/490">#490</a></li>
<li>Do not retry on <code>EAGAIN</code> while polling <code>/dev/random</code> on Linux <a href="https://redirect.github.com/rust-random/getrandom/issues/522">#522</a></li>
<li>Remove separate codepath for Node.js in the <code>wasm_js</code> backend
(bumps minimum supported Node.js version to v19) <a href="https://redirect.github.com/rust-random/getrandom/issues/557">#557</a></li>
<li>Use <code>js_namespace</code> in the <code>wasm_js</code> backend <a href="https://redirect.github.com/rust-random/getrandom/issues/559">#559</a></li>
</ul>
<h3>Added</h3>
<ul>
<li><code>wasm32-wasip1</code> and <code>wasm32-wasip2</code> support <a href="https://redirect.github.com/rust-random/getrandom/issues/499">#499</a></li>
<li><code>getrandom_backend</code> configuration flag for selection of opt-in backends <a href="https://redirect.github.com/rust-random/getrandom/issues/504">#504</a></li>
<li><code>Error::new_custom</code> method <a href="https://redirect.github.com/rust-random/getrandom/issues/507">#507</a></li>
<li><code>rndr</code> opt-in backend <a href="https://redirect.github.com/rust-random/getrandom/issues/512">#512</a></li>
<li>Automatic MemorySanitizer support <a href="https://redirect.github.com/rust-random/getrandom/issues/521">#521</a> <a href="https://redirect.github.com/rust-random/getrandom/issues/571">#571</a></li>
<li><code>u32</code> and <code>u64</code> functions for generating random values of the respective type <a href="https://redirect.github.com/rust-random/getrandom/issues/544">#544</a></li>
<li><code>wasm32v1-none</code> support in the <code>wasm_js</code> backend <a href="https://redirect.github.com/rust-random/getrandom/issues/560">#560</a></li>
<li><code>wasm_js</code> crate feature which allows users to enable the <code>wasm_js</code> opt-in backend <a href="https://redirect.github.com/rust-random/getrandom/issues/574">#574</a></li>
</ul>
<h3>Fixed</h3>
<ul>
<li>NetBSD fallback code based on <code>KERN_ARND</code> <a href="https://redirect.github.com/rust-random/getrandom/issues/555">#555</a></li>
</ul>
<p><a href="https://redirect.github.com/rust-random/getrandom/issues/415">#415</a>: <a href="https://redirect.github.com/rust-random/getrandom/pull/415">rust-random/getrandom#415</a></p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/rust-random/getrandom/commit/2bb39598632af0097426815487f5b33b07edacbc"><code>2bb3959</code></a> Release v0.3.1 (<a href="https://redirect.github.com/rust-random/getrandom/issues/589">#589</a>)</li>
<li><a href="https://github.com/rust-random/getrandom/commit/ac379dacbfbcbcc14747a0e014d84d6f24c8140b"><code>ac379da</code></a> Fix build error on Android (<a href="https://redirect.github.com/rust-random/getrandom/issues/588">#588</a>)</li>
<li><a href="https://github.com/rust-random/getrandom/commit/aa9636349418ffa58bca6e2884d1bbc63fa1d2fa"><code>aa96363</code></a> Add benchmarks for u32/u64 functions. (<a href="https://redirect.github.com/rust-random/getrandom/issues/582">#582</a>)</li>
<li><a href="https://github.com/rust-random/getrandom/commit/e38855c69882c2c1ff7438f9292512a0b91275fe"><code>e38855c</code></a> Fix release date for v0.3.0 (<a href="https://redirect.github.com/rust-random/getrandom/issues/587">#587</a>)</li>
<li><a href="https://github.com/rust-random/getrandom/commit/d5683740ef9cd2d0ebfed73f2a629c0ebb47b5e8"><code>d568374</code></a> Release v0.3.0 (<a href="https://redirect.github.com/rust-random/getrandom/issues/563">#563</a>)</li>
<li><a href="https://github.com/rust-random/getrandom/commit/5e62ce9fadb401539a08b329e4cbd98cc6393f60"><code>5e62ce9</code></a> rndr: minor tweaks (<a href="https://redirect.github.com/rust-random/getrandom/issues/586">#586</a>)</li>
<li><a href="https://github.com/rust-random/getrandom/commit/3d0c01c35231b40f58b49f4455797c85c2e8c042"><code>3d0c01c</code></a> ci: disable broken Solaris and Emscripten cross jobs (<a href="https://redirect.github.com/rust-random/getrandom/issues/585">#585</a>)</li>
<li><a href="https://github.com/rust-random/getrandom/commit/7cde98b9770eaefe1bcf6194f7ac55ce28d9b53e"><code>7cde98b</code></a> Add <code>wasm_js</code> feature flag (<a href="https://redirect.github.com/rust-random/getrandom/issues/574">#574</a>)</li>
<li><a href="https://github.com/rust-random/getrandom/commit/6be40128a7c19bac658c6e85e808a6b5eadfd6b2"><code>6be4012</code></a> Web: use safe method to copy to <code>MaybeUninit</code> (<a href="https://redirect.github.com/rust-random/getrandom/issues/584">#584</a>)</li>
<li><a href="https://github.com/rust-random/getrandom/commit/2648e60c5d27979f45043e379b1af7bee5e300a9"><code>2648e60</code></a> ESP-IDF: Enable unconditionally (<a href="https://redirect.github.com/rust-random/getrandom/issues/583">#583</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/rust-random/getrandom/compare/v0.2.15...v0.3.1">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=getrandom&package-manager=cargo&previous-version=0.2.15&new-version=0.3.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions


</details>


Discussion / hints:
Not sure why CI is hung up with missing `--cfg=`; I've changed `.cargo/config.toml` to handle that, and it WFM locally. I don't think the appending of `profile.dev.debug = false` to _should_ be affecting anything, but that's the only step I can think of, ATM, that might be relevant.
This PR also has a conflict with multiple versions of `getrandom` still, i.e., `flume` → `nanorand` → `getrandom` is still at 0.2.\*.
Honestly we can probably just pull our use of getrandom entirety, we should be using `rand` anyway

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index 89fccee596..004351f012 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4595,7 +4595,6 @@ dependencies = [
  "env_logger",
  "fern",
  "flume",
- "getrandom 0.2.15",
  "glam",
  "ktx2",
  "log",
diff --git a/Cargo.toml b/Cargo.toml
index 61d9c74a3a..a3761ce5da 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -98,7 +98,6 @@ env_logger = "0.11"
 fern = "0.7"
 flume = "0.11"
 futures-lite = "2"
-getrandom = "0.2"
 glam = "0.29"
 hashbrown = { version = "0.14.5", default-features = false, features = [
     "ahash",
diff --git a/examples/features/Cargo.toml b/examples/features/Cargo.toml
index 3165f2af27..11cf6b2115 100644
--- a/examples/features/Cargo.toml
+++ b/examples/features/Cargo.toml
@@ -35,7 +35,6 @@ bytemuck.workspace = true
 cfg-if.workspace = true
 encase = { workspace = true, features = ["glam"] }
 flume.workspace = true
-getrandom.workspace = true
 glam = { workspace = true, features = ["bytemuck"] }
 ktx2.workspace = true
 log.workspace = true
diff --git a/examples/features/src/repeated_compute/mod.rs b/examples/features/src/repeated_compute/mod.rs
index 4f7b37b99f..a31a456e63 100644
--- a/examples/features/src/repeated_compute/mod.rs
+++ b/examples/features/src/repeated_compute/mod.rs
@@ -5,6 +5,8 @@
 //! hello-compute example does not such as mapping buffers
 //! and why use the async channels.
 
+use nanorand::Rng;
+
 const OVERFLOW: u32 = 0xffffffff;
 
 async fn run() {
@@ -13,7 +15,7 @@ async fn run() {
 
     for _ in 0..10 {
         for p in numbers.iter_mut() {
-            *p = generate_rand() as u32;
+            *p = nanorand::tls_rng().generate::<u16>() as u32;
         }
 
         compute(&mut numbers, &context).await;
@@ -29,12 +31,6 @@ async fn run() {
     }
 }
 
-fn generate_rand() -> u16 {
-    let mut bytes = [0u8; 2];
-    getrandom::getrandom(&mut bytes[..]).unwrap();
-    u16::from_le_bytes(bytes)
-}
-
 async fn compute(local_buffer: &mut [u32], context: &WgpuContext) {
     log::info!("Beginning GPU compute on data {local_buffer:?}.");
     // Local buffer contents -> GPU storage buffer


Test patch: