rsync for frameworks does not copy symlinks #1063

ashtom opened this Issue May 23, 2013 · 11 comments

4 participants


The command


in does not copy all symlinks within the framework bundle. As a consequence, the folders Frameworks, Headers, Resources, and - in our case - the symlink to the binary HockeySDK is missing inside the framework in the .app bundle. This leads to this issue when the framework tries to open a resource.

I can work around the issue by adding the option --copy-links to the rsync command:


Is there a better solution for this? If not, I am happy to provide a pull request.

CocoaPods member

The copy resources script is a fragile solution because it is difficult to asses how it is used. Unfortunately until we don't implement the support for resources bundles we have to live with it. Is there any negative effect that you identified by the introduction of the --copy-links flag? If not I a pull request would be welcome (please don't forget to update the changelog).


The negative effect seems to be that Apple rejects those builds, see here. What's the reason the script uses rsync instead of cp?

CocoaPods member

With cp (as it used to be) the script sensibly affects the build time. Just to be sure, your issue was present in CocoaPods 0.19.1 as well, right?



~ pod --version

How about using cp for only the *.framework case?

CocoaPods member

@alloy It would be great to hear your input about this.

CocoaPods member

@irrationalfab For the time being (before we have all the funky resources v2 stuff), I agree with @ashtom.

CocoaPods member

Great! @ashtom are you interested in submitting a pull request? In case the line is this.

@ashtom ashtom added a commit to ashtom/CocoaPods that referenced this issue Jun 20, 2013
@ashtom ashtom Use cp instead of rsync to copy frameworks (refs #1063).
Add mkdir command to make sure the folder Contents/Frameworks exists (otherwise the first framework becomes this folder).
Change rsync command to cp to keep the file structure and all symbolic links.

@irrationalfab Pull request is here. I tested it with a sample OS X app and the pods for HockeySDK and DropboxSDK.

@fabiopelosin fabiopelosin added a commit that referenced this issue Jul 3, 2013
@fabiopelosin fabiopelosin Merge branch 'master' of into ash…

* 'master' of
  Use cp instead of rsync to copy frameworks (refs #1063).

After this change, I keep getting messages like this:

cannot overwrite directory /Users/nik/Library/Developer/Xcode/DerivedData/XXX-fblzblixtvaiirdhllllqolnnsbq/Build/Products/Debug/ with non-directory /Users/nik/src/XXX/Pods/Dropbox-OSX-SDK/dropbox-osx-sdk-1.3.5/DropboxOSX.framework/Versions/Current

Looks like cp does not want to overwrite the directory symlink. However, rsync -avr does and also preserves the symlinks. Is cp missing another flag? Otherwise I suggest going back to rsync.

CocoaPods member

@ashtom, @alloy any opinion about @nschum point?


I didn't see the error message that @schum is getting, but rsync -avr seems to work too. According to man rsync, the option -a matches -rlptgoD, so the additional parameter r is redundant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment