Skip to content

Conversation

usamoi
Copy link

@usamoi usamoi commented Oct 7, 2025

  • Added a CHANGELOG.md entry

Summary

On uefi targets, the return type of std::io::Error::raw_os_error is Option<usize>, instead of Option<i32>. In rand_core, it is assumed as Option<i32>. This PR uses Option<usize> as the return type on the uefi targets.

getrandom has already handled this: https://github.com/rust-random/getrandom/blob/18d89843981b93032b2a2c6f1e33897075a8d727/src/error.rs#L6-L19

Copy link
Member

@dhardy dhardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't feel like the right way to do this: clearly #1537 failed to isolate rand from getrandom changes.

Do you need a patch release for rand_core?

@newpavlov
Copy link
Member

newpavlov commented Oct 7, 2025

Note that technically it's a breaking change. I think we can cfg the implementation for UEFI and replace it with panic and fix it properly in the next breaking release.

UPD: On the second thought, since the current code does not compile on the UEFI targets, then this change can be considered non-breaking since it only affects "broken" targets.

@usamoi
Copy link
Author

usamoi commented Oct 7, 2025

Do you need a patch release for rand_core?

No. I can use the patch locally, so this is not necessary for me.

Note that technically it's a breaking change.

I'm fine with waiting to merge it into 0.10.

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 this pull request may close these issues.

3 participants