Skip to content

Conversation

redsun82
Copy link
Contributor

Previously we were not extracting any swiftmodule file that was not
a system or a built-in one. This was done to avoid re-extracting
swiftmodule files that were built previously in the same build, but it
turned out to be too eager, as there are legitimate cases where a
non-system, non-built-in precompiled swift module can be used. An
example of that is the PackageDescription module used in Swift
Package Manager manifest files (Package.swift).

We now relax the test and trigger module extraction on all loaded
modules that do not have source files (we trigger source file extraction
for those). The catch, is that we also create empty trap files for
current output swiftmodule files (including possible alias locations
set up by XCode).

This means that if a following extractor run loads a previously built
swiftmodule file, although it will trigger module extraction, this
will however be skipped as it will find its target file already present
(this is done via the TargetFile semantics).

Previously we were not extracting any `swiftmodule` file that was not
a system or a built-in one. This was done to avoid re-extracting
`swiftmodule` files that were built previously in the same build, but it
turned out to be too eager, as there are legitimate cases where a
non-system, non-built-in precompiled swift module can be used. An
example of that is the `PackageDescription` module used in Swift
Package Manager manifest files (`Package.swift`).

We now relax the test and trigger module extraction on all loaded
modules that do not have source files (we trigger source file extraction
for those). The catch, is that we also create empty trap files for
current output `swiftmodule` files (including possible alias locations
set up by XCode).

This means that if a following extractor run loads a previously built
`swiftmodule` file, although it will trigger module extraction, this
will however be skipped as it will find its target file already present
(this is done via the `TargetFile` semantics).
redsun82 added 5 commits July 29, 2022 12:21
This should cover `-merge-modules` mode.

Dumping of the configuration to the target files was moved to a
separate pair of header/source files, as now it is also done in
`SwiftOutputRewrite.cpp`.
@redsun82 redsun82 merged commit 13f2cf9 into main Jul 29, 2022
@redsun82 redsun82 deleted the redsun82/swift-precompiled-modules-are-not-extracted branch July 29, 2022 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants