Fail to install git from macports ("can't find file to patch" error)

Qianqian Fang fangqq at gmail.com
Mon Feb 19 19:37:13 UTC 2018


hi everyone,

I don't know what was changed recently, the built-in git command from 
Xcode stopped working with the following error

    *|fangq at jinwy:~/space/git/Project/autobuild/mcx$ git pull|*|
    ||dyld: lazy symbol binding failed: Symbol not found: _iconv_open||
    ||  Referenced from:
    /Library/Developer/CommandLineTools/usr/libexec/git-core/git||
    ||  Expected in: /opt/local/lib/libiconv.2.dylib||
    ||
    ||dyld: Symbol not found: _iconv_open||
    ||  Referenced from:
    /Library/Developer/CommandLineTools/usr/libexec/git-core/git||
    ||  Expected in: /opt/local/lib/libiconv.2.dylib||
    ||
    ||error: fetch died of signal 6|

I can only fix this if I put /usr/lib in the front of DYLD_LIBRARY_PATH, 
but this breaks tons of other command. So, I decided to install a git 
from macports, however, this attempt failed with the following error:

    *|fangq at jinwy:~/space/git/Project/autobuild/mcx$ sudo port install
    git|*|
    ||Warning: xcodebuild exists but failed to execute||
    ||Warning: Xcode does not appear to be installed; most ports will
    likely fail to build.||
    ||--->  Computing dependencies for git||
    ||--->  Applying patches to git||
    ||Error: Failed to patch git: command execution failed||
    ||Error: See
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_git/git/main.log
    for details.||
    ||Error: Follow https://guide.macports.org/#project.tickets to
    report a bug.||
    ||Error: Processing of port git failed|

look at the main.log file, I found the error message attached at the end.

My macport version is 2.4.2, OS is Sierra, already ran port selfupdate.

I have an old version of xcode (7.3) in order to compile cuda code, but 
I don't think it was the issue.

can someone let me know how to fix this? alternative approaches, such as 
portable git binaries are also welcome, thanks a lot!

Qianqian



|:debug:main Executing org.macports.main (git)|||
|||:debug:main dropping privileges: euid changed to 502, egid changed to 
505.|||
|||:debug:main Skipping completed org.macports.archivefetch (git)|||
|||:debug:main Privilege de-escalation not attempted as not running as 
root.|||
|||:debug:main Skipping completed org.macports.fetch (git)|||
|||:debug:main Privilege de-escalation not attempted as not running as 
root.|||
|||:debug:main Skipping completed org.macports.checksum (git)|||
|||:debug:main Privilege de-escalation not attempted as not running as 
root.|||
|||:debug:main Skipping completed org.macports.extract (git)|||
|||:debug:main Privilege de-escalation not attempted as not running as 
root.|||
|||:debug:patch patch phase started at Mon Feb 19 14:27:42 EST 2018|||
|||:debug:patch Executing org.macports.patch (git)|||
|||:notice:patch --->  Applying patches to git|||
|||:info:patch --->  Applying patch-Makefile.diff|||
|||:debug:patch Environment: |||
|||:debug:patch CC_PRINT_OPTIONS='YES'|||
|||:debug:patch 
CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_git/git/work/.CC_PRINT_OPTIONS'|||
|||:debug:patch CPATH='/opt/local/include'|||
|||:debug:patch LIBRARY_PATH='/opt/local/lib'|||
|||:debug:patch MACOSX_DEPLOYMENT_TARGET='10.12'|||
|||:info:patch Executing:  cd 
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_git/git/work/git-2.16.2" 
&& /usr/bin/patch -p1 < 
'/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/git/files/patch-Makefile.diff'|||
|||:debug:patch system:  cd 
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_git/git/work/git-2.16.2" 
&& /usr/bin/patch -p1 < 
'/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/git/files/patch-Makefile.diff'|||
|||:info:patch can't find file to patch at input line 3|||
|||:info:patch Perhaps you used the wrong -p or --strip option?|||
|||:info:patch The text leading up to this was:|||
|||:info:patch --------------------------|||
|||:info:patch |--- a/Makefile.orig|||
|||:info:patch |+++ b/Makefile|||
|||:info:patch --------------------------|||
|||:info:patch File to patch: |||
|||:info:patch Skip this patch? [y] |||
|||:info:patch Skipping patch.|||
|||:info:patch 2 out of 2 hunks ignored|||
|||:info:patch Command failed:  cd 
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_git/git/work/git-2.16.2" 
&& /usr/bin/patch -p1 < 
'/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/git/files/patch-Makefile.diff'|||
|||:info:patch Exit code: 1|||
|||:error:patch Failed to patch git: command execution failed|||
|||:debug:patch Error code: CHILDSTATUS 81845 1|||
|||:debug:patch Backtrace: command execution failed|||
|||:debug:patch     while executing|||
|||:debug:patch "system {*}$notty {*}$nice $fullcmdstring"|||
|||:debug:patch     invoked from within|||
|||:debug:patch "command_exec patch "" "< '$patch'""|||
|||:debug:patch     (procedure "portpatch::patch_main" line 33)|||
|||:debug:patch     invoked from within|||
|||:debug:patch "$procedure $targetname"|||
|||:error:patch See 
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_git/git/main.log 
for details.|||
||

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20180219/c2b81936/attachment.html>


More information about the macports-users mailing list