Skip to content

[Dependency Scanning] Add ability for -scan-dependencies action to serialize and deserialize dependency scanner cache from a .moddepcache file. #37723

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

Merged
merged 1 commit into from
Jun 2, 2021

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Jun 1, 2021

Using the serialization format added in #37585.

  • Add load/save code for the -scan-dependencies code-path.
  • If a scanner is invoked on a main module already contained in the cache, ensure the scanner updates the dependencies, instead of asserting that they do not yet exist.
  • Add libSwiftDriver entry-points to load/store the cache of a given scanner instance or reset the cache to start scanning with a clean slate.

@artemcm artemcm requested a review from nkcsgexi June 1, 2021 21:33
@artemcm
Copy link
Contributor Author

artemcm commented Jun 1, 2021

@swift-ci please test

Copy link
Contributor

@nkcsgexi nkcsgexi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Could you add some documentation comments in the C API header about why using scanning cache cannot be an implementation detail of the compiler?

…serialize and deserialize dependency scanner cache from a `.moddepcache` file.

Using the serialization format added in swiftlang#37585.

- Add load/save code for the `-scan-dependencies` code-path.
- Add `libSwiftDriver` entry-points to load/store the cache of a given scanner instance.
@artemcm artemcm force-pushed the SaveReuseDependencyScannerCache branch from ca21e1d to 7e2c8e9 Compare June 1, 2021 21:46
@artemcm
Copy link
Contributor Author

artemcm commented Jun 1, 2021

@swift-ci please test

@artemcm
Copy link
Contributor Author

artemcm commented Jun 1, 2021

Thank you! Could you add some documentation comments in the C API header about why using scanning cache cannot be an implementation detail of the compiler?

Good idea. Done.

@artemcm artemcm merged commit 374e460 into swiftlang:main Jun 2, 2021
artemcm added a commit to artemcm/swift-driver that referenced this pull request Jun 3, 2021
…lization/deserialization

swiftlang/swift#37723 added API to libSwiftScan to save and restore the dependency scanner's state on the filesystem.
This PR adds this API to the corresponding client code in the driver.
artemcm added a commit to artemcm/swift-driver that referenced this pull request Jun 3, 2021
…lization/deserialization

swiftlang/swift#37723 added API to libSwiftScan to save and restore the dependency scanner's state on the filesystem.
This PR adds this API to the corresponding client code in the driver.
artemcm added a commit to artemcm/swift-driver that referenced this pull request Jun 3, 2021
…lization/deserialization

swiftlang/swift#37723 added API to libSwiftScan to save and restore the dependency scanner's state on the filesystem.
This PR adds this API to the corresponding client code in the driver.
artemcm added a commit to artemcm/swift-driver that referenced this pull request Jun 3, 2021
…lization/deserialization

swiftlang/swift#37723 added API to libSwiftScan to save and restore the dependency scanner's state on the filesystem.
This PR adds this API to the corresponding client code in the driver.
artemcm added a commit to artemcm/swift-driver that referenced this pull request Jul 30, 2021
…lization/deserialization

swiftlang/swift#37723 added API to libSwiftScan to save and restore the dependency scanner's state on the filesystem.
This PR adds this API to the corresponding client code in the driver.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants