Skip to content

What is the minimum iOS version we target? #1406

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
josephlr opened this issue Jun 25, 2019 · 4 comments
Closed

What is the minimum iOS version we target? #1406

josephlr opened this issue Jun 25, 2019 · 4 comments

Comments

@josephlr
Copy link
Contributor

As part of rust-random/getrandom#38 we are trying to figure out if we can reliably use the macOS/iOS getentropy(2) function (added in macOS 10.12 and iOS 10).

The Rust Platform Support page has a minimum version for macOS (10.7) but not for iOS. Given that distribution of iOS installs is much better than that of macOS or Android, I think setting iOS 10 to be the minimum supported version would be reasonable.

If we do decide the that Rust's min iOS version is >= 10, we should at least add all the new libc functions added since then (including getentropy).

@gnzlbg
Copy link
Contributor

gnzlbg commented Jun 25, 2019

AFAICT we can add the API here, but whether rust-random/getrandom should use it or not, depends on which iOS versions that crate wants to support. If it wants to support older versions, then it should probably query the iOS version and provide a workaround.

Or in other words, libc does not guarantee that all provided APIs are available on all HOSTs of a particular platform. It is up to the users of libc to make sure that the APIs they are using are actually available on the HOSTs where their binaries run.

@josephlr
Copy link
Contributor Author

If it wants to support older versions, then it should probably query the iOS version and provide a workaround.

The main reason I ask is that there is a proposal (rust-lang/rust#62082) to make getrandom a dependancy of Rust's std. So figuring out the min iOS version for that seems important. I agree that this is not a libc issue though.

@gnzlbg
Copy link
Contributor

gnzlbg commented Jun 25, 2019

That feels like it would be a libstd issue. One can probably use a atomic function pointer that is set on initialization to use different implementations depending on the iOS version. Doing that only requires relaxed atomic loads and stores.

@gnzlbg
Copy link
Contributor

gnzlbg commented Jul 5, 2019

I'm closing this, since adding an API here just exposes the FFI wrapper. It has nothing to do with the minimum iOS version that libstd supports - that's up to libstd to decide, and that will determine whether they can use a certain API or not.

@gnzlbg gnzlbg closed this as completed Jul 5, 2019
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

No branches or pull requests

2 participants