Skip to content

Conversation

@FranzBusch
Copy link
Member

@FranzBusch FranzBusch commented Oct 29, 2025

Motivation

In my recent work to build protoc from source I mistakenly disabled warnings by using unsafe flags. Unsafe flags make packages essentially unusable.

Modifications

Disable the warnings by using the new warning control settings introduced in 6.2 instead.

Result

Fixes #1881

@FranzBusch FranzBusch added the 🔨 semver/patch No public API change. label Oct 29, 2025
## Motivation

In my recent work to build `protoc` from source I mistakenly disabled warnings by using unsafe flags. Unsafe flags make packages essentially unusable.

## Modifications

Disable the warnings by using the new warning control settings introduced in 6.2 instead.

## Result

Fixes apple#1881
@@ -1,4 +1,4 @@
// swift-tools-version:5.10
// swift-tools-version:6.2
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will cause everything to compile in Swift 6 language mode as well, right? That's probably fine (if we've fixed all the relevant issues), but should we add in swiftLanguageModes: [.v5] for now so that we don't change the language mode as part of an otherwise unrelated change, and then we can go back and audit it for Swift 6 support later?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds sensible to me.

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 was aware and wanted to see what the CI says. It looks like we are compiling cleanly in Swift 6 mode. I will change it back to Swift 5 mode for now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Just when I wrote this comment I saw that we are actually setting the language mode already in all of our manifests.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Well that's what I get for not expanding the diff far enough.

@FranzBusch FranzBusch requested review from Lukasa and allevato October 29, 2025 13:07
@FranzBusch FranzBusch merged commit 62569b6 into apple:main Oct 29, 2025
12 checks passed
@FranzBusch FranzBusch deleted the fb-disable-warnings branch October 29, 2025 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Target 'protoc' in product 'SwiftProtobufPlugin' contains unsafe build flags

3 participants