Title: Fix getrandom 0.4.0 upgrade compatibility by updating mt19937 to v3.3.0 by Copilot · Pull Request #6971 · RustPython/RustPython · GitHub
Open Graph Title: Fix getrandom 0.4.0 upgrade compatibility by updating mt19937 to v3.3.0 by Copilot · Pull Request #6971 · RustPython/RustPython
X Title: Fix getrandom 0.4.0 upgrade compatibility by updating mt19937 to v3.3.0 by Copilot · Pull Request #6971 · RustPython/RustPython
Description: The getrandom 0.3.4→0.4.0 upgrade fails due to incompatibilities with the existing mt19937 v3.1 dependency. This PR upgrades to mt19937 v3.3.0 which uses rand_core 0.10 and is fully compatible with getrandom 0.4.0. Changes Updated Dependencies mt19937: Updated from version 3.1 to git version 3.3.0 (branch: version from https://github.com/RustPython/mt19937) Uses rand_core 0.10 which is compatible with getrandom 0.4.0 rand_core: Updated workspace dependency from 0.9 to 0.10 getrandom: Added sys_rng feature to workspace dependency (required for SysRng type) Random Module Updates Updated crates/stdlib/src/random.rs to use rand_core 0.10 API: Import Rng trait instead of deprecated RngCore Use MT19937::try_from_rng(&mut getrandom::SysRng) instead of try_from_os_rng() Error handling now uses std::io::Error::other() for version-agnostic error creation // Before: uses old API MT19937::try_from_os_rng() .map_err(|e| std::io::Error::from(e).to_pyexception(vm))? // After: uses rand_core 0.10 API MT19937::try_from_rng(&mut getrandom::SysRng).map_err(|e| { std::io::Error::other(format!("failed to initialize RNG: {}", e)) .to_pyexception(vm) })? WASM Build Support Explicit getrandom = { version = "0.3", features = ["wasm_js"] } dependency for WASM targets in rustpython-stdlib Required because ahash v0.8.12 (transitive dependency) still uses getrandom 0.3 This workaround can be removed once ahash updates to getrandom 0.4 Testing ✅ Regular builds compile successfully ✅ WASM builds compile successfully (wasm32-unknown-unknown target) ✅ Random module functionality verified (seeded and unseeded random generation) ✅ All existing tests pass The solution properly addresses the getrandom 0.4.0 compatibility by using the updated mt19937 version rather than workarounds. 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Open Graph Description: The getrandom 0.3.4→0.4.0 upgrade fails due to incompatibilities with the existing mt19937 v3.1 dependency. This PR upgrades to mt19937 v3.3.0 which uses rand_core 0.10 and is fully compatible with...
X Description: The getrandom 0.3.4→0.4.0 upgrade fails due to incompatibilities with the existing mt19937 v3.1 dependency. This PR upgrades to mt19937 v3.3.0 which uses rand_core 0.10 and is fully compatible with...
Opengraph URL: https://github.com/RustPython/RustPython/pull/6971
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:a4a680ce-8bce-809f-23ab-ee9148ce5126 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D4F6:1BB86F:4CD7C7:6CBEBB:6A637EC7 |
| html-safe-nonce | da891c9d15d06eb1f60842dd82e5bf5221cc759389debb74ea78f60c94bc302b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENEY2OjFCQjg2Rjo0Q0Q3Qzc6NkNCRUJCOjZBNjM3RUM3IiwidmlzaXRvcl9pZCI6IjYzNDQ3OTgzOTYwODk1OTc2MzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 11b9d29f424127366ad0bb3ac44fb7d14f3c37ecf94d118fada105311b5b6126 |
| hovercard-subject-tag | pull_request:3238451974 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/6971/files |
| twitter:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| og:image:alt | The getrandom 0.3.4→0.4.0 upgrade fails due to incompatibilities with the existing mt19937 v3.1 dependency. This PR upgrades to mt19937 v3.3.0 which uses rand_core 0.10 and is fully compatible with... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4c1de337de00c7969335f8866af41463301071379a3a15fba12e9b85aa6378d6 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a4df32552e4c631011bdcd4c81cc3d7408664a8b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width