-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Remove incorrect guard
check for Android
#5171
Conversation
@swift-ci please test |
I took a look at @hyp's github profile and it shows no activity for the last two months. Since this is an obvious fix that he agreed with back then and I want to get it into 6.1 next, going ahead and merging. |
@finagolfin I don't personally have the context around the past PR but It appears that our internal CI started to fail after this PR with the error:
Any thoughts? |
CC @compnerd |
I took a look at your build log and this is the full context it shows:
Looking into this more, it appears your CI is still using the older NDK 26b from Oct. 2023, whereas I switched my daily Android CI over to NDK 27 once it was released last summer, finagolfin/swift-android-sdk@606ccefea. That current LTS NDK 27 has a patch that allows My suggestion is that you upgrade your TBC CI to NDK 27, which is the current LTS NDK, as NDK 26 is no longer supported by upstream. If that's not possible yet for some reason, you can always apply this |
I didn't notice first either but if you look a few lines below, there are more errors with other functions like These are the declarations in
So it seems that we still need the guard with r27c. Is there a chance that your CI doesn't build these? |
OK, I looked into it further and I forgot that I myself am using an even older version of these So it turns out both @hyp and I were using old versions of the Bionic There are a couple fundamental issues that remain. This guard check is fundamentally incorrect, as it will always unwrap and fail at runtime, as I just confirmed by extracting this snippet and running it locally. All @hyp was doing was shutting up the typechecker in the compiler by adding this check, as it would check that the types were correct after unwrapping, but would then fail at runtime. Are you TBC people running these Foundation tests for Android to make sure this executes properly? I suspect not. In my case, not only do I periodically build this repo natively on Android, but I run its test suite too. Based on the problems you're seeing with compiling against I'm open to ideas on how to fix this in this repo going forward. An easy way for you to fix this on your CI for now might be simply to add a patch commenting out all this failing I've been meaning to backport the latest version of these |
Ah :) I think the original, existing runtime behavior in this Foundation code on Android was for the |
This reverts commit fb8d64d.
Why do you believe that? As I pointed out, it runs fine with the earlier Bionic
No, it's clearly incorrect, as it always fails at runtime. Your argument is merely that the subsequent code is also broken at rumtime, so it's okay if you put this broken check before just to keep it compiling, but I think you're wrong about the subsequent In any case, I still disagree with the premise of adding this clearly incorrect check, just to keep your CI building.
I do. Nobody is stopping you from adding such broken code locally to your CI, but you shouldn't be doing so upstream here. |
This was added a couple months ago and when I pointed out it will fail, I was told it would be fixed by some upstream changes and here later. I haven't heard anything in that comment thread since, so let's at least get this fixed in trunk and 6.1 for now, and we can adjust to Bionic upstream whenever that change is in.
@hyp, let me know if you're okay with just fixing this for now, as I currently have to do on my Android CI.