-
Notifications
You must be signed in to change notification settings - Fork 207
Rely on libSwiftScan
for dependency scanning actions.
#427
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 please test |
1 similar comment
@swift-ci please test |
So excited to see libSwiftScanner is used here to enhance build performance! Is it difficult to also preserve the old interaction form of JSON files? One benefit of that is we can get a peek inside the scanning process for debugging purposes. |
No, shouldn't be difficult. I'll add an option for this. |
@swift-ci please test |
a897537
to
58f2a89
Compare
@swift-ci please test |
@swift-ci please test |
58f2a89
to
ab7e09f
Compare
@swift-ci please test |
b9388b0
to
b2326f9
Compare
@swift-ci please test |
4 similar comments
@swift-ci please test |
@swift-ci please test |
@swift-ci please test |
@swift-ci please test |
@nkcsgexi ping |
… libSwiftScan, instead of launching `swift-frontend` processes and capturing their output. - Adds target `CSwiftScan` that contains the C header which captures all the required symbols from `libSwiftScan`. - Adds a `SwiftScan` subdirectory in the `SwiftDriver` target which contains code responsible for interactiosn with `libSwiftScan`. - A wrapper class (`SwiftScan`) taking care of initialization, shutdown, and dispatching dependency scanning queries to a library instance. - A collection of utilities (in `DependencyGraphBuilder.swift`) to translate dependency scanning query inputs into the C library expected format and translate the dependency scanning output into the format the driver understands (`InterModuleDependencyGraph`).
Using a persistent libSwiftScan instance across targets of the same build allows us to forego the notion of a placeholder module. Instead of communicating a placeholder module for some external target `C` to the scanner, the scanner will have previously scanned `C` because targets are planned in dependency order. This means the scanner will have an entry for module `C` as a module to be built from source-code. The driver needs to detect external targets and update the dependency graph to represent them as binary pre-built modules, instead of building them once again.
…input filenames with quotes.
The latter subsumes the former's purpose now.
…tion" This reverts commit 00678f3. Placeholder resolution needs to stick around while SwiftPM transitions to the new Oracle API.
…an result after decoding it.
…dency graph when generating PCMArg sets
… because it already does.
…able dependency scanner instead of using libSwiftScan
…ilelist creation.
And add an environment variable to overload the toolchain used to locate the swiftScan dylib
…constructing the `InterModuleDependencyGraph`
…e os-specific directory of the toolchain
To have more information for debugging when failing in one environment (e.g. CI) but not other.
…of dependencies is OS-version dependent.
…lve location of the scanning library.
7f7c0e3
to
c931c60
Compare
…pendency scanning queries if no instance of libSwiftScan is found.
@swift-ci please test |
🥳 |
This PR changes the dependency scanning action to rely on the newly-introduced
libSwiftScan
library, instead of making calls toswift-frontend -scan-dependencies
and parsing back their JSON output.CSwiftScan
that contains the C header which captures all the required symbols fromlibSwiftScan
.SwiftScan
subdirectory in theSwiftDriver
target which contains code responsible for interactiosn withlibSwiftScan
.SwiftScan
) which takes care of initialization, shutdown, and dispatching dependency scanning queries to a library instance.DependencyGraphBuilder.swift
) to translate dependency scanning query inputs into the C library expected format and translate the dependency scanning binary output format into the format the driver understands (InterModuleDependencyGraph
).Merging this is dependent on swiftlang/swift#34786 being merged and making it into a snapshot toolchain.
Additional cleanup will follow this once clients (SwiftPM) switch to the new API. For example, the notion of a placeholder module will go away completely so all of the placeholder resolution code will become unnecessary.