-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix incremental builds for embedInCode
resources
#7616
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
Fix incremental builds for embedInCode
resources
#7616
Conversation
@swift-ci test |
@swift-ci test macOS |
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.
Thanks!
@swift-ci test macos |
@swift-ci test windows |
Please do cherry-pick this for 6.0 with the usual release branch PR description template 🙏 |
CI is broken until the next branch of apple/llvm-project merges llvm/llvm-project@fecf5c7 |
@swift-ci test macOS |
@swift-ci test Windows |
**Explanation**: Fix a build system hole that incremental build did not detect changes in embedded resources. **Scope**: Incremental build with `embedInCode` feature **Risk**: Low. **Testing**: Added a new test to cover the incremental build case. **Original PR**: #7616 **Reviewers**: @MaxDesiatov
SwiftPM's incremental build did not detect changes in embedded resources.
Motivation:
SwiftPM's
embedInCode
feature did not detect changes in the resource files and it led to using old resource contents even though they were modified.You can reproduce it with the fixture in this repository like below:
The first update ("update 1") is reflected in the final executable output because:
embedded_resources.swift
is generated while computing build descriptionsPackageStructure
build cacheHowever, the second update ("update 2") is not updated because we don't re-compute build descriptions in this stage, and the llbuild build system does not track embedding resource files.
Modifications:
Generate
embedded_resources.swift
during llbuild build step instead of during computing build descriptions.Result:
In this way, llbuild build system can correctly detect resource file modifications in any build iterations.