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

Ryan Schmidt ryandesign at macports.org
Mon Feb 19 22:18:03 UTC 2018


On Feb 19, 2018, at 13:37, Qianqian Fang wrote:

> 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

Nothing of Apple's (such as /Library/Developer/CommandLineTools/usr/libexec/git-core/git) should be referencing anything of MacPorts's (such as /opt/local/lib/libiconv.2.dylib). The only reason that might happen is if you set DYLD_LIBRARY_PATH. So don't set that.

> I can only fix this if I put /usr/lib in the front of DYLD_LIBRARY_PATH, but this breaks tons of other command.

You should not need to set DYLD_LIBRARY_PATH at all. Why do you think you need to?


> 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.

I agree that an old Xcode would not cause a patch failure, but note that macOS Sierra requires Xcode 8 or 9.


> 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.

The "Skipping" lines show us that this was not a clean attempt so no conclusions can be reached from it. "sudo port clean git" and try again.




More information about the macports-users mailing list