-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Dependency Scanning] Make dependency scanner cache specific to a given target triple. #39326
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
…`SwiftSource` These kinds of modules differ from `SwiftTextual` modules in that they do not have an interface and have source-files. It is cleaner to enforce this distinction with types, instead of checking for interface optionality everywhere.
@@ -49,6 +49,8 @@ typedef struct { | |||
} swiftscan_string_set_t; | |||
|
|||
typedef enum { | |||
// This dependency info encodes two ModuleDependencyKind types: |
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.
For now, preserve the format used by libSwiftScan. Once we teach the clients about the new dependency kind, we can then add it here.
Existing scanner tests ensure we do not regress on current functionality. |
@swift-ci please test |
Build failed |
36cfa49
to
0dadf60
Compare
@swift-ci please test |
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.
Having a separate dependency kind for source file seems reasonable to me. Only minor nitpicks.
…he current scanning action's target triple And only resolve cached dependencies that came from scanning actions with the same target triple. This change means that the `GlobalModuleDependenciesCache` must be configured with a specific target triple for every scannig action, and it will only resolve previously-found dependencies from previous scannig actions using the exact same triple. Furthermore, the `GlobalModuleDependenciesCache` separately tracks source-file-based module dependencies as those represent main Swift modules of previous scanning actions, and we must be able to resolve those regardless of the target triple. Resolves rdar://83105455
0dadf60
to
709676c
Compare
@swift-ci please test |
In order to do so, first refactor the dependency kinds to model the main modules of individual scanning actions as separate dependency kind:
SwiftSource
. These kinds of modules differ fromSwiftTextual
modules in that they do not have an interface and have source-files. It is cleaner to enforce this distinction with types, instead of checking for interface optionality everywhere, as we did prior to this change.Then, make
GlobalModuleDependenciesCache
aware of the current scanning action's target triple and only resolve cached dependencies that came from scanning actions with the same target triple.This change means that the
GlobalModuleDependenciesCache
must be configured with a specific target triple for every scanning action, and it will only resolve previously-found dependencies from previous scannig actions using the exact same triple only.Furthermore, the
GlobalModuleDependenciesCache
now separately tracks source-file-based module dependencies as those represent main Swift modules of previous scanning actions, and we must be able to resolve those regardless of the target triple.This change is largely required due to the introduction of the
-clang-target
optimization which means that the driver is no longer re-scanning Clang modules against different target sets in a given module's build graph.Resolves rdar://83105455