New Build System fails to build projects where multiple targets have same product name.

Originator:MichalKaluzny
Number:rdar://44641346 Date Originated:20-Sep-2018 05:04 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 10.0 (10A255)
Classification:Serious Bug Reproducible:Sometimes
 
Summary:
If a project contains several targets that produce a framework with same name, xcodebuild will randomly build a wrong target if it’s used as a dependency for currently built target.

Example:
Target “some_library” produces “some_library.framework”

Which depends on a one of (depending on the platform):

Target “dependency_mac” produces “dependency.framework”
Target “dependency_watch” produces “dependency.framework”

Executing command:

xcodebuild -project some_library.xcodeproj -scheme some_library -configuration Release -sdk watchos clean archive

Will randomly trigger either the “dependency_watch” or “dependency_mac” to be built and fail during the linking stage if the wrong one was selected.

Steps to Reproduce:
1) navigate to the provided workspace
2) xcodebuild -project some_library.xcodeproj -scheme some_library -configuration Release -sdk watchos clean archive

Expected Results:
An watchOS version of the some_library should build and link properly.

Actual Results:
Depending on what I assume is a fair roll of a dice, the target will build successfully or not.

Version:
Xcode 10.0 (10A255)

Notes:
I’ve been only able to reproduce this using xcodebuild command-line utility and not with full Xcode itself.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!