-
Notifications
You must be signed in to change notification settings - Fork 131
Handle strerror_r return type of UnsafeMutablePointer<CChar> for Android #499
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
@finagolfin does this seem right to you? You mention avoiding using the GNU |
@@ -327,7 +327,12 @@ extension SystemError: CustomStringConvertible { | |||
var cap = 64 | |||
while cap <= 16 * 1024 { | |||
var buf = [Int8](repeating: 0, count: cap) | |||
#if os(Android) | |||
let errptr: UnsafeMutablePointer<CChar> = TSCLibc.strerror_r(errno, &buf, buf.count) | |||
let err = Int(errptr.pointee) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem right. I think that this is missing a wrapper (is strerror_r
implemented as a macro?
No, that flag has nothing to do with strerror_r, either I miswrote or you are misremembering. @jakepetroules fixed this in #497 last month, but it was reverted later because of an issue on Amazon Linux. If you want to fix this, I suggest you bring back that commit and modify it so it works on that linux distro too. |
Yes. |
Why are you seeing this error on Android in the first place, building this package as a dependency of something else? As that linked pull notes, passing |
Yes, I was hitting this error with my periodic CI for swift-everywhere.org at https://github.com/swift-everywhere/swift-package-builds/actions for |
I plan to resurrect #497 later, feel free to beat me to it. 😉 |
Yeah, I just noticed that swift-nio fails to build with it.
Actually, I'm seeing that it is failing with I'll just remove all the flags and pin my hopes on #500 🥹 |
Huh, that appears to be this bug with macros when cross-compiling and applying command-line flags, perhaps getting worse in 6.1. Can't you just apply some per-package fixes on your CI for now, instead of applying these CLI flags universally?
That will only fix this repo and those that depend on it not having to |
This fixes the Android build error: