-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Make Host NSUnimplemented for Android #2439
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
Conversation
If Also, if functionality cant be supported, it should call |
@swift-ci test |
cc @drodriguez |
I hate to regress. Can we provide a dynamic shim in CF for getifaddrs for Android use only that errors out? |
By that I mean: that errors out if you're running on an old-enough Android OS. |
It would be better to not disable it completely. I was aware of this usage, and there should be a way of fixing it. Lily proposal might be a way (even if the alternative for pre-5.0 is just something like In any case, if this is all the implementation, it also should include disabling the tests, or they will fail. |
For context, I've provided some guidance on what the preferred way to deal with these situations on the forums. |
Hi @drodriguez and @millenomi, I agree that it doesn't feel good to regress on available functionality. But I don't see a better way around this. As I outlined on the forums here I don't think it's possible to make a shim for this on Android: I'm pretty sure we need a compile-time API Level check. Otherwise we have no Foundation at all on Android 5.0, which is a much worse regression than not having I have no idea how often this functionality would be used on Android (have never used the API myself) but if it's not available on iOS I think it's reasonable for it not to be available on Android either. We'd need to disable the Host tests on Android, yes. And I agree that |
@spevans sorry, that last message about NSUnimplemented was in response to your message too. I appreciate your thoughts on this. I agree, it'd probably be ideal to mark But I'm happy to go with your guidance on this if you have a strong opinion- I personally have never used the |
@millenomi looks like I can take your suggestion after all using the approach from #2228. What do you think the best way of implementing the |
Could |
I'm not quite sure what the support for that is on Android. @ephemer, thank you for going a different route. |
@millenomi I'm just getting to making a PR now (I have very little idea what I'm doing though- as I mentioned I've never used this API before). I am just dynamically checking for What I'm missing is a way to fatal error out from C in the Edit: it currently looks like this:
|
Could you make the shim function return |
I found an Android implementation of https://github.com/morristech/android-ifaddrs However, for myself, I have just used the |
The Swift project moved the default branch to More detail about the branch update - https://forums.swift.org/t/updating-branch-names/40412 |
It is currently impossible to load Foundation on Android 5.0 because
getifaddrs
is not available there.In the absence of
#if available(Android 24, *)
(which would be the ideal solution here), we need to avoid compiling any mention ofgetifaddrs
, which is what this PR aims to achieve.