XCBuild fails when trying to ditto `./File.dia`

Originator:keithbsmiley
Number:rdar://34873186 Date Originated:07-Oct-2017 13:16
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 9.0 (9A235)
Classification:Other Bug Reproducible:Sometimes
 
Summary:
When building with XCBuild after a fresh clean, I got some build failures where XCBuild was trying to ditto files using their path name prefixed with `./`. This resulted in a failure since the file didn't exist. Building again got past this failure.

Steps to Reproduce:
1. Remove the build directory for a project
2. Build

Expected Results:
The build succeeds

Actual Results:
The build failed immediately with this error:

```
ditto: /Users/ksmiley/dev/re-lyft-ng/build/Intermediates.noindex/Lyft.build/Debug-iphonesimulator/Models.build/Objects-normal/x86_64/./Place.dia: No such file or directory
note: /Users/ksmiley/dev/re-lyft-ng/build/Intermediates.noindex/Lyft.build/Debug-iphonesimulator/Models.build/Objects-normal/x86_64/./Place.dia: No such file or directoryCommand Ditto failed with a nonzero exit code
```

As you can see, it was looking for `x86_64/./Place.dia`. I confirmed that at the time `x86_64/Place.dia` did exist.

Version:
Version 9.0 (9A235)

Notes:
- Building again got past this error, but it failed on a few more targets with the same error
- Attached is the log

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!