How to suppress or avoid Duplicate output file warning for Swift & Xcode

Viewed 63

I have two libraries that I have built with swift-collections (OrderedDictionary). When I include those two libraries into app, I get this warning:

warning build: duplicate output file '/Users/.../Library/Developer/Xcode/DerivedData/App-cwrrsvcoeaygnffemipxjzcyspgp/Build/Products/Debug/Frameworks/OrderedCollections_1222128174265B56_PackageProduct.framework/Versions/A/_CodeSignature' on task: CodeSign /Users/.../Library/Developer/Xcode/DerivedData/App-cwrrsvcoeaygnffemipxjzcyspgp/Build/Products/Debug/Frameworks/OrderedCollections_1222128174265B56_PackageProduct.framework/Versions/A

Is there a way to suppress this particular warning or better yet, a way of linking the files so that the duplication doesn't occur?

Update: I just looked at the build logs and my app isn't being built. I am using Xcode 14 beta 3 and its not showing the error in the issue navigator, just the warnings. So, I need a way to fix the duplication. The error in the logs is:

Multiple commands produce '/Users/.../Library/Developer/Xcode/DerivedData/App-cwrrsvcoeaygnffemipxjzcyspgp/Build/Products/Debug/Frameworks/OrderedCollections_1222128174265B56_PackageProduct.framework/Versions/A/OrderedCollections_1222128174265B56_PackageProduct'

Update 2: Trying to answer @sfgblackwarkrts I created a new workspace, into which I added two libraries and a command line tool that would call a method in each library. I create a dependency on swift-collections(OrderedCollections) for Library A and Library B.

Tool main.swift:

import Foundation
import Library_A
import Library_B

print("Hello, World!")

useA()
useB()

Library A mainA.swift

import Foundation
import OrderedCollections

public func useA() {
    let dictionary: OrderedDictionary<String,String> = [
        "a": "A",
        "b": "B"
    ]
    
    print("hello world from a: \(dictionary.count)")
}

Library B mainB.swift:

import Foundation
import OrderedCollections

public func useB() {
    let dictionary: OrderedDictionary<String,String> = [
        "a": "A",
        "b": "B"
    ]
    
    print("hello world from b: \(dictionary.count)")
}

Each library compiles, and Tool, when built, shows the above warnings in the issue navigator, but an error in the build log.

0 Answers
Related