Skip to content

Conversation

@hnrklssn
Copy link
Member

_SwiftifyImport assumes types like Swift.Int, Swift.UnsafePointer and Swift.Span are available. This is not the case when building the stdlib itself. Disable safe interop in the stdlib to prevent errors. This currently has no effect, but will when this feature is enabled by default, which I have manually tested.

_SwiftifyImport assumes types like Swift.Int, Swift.UnsafePointer<T> and
Swift.Span<T> are available. This is not the case when building the
stdlib itself. Disable safe interop in the stdlib to prevent errors.
This currently has no effect, but will when this feature is enabled by
default, which I have manually tested.
@hnrklssn
Copy link
Member Author

@swift-ci please smoke test


/// Whether the importer should skip SafeInteropWrappers, even though the
/// feature is enabled.
bool DisableSafeInteropWrappers = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we anticipate other cases where we want to disable the wrappers? I wonder if we should always check directly for whether we are building the stdlib instead of having a new flag. I have no strong feelings here though.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know of any other cases, but ClangImporter doesn't seem to have access to swift::FrontendOptions from what I could tell.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm. We have -disable-experimental-feature, although I'm not sure if we model having an on-by-default feature that is then disabled.

@hnrklssn hnrklssn merged commit 89b31cf into swiftlang:main Oct 14, 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.

3 participants