-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Dependency Scanning] Perform cross-import overlay resolution per source-file #79550
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
@swift-ci test |
0442ccd
to
5afb81c
Compare
@swift-ci 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.
LGTM in general. Some coding style comments in line.
Also can cross-import introduce new dependencies?
5afb81c
to
9d26fba
Compare
They sure can, so we have |
@swift-ci test |
That is actually my question and thanks for the answer. |
9d26fba
to
6b2acd5
Compare
@swift-ci test |
6b2acd5
to
37c9ea1
Compare
@swift-ci test |
37c9ea1
to
037b7af
Compare
@swift-ci test |
…rce-file Previous implementation took the entire transitive dependency set and cross-referenced all of its members to determine which ones introduce requried cross-import overlays. That implementation differed from the cross-import overlay loading logic during source compilation, where a corrsponding cross-import overlay module is only requested if the two constituent modules are reachable via direct 'import's from *the same source file*. Meaning the dependency scanner before this change would report cross-import overlay dependencies which never got loaded by the corresponding client source compile. This change implements a new implementation of cross-import overlay discovery which first computes sub-graphs of module dependencies directly reachable by 'import's for each source file of the module under scan and then performs pairwise cross-import overlay query per each such sub-graph. Resolves rdar://145157171
037b7af
to
214fe59
Compare
@swift-ci test |
Does it mean that we end up brining in more cross-import overlays when rebuilding from one swiftinterface than when building the same module from many source files? |
That's a great question. I may have over-complicated my understanding of the actual algorithm used during source compilation for overlay discovery, based on what I see in compiler sources. I now think that we do not need to follow any dependency edges at all and only do detection of cross-import overlays amongst directly-imported modules. |
I had forgotten enabling the auto-merger for this PR even though I wanted to address the question above... |
Previous implementation took the entire transitive dependency set and cross-referenced all of its members to determine which ones introduce requried cross-import overlays. That implementation differed from the cross-import overlay loading logic during source compilation, where a corrsponding cross-import overlay module is only requested if the two constituent modules are reachable via direct 'import's from the same source file. Meaning the dependency scanner before this change would report cross-import overlay dependencies which never got loaded by the corresponding client source compile.
This change implements a new implementation of cross-import overlay discovery which first computes sub-graphs of module dependencies directly reachable by 'import's for each source file of the module under scan and then performs pairwise cross-import overlay query per each such sub-graph.
Resolves rdar://145157171