OSX: Remove RPATHs from git-annex binary, which are not needed, slow down startup, and break the OSX Sierra linker.

ghc 8.0.2 may make this unncessary, but it's not in a stackage version yet,
so put in a workaround.

Note that the linux builds already delete the RPATHs for similar reasons.

This commit was sponsored by Josh Taylor on Patreon.
This commit is contained in:
Joey Hess 2016-11-07 14:21:30 -04:00
parent 2f15753cd3
commit c44ac268be
No known key found for this signature in database
GPG key ID: C910D9222512E3C7
3 changed files with 30 additions and 0 deletions

View file

@ -11,6 +11,8 @@ git-annex (6.20161032) UNRELEASED; urgency=medium
* Webapp: Don't list the Frankfurt region, as this (and some other new
regions) need V4 authorization which the aws library does not yet use.
* reinject --known: Avoid second, unncessary checksum of file.
* OSX: Remove RPATHs from git-annex binary, which are not needed,
slow down startup, and break the OSX Sierra linker.
-- Joey Hess <id@joeyh.name> Tue, 01 Nov 2016 14:02:06 -0400

View file

@ -181,6 +181,11 @@ OSXAPP_BASE=$(OSXAPP_DEST)/Contents/MacOS/bundle
osxapp: Build/Standalone Build/OSXMkLibs
$(MAKE) git-annex
# Remove all RPATHs, both because this overloads the linker on
# OSX Sierra, and to avoid the binary looking in someone's home
# directory.
eval install_name_tool $$(otool -l git-annex | grep "path " | sed 's/.*path /-delete_rpath /' | sed 's/ (.*//') git-annex
rm -rf "$(OSXAPP_DEST)" "$(OSXAPP_BASE)"
install -d tmp/build-dmg
cp -R standalone/osx/git-annex.app "$(OSXAPP_DEST)"

View file

@ -0,0 +1,23 @@
[[!comment format=mdwn
username="joey"
subject="""comment 1"""
date="2016-11-07T17:59:14Z"
content="""
`otool -l git-annex` shows hundreds of unnecessary RPATHs, removing
them should fix this.
One way would be to use `install_name_tool -delete_rpath` for each
of them.
It would be better to upgrade to a fixed ghc,
if it has fixed this RPATH mess. ghc 8.0.2 may fix it.
But the OSX autobuilder is using stack, and no stackage LTS or nightly
includes ghc 8.0.2 yet.
Ok, I've put in the `install_name_tool -delete_rpath` workaround
for the dmg build.
Bug reporter: Please see if
<https://downloads.kitenet.net/git-annex/autobuild/x86_64-apple-yosemite/git-annex.dmg>
has fixed the problem for you.
"""]]