-
Notifications
You must be signed in to change notification settings - Fork 199
Allow for non-external lookup of libSwiftScan symbols and centralize the scanning instance use in the driver. #1696
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 |
c8e7904
to
409725d
Compare
@swift-ci test |
409725d
to
2390926
Compare
@swift-ci test |
@swift-ci test Windows platform |
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.
@@ -209,10 +210,16 @@ public class InterModuleDependencyOracle { | |||
} | |||
} | |||
|
|||
private var hasScannerInstance: Bool { self.swiftScanLibInstance != nil } | |||
var hasScannerInstance: Bool { self.swiftScanLibInstance != nil } |
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.
Should this be true when you have the integrated version?
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.
Yes, because even in the integrated version the oracle technically does have an instance of SwiftScan
which is functional for using the API calls we expect it to have, in both cases. And this variable is only used for preconditions before relying on said APIs.
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.
documentation comment saying that please :)
2390926
to
b47a2db
Compare
@swift-ci test |
@swift-ci test Windows platform |
1 similar comment
@swift-ci test Windows platform |
b47a2db
to
7d3cd74
Compare
@swift-ci test |
@swift-ci test Windows platform |
1 similar comment
@swift-ci test Windows platform |
7d3cd74
to
943d96f
Compare
@swift-ci test Windows platform |
@swift-ci test |
@swift-ci test Windows platform |
…the scanning instance use in the driver. - The driver now holds a reference to the 'swiftScanLibInstance' which is shared with the 'interModuleDependencyOracle', but is also used for target info and supported compiler feature queries. This means a single SwiftScan instance is shared across all uses in a given driver instance. - Allow SwiftScan to be instantiated *without* a path to an external 'libSwiftScan.dylib', which will cause it to 'dlopen' with a NULL argument, and expect the scanner symbols to be found in the image that the driver code is a part of. This is useful for when compiler-based tooling (SourceKit) links the driver directly and uses its C API.
943d96f
to
c5a58e0
Compare
@swift-ci test |
@swift-ci test Windows platform |
I am seeing in https://ci.swift.org/job/swift-PR-Linux-smoke-test/15242/ this |
@@ -83,16 +83,17 @@ public class InterModuleDependencyOracle { | |||
} | |||
|
|||
/// Given a specified toolchain path, locate and instantiate an instance of the SwiftScan library | |||
public func verifyOrCreateScannerInstance(fileSystem: FileSystem, |
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.
In future, would be good to leave in a deprecated alias to allow time to adjust clients.
swiftScanLibInstance
which is shared with theinterModuleDependencyOracle
, but is also used for target info and supported compiler feature queries. This means a singleSwiftScan
instance is shared across all uses in a given driver instance.libSwiftScan.dylib
, which will cause it todlopen
with aNULL
argument, and expect the scanner symbols to be found in the image that the driver code is a part of. This is useful for when compiler-based tooling (SourceKit) links the driver directly and uses its C API.