-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ModuleTrace] Track direct dependencies through #import and @_exported import #32738
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
[ModuleTrace] Track direct dependencies through #import and @_exported import #32738
Conversation
SPI PR separated out: #32771 (please ignore the first two commits here) |
594744a
to
d5fd536
Compare
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.
Sorry—I wrote a bunch of review comments a couple days ago, but it looks like I forgot to post them. You’ve made changes since, so I’m not sure how many are still applicable.
c11edfd
to
47a4d5a
Compare
47a4d5a
to
0e277e3
Compare
@swift-ci please smoke test |
@swift-ci please smoke test |
Interesting! We found a slightly different cycle on Windows:
What is going on here? 🤔🤔🤔 |
Trying to think about how we want to handle this properly... |
0e277e3
to
385b227
Compare
This comment has been minimized.
This comment has been minimized.
385b227
to
93d5c3a
Compare
Mostly just some cleanup/reorganization and more comments explaining why the different checks are necessary, removing a single one makes one or more of the tests fail. 😅 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Current status is DNM because there is an issue building llbuildSwift, noticed in #32980. Looking into it. |
93d5c3a
to
580903f
Compare
This comment has been minimized.
This comment has been minimized.
So one of the issues was with iterator invalidation. I'm still not entirely sure why that was happening (I would've expected a temporary to be created which lasts the duration of the loop) but creating a separate copy of the set seems to fix the issue. From what I can tell, the set itself was not being modified, because we do check for module equality and those checks were passing. |
580903f
to
cea2ab6
Compare
This comment has been minimized.
This comment has been minimized.
Source compat suite was passing with copying code in #32980, just re-running it with latest changes without the copy. I did check locally that llbuildSwift and SwiftPM built fine. |
cea2ab6
to
a869087
Compare
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Overlay-overlay dependencies are incorrectly marked indirect when the downstream overlay's underlying module imports the upstream overlay's underlying module but the downstream overlay does not explicitly import the upstream overlay.
a869087
to
8f5783b
Compare
Fixed |
This comment has been minimized.
This comment has been minimized.
We need to traverse the module dependency graph and track which modules expose which other modules' ABIs, while making sure that we don't hit a loop while trawling through Clang (sub)modules. Fixes rdar://64993153.
8f5783b
to
7e34fb0
Compare
Fixed |
@swift-ci please smoke 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.
It looks like you may have some unfinished business at a few points. Otherwise, I think this looks okay.
Going to merge this, since fixing rdar://64993153 is kinda' pressing. Will submit follow-up PRs for the TODOs. |
Still missing:
Some need to break up last commit into smaller commits.Seems difficult, a lot of things depend on each other.It's not clear that the depth-first traversal can be refactored out but maybe it's possible.This is fine. We can refactor later. There's also a bunch of special cases, don't want to block landing the fix on an elegant design.It might be possible to factor out some of the logic inSeems ok.getABIDependenciesForSwiftModule
.Just opening the PR to get initial feedback on whether the approach looks right.