Skip to content

TSCBasic: FILE is an opaque struct since Android 7 #243

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

Merged
merged 1 commit into from
Jul 26, 2021

Conversation

finagolfin
Copy link
Member

I've been working around this for awhile by passing in -Xcc -D__ANDROID_API__=23 when cross-compiling SPM for Android with this file. Otherwise, I would get these errors:

/home/butta/src/swift-tools-support-core/Sources/TSCBasic/WritableByteStream.swift:685:51: error: cannot find type 'FILE' in scope
    public init(filePointer: UnsafeMutablePointer<FILE>, closeOnDeinit: Bool = true, buffered: Bool = true) throws {
/home/butta/src/swift-tools-support-core/Sources/TSCBasic/Process.swift:546:70: error: cannot convert value of type 'OpaquePointer?' to expected argument type 'AbsolutePath'
        let stdinStream = try LocalFileOutputByteStream(filePointer: fdopen(stdinPipe[1], "wb"), closeOnDeinit: true)

This is because a definition was added for Android 6, ie API 23, and below, but it's an opaque struct for all recent Android APIs, aosp-mirror/platform_bionic@3037ea4. This pull gets this Swift file to compile without having to force the Android API to 23 with the above flags.

@neonichu
Copy link
Contributor

@swift-ci please test

@finagolfin
Copy link
Member Author

Ping, ready to go?

@tomerd tomerd merged commit 7d8933a into swiftlang:main Jul 26, 2021
@finagolfin finagolfin deleted the droid branch July 26, 2021 20:30
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