Skip to content

Share module cache between test projects #1403

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 3, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jun 2, 2024

This improves serial test execution time of eg. DocumentTestDiscoveryTests from 36s to 22s because we don’t need to re-build the XCTest module from its interface when using an open source toolchain.

This also uncovered that we weren‘t passing the build setup flags to the prepare command.

rdar://126493151

@ahoppen ahoppen requested review from bnbarham and hamishknight June 2, 2024 15:38
@ahoppen ahoppen requested a review from benlangmuir as a code owner June 2, 2024 15:38
@ahoppen
Copy link
Member Author

ahoppen commented Jun 3, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Jun 3, 2024

@swift-ci Please test macOS

destination: \(String(describing: self.destinationBuildParameters.configuration))
"""
)
logger.fault("Preparation is assuming that tools and destination to have the same build flags")
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate, but also this is going to be fairly spammy.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don’t expect this ever to be logged because we set the same build flags for the tools and destination build parameters here: https://github.com/apple/sourcekit-lsp/blob/b9c74387f297147d82716195974306384ca59c11/Sources/SKSwiftPMWorkspace/SwiftPMBuildSystem.swift#L245-L259

The intention of the log is that if that assumption is broken in the future, we’ll have a log message that’s pointing us to it.

This improves serial test execution time of eg. `DocumentTestDiscoveryTests` from 36s to 22s because we don’t need to re-build the XCTest module from its interface when using an open source toolchain.

This also uncovered that we weren‘t passing the build setup flags to the prepare command.

rdar://126493151
@ahoppen ahoppen force-pushed the share-test-module-cache branch from c92a045 to 259d49e Compare June 3, 2024 16:29
@ahoppen
Copy link
Member Author

ahoppen commented Jun 3, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Jun 3, 2024

@swift-ci Please test Windows

@ahoppen ahoppen enabled auto-merge June 3, 2024 18:24
@ahoppen ahoppen merged commit d806163 into swiftlang:main Jun 3, 2024
3 checks passed
@ahoppen ahoppen deleted the share-test-module-cache branch June 3, 2024 20:19
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.

3 participants