Regression in deployment target settings passed to Run Script Build Phases invoking xcodebuild

Originator:amcknight2718
Number:rdar://24550875 Date Originated:2/8/16
Status:Closed as duplicate Resolved:
Product:Xcode Product Version:7.2.1
Classification:Regression Reproducible:Always
 
When invoking xcodebuild in a Run Script Build Phase, building against iphonesimulator or iphoneos, DEPLOYMENT_TARGET_SETTING_NAME, DEPLOYMENT_TARGET_CLANG_FLAG_NAME and DEPLOYMENT_TARGET_CLANG_ENV_NAME flip from iphoneos specific values to macosx values, even though "-sdk iphonesimulator" is specified in the xcodebuild invocation. This is a problem in our project setup, because we have a single target that builds for all platforms, with a deployment target version specified for each. Specifically, we support back to iOS 6.0 and OSX 10.7. When these settings flip, we have a conditionally compiled macro that causes a build error because there is no longer any value for the deployment target for the platform being built.

1. Unarchive the attached zipfile (https://www.dropbox.com/s/my9bpnp3nsmipkb/deployment-target-xcode7.2.zip?dl=0). This has an app target and an aggregate target. The aggregate target contains two Run Script Build Phases that build the app target using xcodebuild, one that is broken and one with a workaround.
2. Try building the aggregate target's scheme with the broken RSBP against an iphonesimulator target. It will fail. The build log will have printed the values for the deployment target settings in question, so you can see how they change.
3. Go to the aggregate target's build phases, and comment the contents of the RSBP titled "Invoke xcodebuild (broken version)" and uncomment the contents of "Invoke xcodebuild (bugfix in place)".
4. Build again. The build should now pass. The fix to the settings can be verified by inspecting the build log.

Comments

Marked as Duplicate 2/10/16


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!