Skip to content

Sema: Avoid diagnosing required availability in swiftinterface files #80411

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

tshortli
Copy link
Contributor

The -require-explicit-availability compiler flag is designed to help developers find declarations that they've written with missing availability. The flag is not printed in swiftinterface files, though, so if a module has both -library-level=api and also has -require-explicity-availability=ignore (as the Swift stdlib does) then the result is that superfluous diagnostics are emitted when typechecking the emitted module interface that should have been suppressed by the ignore flag. Suppress these diagnostics when typechecking swiftinterface files since they are only designed to be seen by the owner of the module when they are building the module from source and they don't have much value in the context of interface verification.

@tshortli tshortli enabled auto-merge March 31, 2025 16:54
@tshortli tshortli force-pushed the skip-required-availability-checking-in-swiftinterfaces branch from abf5c50 to e2c9be1 Compare March 31, 2025 18:22
@tshortli tshortli disabled auto-merge March 31, 2025 18:55
@tshortli tshortli force-pushed the skip-required-availability-checking-in-swiftinterfaces branch from e2c9be1 to 738eb85 Compare April 1, 2025 03:42
@tshortli tshortli enabled auto-merge April 1, 2025 03:43
The `-require-explicit-availability` compiler flag is designed to help
developers find declarations that they've written with missing availability.
The flag is not printed in swiftinterface files, though, so if a module has
both `-library-level=api` and also has `-require-explicity-availability=ignore`
(as the Swift stdlib does) then the result is that superfluous diagnostics are
emitted when typechecking the emitted module interface that should have been
suppressed by the `ignore` flag. Suppress these diagnostics when typechecking
swiftinterface files since they are only designed to be seen by the owner of
the module when they are building the module from source and they don't have
much value in the context of interface verification.
@tshortli tshortli force-pushed the skip-required-availability-checking-in-swiftinterfaces branch from 738eb85 to b6a425a Compare April 1, 2025 14:12
@tshortli
Copy link
Contributor Author

tshortli commented Apr 1, 2025

@swift-ci please smoke test

@tshortli tshortli merged commit fdc0ba2 into swiftlang:main Apr 1, 2025
3 checks passed
@tshortli tshortli deleted the skip-required-availability-checking-in-swiftinterfaces branch April 1, 2025 19:21
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.

1 participant