Skip to content

Conversation

@3405691582
Copy link
Member

OpenBSD 7.8 snapshots hide the type information for FILE. Therefore, the types for the standard stdio streams should (regrettably) be OpaquePointer, due to the well-discussed issue of losing type information for forward-declared C types.

We explicitly drop to void * in the LibcOverlayShims for backwards compatibility, since OpenBSD 7.8 is not yet released.

@3405691582
Copy link
Member Author

@swift-ci please test.

@3405691582
Copy link
Member Author

@swift-ci please test macOS platform.

@3405691582
Copy link
Member Author

We need to disable SwiftReflectionTest on OpenBSD < 7.8 with this change as well, because there will still be a type mismatch on the Swift side as that calls fwrite/fflush directly.

@3405691582 3405691582 force-pushed the opaque_file branch 2 times, most recently from 3c38990 to f9a9f2c Compare September 24, 2025 21:05
@3405691582
Copy link
Member Author

@swift-ci please test.

@3405691582
Copy link
Member Author

@swift-ci please test.

@3405691582
Copy link
Member Author

@swift-ci please test.

@3405691582
Copy link
Member Author

@swift-ci please test.

Copy link
Member

@finagolfin finagolfin left a comment

Choose a reason for hiding this comment

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

Not familiar with the OpenBSD change, but this will not affect any other platform and you know OpenBSD best, so LGTM with nit.

OpenBSD 7.8 snapshots hide the type information for FILE. Therefore, the
types for the standard stdio streams should (regrettably) be
OpaquePointer, due to the well-discussed issue of losing type information
for forward-declared C types.

We explicitly drop to void * in the LibcOverlayShims for backwards
compatibility, since OpenBSD 7.8 is not yet released.

However, because SwiftReflectionTest uses libc FILE functions like
fwrite and fflush directly, this means that building this on 7.7 will
still fail because types will mismatch. Instead of adding extra shims,
let's just skip building SwiftReflectionTest on 7.7.
@finagolfin
Copy link
Member

@swift-ci smoke test

@finagolfin finagolfin merged commit 9683569 into swiftlang:main Sep 27, 2025
3 checks passed
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.

2 participants