-
Notifications
You must be signed in to change notification settings - Fork 77
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
SwiftPM Build Tool Plugin excessively runs causing recompilation #305
Comments
We'll start investigating this with the swift-package-manager. |
Is there any update on this yet? We've seen re-build times go from seconds to well over 20 minutes due to what we suspect is this issue. |
The example project is an Xcode project. We only deal with command line SwiftPM issues on GitHub. Can you reproduce this issue with a SwiftPM package? |
Here's a sample showing the same behaviour in a Swift Package. Run
|
@dschaefer2 are you certain that this is an issue with SwiftPM, rather than Swift Build? It seems to affect both Xcode and SwiftPM. |
fwiw we're seeing our issue fixed in the latest xcode betas |
Yeah, with the latest Xcode betas I was unable to create a reproducer that I'm wondering if @dschaefer2 could direct where this issue would be best transferred to based on that, back to |
I'm going to pull this over to Swift Build as it looks like potentially an issue with incremental invalidation in the build engine and the issue is primarily describing package builds driven via Xcode. |
A couple of interesting things I've noticed after enabling EnableBuildBacktraceRecording: If I do not specify
Tracing that back up, the "Compile XCStrings" task for my target shows:
If I manually specify the resource in the sample project I specified earlier, ie: .target(
name: "ExcessiveBuildToolCompilation",
resources: [
.process("Resources/Localizable.xcstrings")
],
plugins: [
.plugin(name: "XCStringsToolPlugin", package: "xcstrings-tool-plugin")
]
) Then the backtrace shows:
Tracing that back up, I see a new state for any "Compile XCStrings" tasks:
Hopefully this information is helpful - here are the full result bundles: |
I use https://github.com/liamnichols/xcstrings-tool, this essentially takes in inputs of
*.xcstring
and outputs*.swift
.Unfortunately, this is having a large impact on incremental builds where for some reason the build tool plugin runs every time.
This invalidates already compiled SwiftPM targets leading to a large incremental compile time of >100 seconds in a project I work on.
This issue can be reproduced using https://github.com/liamnichols/xcstrings-tool-demo.
I also notice that the
CompileXCStrings
job runs on every incremental build as well.I've tested this using Xcode 16.2 and using Xcode 16.2 with latest main of swiftlang/swift-build at time of posting.
CC: @dschaefer2
Build DogTracker_2025-02-03T05-22-22.txt
Build DogTracker_2025-02-03T05-22-36.txt
The text was updated successfully, but these errors were encountered: