Skip to content

Don't build the stdlib modules as members of the same package - #888

Merged
tshortli merged 1 commit into
swiftlang:mainfrom
tshortli:revert-retroactive-attribute-removal
Sep 30, 2026
Merged

tshortli merged 1 commit into
swiftlang:mainfrom
tshortli:revert-retroactive-attribute-removal

Conversation

@tshortli

Copy link
Copy Markdown
Contributor

When this project is built with SwiftPM, the _RegexParser, _StringProcessing, and RegexBuilder modules are all built with -package-name swift_experimental_string_processing. The compiler does not consider a conformance to be retroactive when the conforming type or the protocol comes from a module in the same package, so the @retroactive attributes in RegexBuilder became errors in the Swift 6 language mode and were removed. However, when these modules are built with CMake as part of the Swift toolchain, no package name is specified and the compiler instead warns that the conformances of String, Substring, Character, and UnicodeScalar to RegexComponent are retroactive.

Opt the stdlib targets out of package access in the package manifest so that the SwiftPM build matches the toolchain build, and restore the @retroactive attributes.

Follow up to #879.

When this project is built with SwiftPM, the `_RegexParser`,
`_StringProcessing`, and `RegexBuilder` modules are all built with
`-package-name swift_experimental_string_processing`. The compiler does not
consider a conformance to be retroactive when the conforming type or the
protocol comes from a module in the same package, so the `@retroactive`
attributes in `RegexBuilder` became errors in the Swift 6 language mode and
were removed. However, when these modules are built with CMake as part of the
Swift toolchain, no package name is specified and the compiler instead warns
that the conformances of `String`, `Substring`, `Character`, and
`UnicodeScalar` to `RegexComponent` are retroactive.

Opt the stdlib targets out of package access in the package manifest so that
the SwiftPM build matches the toolchain build, and restore the `@retroactive`
attributes.
@tshortli

Copy link
Copy Markdown
Contributor Author

@swift-ci please test

@tshortli
tshortli merged commit cbacbc2 into swiftlang:main Sep 30, 2026
27 checks passed
@tshortli
tshortli deleted the revert-retroactive-attribute-removal branch September 30, 2026 13:15
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