Skip to content
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

[Android] Use the new overlay and Bionic module from Swift 6 #2777

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

finagolfin
Copy link
Member

The new overlay was merged into Swift 6 in swiftlang/swift#74758.

This supercedes the earlier #2707 with more complete support.

@hyp and @bnbarham, please review.

@@ -137,7 +139,7 @@ private func _loadLibrary(_ path: String) throws -> UnsafeMutableRawPointer {
#else
private func _loadLibrary(_ path: String) throws -> UnsafeMutableRawPointer {
guard let dlHandle = dlopen(path, RTLD_LAZY | RTLD_LOCAL) else {
throw LibraryPluginError(message: "loader error: \(String(cString: dlerror()))")
throw LibraryPluginError(message: "loader error: \(String(cString: dlerror()!))")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work with glibc? I thought that it was annotated with non null in some cases (at least I ran into one with foundation)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, worked fine in Fedora 40 x86_64, where I tested it before submitting, which uses a recent glibc 2.39-17 from earlier this year. Bionic simply added the _Nullable annotation to the output in the last year, so it has to be unwrapped for Android here, but unless glibc somehow can guarantee this is _Nonnull, this force unwrap should work for both.

@compnerd
Copy link
Member

compnerd commented Aug 6, 2024

@swift-ci please test

@finagolfin
Copy link
Member Author

@ahoppen, ready for merge.

@ahoppen ahoppen merged commit ff7f6da into swiftlang:main Aug 12, 2024
3 checks passed
@finagolfin finagolfin deleted the droid branch August 13, 2024 05:57
@finagolfin
Copy link
Member Author

Thanks for the quick review, @compnerd.

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