xctestrun generation time explodes when targets have their own CONFIGURATION_BUILD_DIR

Number:rdar://50790260 Date Originated:2019-05-14
Status:Open Resolved:
Product:Xcode Product Version:10.2
Classification:Performance Reproducible:Always
This is a regression in Xcode 10, from Xcode 9.
Verified by using `sample`, the amount of time spent in xctestrun specification generation increases exponentially in number of configuration build directories (In Xcode 9.4 it increased roughly linearly).

Steps to Reproduce:
Download the attached repo, run `./build-for-testing.sh`, and observe that the `xcodebuild` invocation takes ~5 minutes to finish after the last build step has completed. (This can be verified by inspecting the xcactivitylog, which shows that compilation finishes well before `xcodebuild` returns).

Expected Results:
`xcodebuild` should finish almost immediately after compilation has finished.

Actual Results:
`xcodebuild` spends a long time generating the xctestrun file.

Xcode 10.2

You can see the exponentiality by running the script at https://gist.github.com/segiddins/8c530d91f0617a0bc9bf3180e9e1759b.


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!