Skip to content

Is it possible to continue maintain version 0.2? #653

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tracked by #15442
Berrysoft opened this issue Apr 22, 2025 · 5 comments · Fixed by #654
Closed
Tracked by #15442

Is it possible to continue maintain version 0.2? #653

Berrysoft opened this issue Apr 22, 2025 · 5 comments · Fixed by #654

Comments

@Berrysoft
Copy link
Contributor

There are too many crates still depend on getrandom 0.2, while some of them depend on rand_core <0.9. It would be painful to update all of them, but I would like cygwin support. Therefore, I'm asking if it is still possible to backport cygwin support to getrandom 0.2 and release a new version 0.2.16.

@newpavlov
Copy link
Member

Yes, we can do backports for selected features, assuming they are easy enough to port (it should be fine in this case). I will prepare a PR a bit later.

@Berrysoft
Copy link
Contributor Author

If there's a branch for that, I can also open a PR:)

diff --git a/src/lib.rs b/src/lib.rs
index bc3695b..62591f7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -251,6 +252,7 @@ cfg_if! {
         // Check for target_arch = "arm" to only include the 3DS. Does not
         // include the Nintendo Switch (which is target_arch = "aarch64").
         all(target_os = "horizon", target_arch = "arm"),
+        target_os = "cygwin",
     ))] {
         mod util_libc;
         #[path = "getrandom.rs"] mod imp;
diff --git a/src/util_libc.rs b/src/util_libc.rs
index 129362d..f488b41 100644
--- a/src/util_libc.rs
+++ b/src/util_libc.rs
@@ -9,7 +9,7 @@ use core::{
 use libc::c_void;

 cfg_if! {
-    if #[cfg(any(target_os = "netbsd", target_os = "openbsd", target_os = "android"))] {
+    if #[cfg(any(target_os = "netbsd", target_os = "openbsd", target_os = "android", target_os = "cygwin"))] {
         use libc::__errno as errno_location;
     } else if #[cfg(any(target_os = "linux", target_os = "emscripten", target_os = "hurd", target_os = "redox", target_os = "dragonfly"))] {
         use libc::__errno_location as errno_location;
                                                                                                                        

@newpavlov
Copy link
Member

I added the backports/v0.2 branch. You can create a PR against it. Do not forget to add an appropriate changelog entry (you can use today for release date).

@Berrysoft
Copy link
Contributor Author

Thank you! I'll create one later.

@newpavlov
Copy link
Member

getrandom v0.2.16 with backported Cygwin support is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants