-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SymbolGraph] don't filter out symbols if their availability was for a platform-agnostic target #36367
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
Marking as draft until i get a test pushed. Feel free to look over the code diff in the meantime. |
83de87e
to
fe4984b
Compare
I had a conversation with @bitjammer about this PR. It turns out that last year (#30461), SymbolGraphGen was updated to deliberately filter out symbols which were unavailable on the current platform, with the assumption that symbol graphs were going to be generated per-target anyway, and they should have the view specific to that target. However, the way this filtering was done also caught symbols with platform-agnostic availability info in the crossfire, because the methods it used always loaded the active version, which in the case of SwiftPM was never set and defaulted to 0.0.0. I've reworked the PR, added a test, and removed the draft status. @swift-ci Please smoke test |
Linux CI reported a build error in LLDB. Trying again... @swift-ci Please smoke test Linux platform |
Looks like the LLDB issue was fixed in swiftlang/llvm-project#2660. Once more, with feeling... @swift-ci Please smoke test Linux platform |
The Linux builder failed while checking out LLVM:
The Windows builder failed in a concurrency test, too. Since there were some updates to that in the last couple days, i'm going to try to run a complete smoke test...
@swift-ci Please smoke test |
Looks like the Windows failures were disabled in #36398, and i reported the Mac failures as rdar://75317828 and i've been told that they were fixed as well. Time to try again: |
@swift-ci Please smoke test |
It looks like i hit a temporary outage in Jenkins when i requested the last test... @swift-ci Please clean smoke test and merge |
It looks like my test info is 404ing now? Not sure what's going on... @swift-ci Please smoke test |
Linux test failed on SwiftPM? @swift-ci Please smoke test Linux platform |
Resolves rdar://74670284
When filtering symbols from the symbol graph for being unavailable, the Symbol Graph AST Walker always filtered out a symbol if the availability checking mechanism returned something that matched an outdated version. However, this would always return information for platform-agnostic targets, like Swift-language or SwiftPM-specific availability info. In the case of SwiftPM, this was because
swift-symbolgraph-extract
never set up the SwiftPM version, so it defaulted to 0.0.0, and caused every version comparison to fail.This PR updates the AST Walker to only consider an availability attribute if it was for a platform-specific target, thus sparing Swift-language and SwiftPM availability from being filtered out.