xcodebuild -derivedDataPath isn't respected for custom Products and Intermediates locations

Originator:keithbsmiley
Number:rdar://38963511 Date Originated:28-Mar-2018 11:04
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 9.2 (9C40b)
Classification:UI/Usability Reproducible:Always
 
Summary:
If you override the derived data path in Xcode to be relative to the current directory, and then also set a custom build location for the Products and Intermediates directory. When you run `xcodebuild -scheme Foo -derivedDataPath bar` the custom products and intermediates directories are relative to the custom derived data directory, instead of the one passed on the command line

Steps to Reproduce:
1. Create a new iOS project in Xcode
2. In Xcode's Locations preferences set "Derived Data" to relative, and set the directory to localdata
3. Open the advanced settings. Choose "Custom" and "Relative to Derived Data" make sure Products and Intermediates are set
4. From the command line run `xcodebuild build -scheme YOUR_PROJECT -derivedDataPath fromcommandline

Expected Results:
The localdata directory isn't created, and nothing exists there. The fromcommandline directory contains all build artifacts.

Actual Results:
The localdata directory contains the Intermediates and the Products directories and artifacts. The fromcommandline directory only contains the logs and ModuleCache

Version:
Xcode 9.2 (9C40b)

Notes:
Attached are screenshots of my settings that cause this.

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!