-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Use -warnings-as-errors in Swift compilation #120448
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the Swift compilation process by treating warnings as errors during the build process. This ensures that any Swift warnings in the CryptoKit bindings will fail the build, preventing warnings from being silently ignored.
- Adds the
-warnings-as-errors
flag to the Swift compiler command in the CMake build configuration
Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's going to make SDK upgrades really annoying, but I think we already get that from the Objective C APIs... so this is at least consistent.
We have yet to get a warning from an SDK update... but when I was working on HKDF I almost had a (correct!) warning slip in, so it seems like a good trade off. |
0a220d5 disagrees 😄. All of the |
I meant from CryptoKit / Swift. |
I think we should do runtime/eng/native/configurecompiler.cmake Lines 573 to 576 in 8d3c401
|
Fair enough. I can give that a go. |
Right now our Swift CryptoKit bindings will compile with warnings.
The good news is we don't actually have any warnings, but we should guard this at build-time.
Before:
After: