Skip to content

Expose BuildRecordInfo.computeHash #1922

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

Conversation

plemarquand
Copy link
Contributor

SwiftPM will compute a hash of the arguments passed to swift build, swift test, etc to determine if a full rebuild is necessary. Currently, it doesn't take in to account whether .doesNotAffectIncrementalBuild is set on swift compiler options and so any time any compiler option changes it will perform a full rebuild.

Expose the function that swift-driver uses to compute the argument hash which takes in to account .doesNotAffectIncrementalBuild so that SwiftPM can leverage it to reduce unnecessary rebuilds.

In order to keep BuildRecordInfo hidden behind _spi the function was moved out to the standalone BuildRecordArguments struct.

SwiftPM will compute a hash of the arguments passed to `swift build`,
`swift test`, etc to determine if a full rebuild is necessary.
Currently, it doesn't take in to account whether
`.doesNotAffectIncrementalBuild` is set on swift compiler options and so
any time any compiler option changes it will perform a full rebuild.

Expose the function that swift-driver uses to compute the argument hash
which takes in to account `.doesNotAffectIncrementalBuild` so that
SwiftPM can leverage it to reduce unnecessary rebuilds.

In order to keep `BuildRecordInfo` hidden behind `_spi` the function was
moved out to the standalone `BuildRecordArguments` struct.
@plemarquand
Copy link
Contributor Author

@swift-ci please test

@plemarquand plemarquand requested review from owenv and artemcm June 10, 2025 14:23
@plemarquand
Copy link
Contributor Author

@swift-ci please test windows

@plemarquand plemarquand merged commit d255ccb into swiftlang:main Jun 11, 2025
3 checks passed
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