I just downloaded the new Xcode 12.5 RC1 build and I believe I've found a new regression.
If your project depends on a SPM package that uses Git LFS, Xcode will now fail to clone the package and your project's package resolution step will fail.
I've made a trivial repro case, available here:
https://github.com/mthole/XcodeAndSpmLfsIssue
In the above case, my package depends on another "dummy" package which has a screenshot stored in it via LFS. This works fine in Xcode 12.4 and in Xcode 12.5 beta 3, but fails in Xcode 12.5 RC1.
The error in Xcode 12.5 RC1:
Downloading Screen Shot 2021-04-22 at 11.04.55 AM.png (255 KB)
Error downloading object: Screen Shot 2021-04-22 at 11.04.55 AM.png (29c1070): Smudge error: Error downloading Screen Shot 2021-04-22 at 11.04.55 AM.png (29c10709f07bd2aad0aad6f65dab80b9bd8963c91ef5df6b00399b691a1cde09): error transferring "29c10709f07bd2aad0aad6f65dab80b9bd8963c91ef5df6b00399b691a1cde09": [0] remote missing object 29c10709f07bd2aad0aad6f65dab80b9bd8963c91ef5df6b00399b691a1cde09
Errors logged to /Users/mthole/Library/Developer/Xcode/DerivedData/XcodeAndSpmBugExample-fjigmzvqqryrzjajmyakiqsmwbdh/SourcePackages/checkouts/DummyPackageWithLFS/.git/lfs/logs/20210422T111110.295347.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: Screen Shot 2021-04-22 at 11.04.55 AM.png: smudge filter lfs failed
Post
Replies
Boosts
Views
Activity
I am working on rebuilding our large app's dependency graph to use Swift Package Manager, replacing CocoaPods. I have it nearly done and am quite happy with the progress so far. However, I've run into a blocker with Xcode's SwiftUI Previews not working, seemingly due to several .binaryTarget dependencies.
I've boiled this down to a simple reproducible case, with this Package.swift:
let package = Package(
name: "MyLibrary",
platforms: [.iOS(.v13)],
products: [.library(name: "MyLibrary", targets: ["MyLibrary"]),],
dependencies: [],
targets: [
.target(name: "MyLibrary", dependencies: ["NewRelic"]),
.binaryTarget(name: "NewRelic",
url: "https://download.newrelic.com/ios_agent/NewRelic_XCFramework_Agent_7.3.0.zip",
checksum: "daaaff7897246e4baddb1b8131a79268de3b6889a48182b4fbdabe5b926d08f4"),
]
)
Here I am using NewRelic as a common 3rd party dependency that vends an .xcframework.zip-- but this is not specific to NewRelic and can be reproduced with many (any?) similar examples.
This package builds a library successfully and works as expected when included in an app.
But when I try to use SwiftUI previews on a trivial view, e.g.:
struct MyLibraryView: View {
var body: some View {
VStack {
Text(verbatim: "Hello World, I'm MyLibraryView")
}
}
}
struct MyLibrary_Previews: PreviewProvider {
static var previews: some View {
return MyLibraryView()
}
}
I end up with this Unexpected duplicate tasks build failure, due to the build system seemingly trying to process the XCFramework twice:
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Using build description from memory
note: Using build description 'e8ea061fcc823688d24edc3f230a0c7c'
note: Build preparation complete
note: Target dependency graph (3 targets)
MyLibrary in MyLibrary
MyLibrary in MyLibrary, depends on:
MyLibrary in MyLibrary (explicit)
MyLibrary in MyLibrary, depends on:
MyLibrary in MyLibrary (explicit)
error: Unexpected duplicate tasks:
1) Command: ProcessXCFramework /Users/mthole/Library/Developer/Xcode/DerivedData/DuplicateTasksOnPreview-bkclfnyhkfofwaaulhpstpdjggqb/SourcePackages/artifacts/DuplicateTasksOnPreview/NewRelic.xcframework ios simulator
2) Command: ProcessXCFramework /Users/mthole/Library/Developer/Xcode/DerivedData/DuplicateTasksOnPreview-bkclfnyhkfofwaaulhpstpdjggqb/SourcePackages/artifacts/DuplicateTasksOnPreview/NewRelic.xcframework ios simulator
I've posted the reproduction case on GitHub here. Tested with Xcode 12.5 Beta 3.
https://github.com/mthole/DuplicateTasksOnPreview