Enable swift module interfaces if the package author enables library evolution via unsafe flags #3528
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enable swift module interfaces for targets that are compiled with
enable-library-evolution
. This supports the intent of building a module that way.Motivation:
There isn't currently a way for package authors to enable library evolution or module interfaces from the package manifest. They can pass
-enable-library-evolution
in their unsafe flags, but because-emit-module-interface
requires a path parameter, it isn't something that can be set in the manifest.This change enables swift module interfaces when a library does specify
-enable-library-evolution
in its unsafe flags, supporting the semantic intent of providing that flag.This is useful in the general case, but is most immediately needed to generate .swiftinterface files for #3431.
Modifications:
-emit-module-interface
when-enable-library-evolution
is specifiedswift-build
flag-emit-parseable-module-interfaces
, though this is next to useless now because it applies across-the-board, even when library evolution is not enabled, yielding warnings about how library evolution is required for that flag to functionResult:
-enable-library-evolution
will also have a parseable module interface generated, which supports the intent of setting that flagrdar://78773077