Interface builder adds custom RPATH to binary for IBDesignables

Originator:keithbsmiley
Number:rdar://30725266 Date Originated:26-Feb-2017 16:00
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 8.2.1
Classification:UI/Usability Reproducible:Always
 
Summary:
When you fire a build of your app in Interface Builder by clicking "Refresh All Views" the resulting binary is passed extra build flags that cause issues for some configurations.

In this case LD_RUNPATH_SEARCH_PATHS is set to more than what our project is configured to, which ends up in Interface Builder finding multiple frameworks, and picking one that has not been codesigned thus failing the designables refresh.

Steps to Reproduce:
1. Create a project that depends on one dynamic framework
2. Build the project by clicking "Refresh All Views" in IB
3. otool -l path/to/binary | grep -C 2 RPATH

Expected Results:
The RPATH of the binary should be set to only whatever is set in the project

Actual Results:
The RPATH contains `$(inherited) @loader_path/Frameworks $(BUILT_PRODUCTS_DIR)`

Version:
Xcode 8.2.1

Notes:
- This behavior is defined in `-[IBLiveViewsManager _additionalBuildSettingsForWorkspace:]`
- See https://github.com/CocoaPods/CocoaPods/issues/5678 for the side effects of this issue.
- I think that at the very least it would be ideal if users could have control over these flags in the case the defaults didn't work for their configuration.

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!