xcrun / lipo与OS X Mavericks和XCode 4.x结合在一起

时间:2022-09-18 23:41:09

Been trying to install psycopg2 with either easy_install or pip, and the terminal gets stuck in a loop between xcrun and lipo.

一直试图用easy_install或pip安装psycopg2,终端卡在xcrun和lipo之间的循环中。

sidwyn$ sudo easy_install psycopg2
Searching for psycopg2
Reading https://pypi.python.org/simple/psycopg2/
Reading http://initd.org/psycopg/
Reading http://initd.org/projects/psycopg2
Best match: psycopg2 2.5.1
Downloading https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.5.1.tar.gz#md5=1b433f83d50d1bc61e09026e906d84c7
Processing psycopg2-2.5.1.tar.gz
Writing /tmp/easy_install-dTk7cd/psycopg2-2.5.1/setup.cfg
Running psycopg2-2.5.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-dTk7cd/psycopg2-2.5.1/egg-dist-tmp-4jaXas
clang: warning: argument unused during compilation: '-mno-fused-madd'

It bounces between xcrun and lipo and is stuck forever in this loop. Would appreciate some insights on this.

它在xcrun和lipo之间反弹,并永远停留在这个循环中。希望对此有一些见解。

I'm on OS X Mavericks 10.9, latest build.

我是OS X Mavericks 10.9,最新版本。

5 个解决方案

#1


50  

A more appropriate fix is:

更合适的解决方案是:

ln /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo
xcrun -k lipo

Why: xfx's fix will likely break being able to use xcode-select to choose your toolchain in future versions of Xcode.

原因:xfx的修复可能会破坏能够使用xcode-select在未来版本的Xcode中选择您的工具链。

Pre- Mavericks and Xcode 5.x, /usr/bin/lipo seems to be the actual location of the actual lipo tool (try cat /usr/bin/lipo - looks like a big binary). In Mavericks / Xcode 5.x, lipo was moved to XcodeDefault.xctoolchain, and the binary at /usr/bin/lipo is a thin wrapper that appears to just call xcrun lipo (see nm /usr/bin/lipo), which in turn finds the location of lipo based on xcode-select.

Pre-Mavericks和Xcode 5.x,/ usr / bin / lipo似乎是实际lipo工具的实际位置(试试cat / usr / bin / lipo - 看起来像一个大二进制文件)。在Mavericks / Xcode 5.x中,lipo被移动到XcodeDefault.xctoolchain,而/ usr / bin / lipo中的二进制文件是一个瘦的包装器,看起来只是调用xcrun lipo(参见nm / usr / bin / lipo),其中turn基于xcode-select找到lipo的位置。

Probably, new versions of xcode-select and/or Mavericks replace /usr/bin/lipo with the wrapper version. If you then try to use lipo with the 4.x toolchain xcode-select'd, it won't work, since the tool isn't contained in older versions of Xcode. Luckily, it's still included in iPhoneOS.platform for some reason, else you'd probably have to pull it from an uncorrupted <=10.8 machine.

可能是xcode-select和/或Mavericks的新版本用包装版本替换/ usr / bin / lipo。如果你然后尝试使用4.x工具链xcode-select'd的lipo,它将无法工作,因为该工具不包含在旧版本的Xcode中。幸运的是,由于某种原因,它仍然包含在iPhoneOS.platform中,否则你可能不得不从一台未损坏的<= 10.8机器中取出它。

It looks as if there was a lot of shuffling of tools between Developer/usr/bin and Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin in the 4->5 switch - it wouldn't surprise me if there were similar problems with other less-often-used command line tools as well.

看起来在4-> 5交换机中Developer / usr / bin和Developer / Toolchains / XcodeDefault.xctoolchain / usr / bin之间有很多工具混乱 - 如果出现类似问题,我不会感到惊讶其他不太常用的命令行工具。

Finally, the fact that xcrun hangs when it can't find a tool seems like an apple bug, plain and simple.

最后,当xcrun找不到工具时挂起的事实看起来像一个苹果bug,简单明了。

#2


12  

This one works for me:

这个对我有用:

xcode-select -–install
sudo mv /usr/bin/lipo /usr/bin/lipo.orig
sudo ln -s /Library/Developer/CommandLineTools/usr/bin/lipo /usr/bin

#3


3  

I got the same problem, fixed by replace the /usr/bin/lipo with an old one from Max OS 10.7.

我遇到了同样的问题,修复了将/ usr / bin / lipo替换为Max OS 10.7中的旧版本。

Update: replace /usr/bin/lipo with /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin will work. You need Xcode application or img file.

更新:用/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin替换/ usr / bin / lipo将起作用。你需要Xcode应用程序或img文件。

#4


3  

The simplest solution is probably upgrading to XCode 5.x.

最简单的解决方案可能是升级到XCode 5.x.

#5


0  

I restored /usr/bin/lipo from my TimeMachine backup (timestamp before updating to OSX 10.9). Then XCode 4.x worked fine, archiving did not hang any more.

我从TimeMachine备份(更新到OSX 10.9之前的时间戳)恢复了/ usr / bin / lipo。然后XCode 4.x工作正常,存档不再挂起。

#1


50  

A more appropriate fix is:

更合适的解决方案是:

ln /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo
xcrun -k lipo

Why: xfx's fix will likely break being able to use xcode-select to choose your toolchain in future versions of Xcode.

原因:xfx的修复可能会破坏能够使用xcode-select在未来版本的Xcode中选择您的工具链。

Pre- Mavericks and Xcode 5.x, /usr/bin/lipo seems to be the actual location of the actual lipo tool (try cat /usr/bin/lipo - looks like a big binary). In Mavericks / Xcode 5.x, lipo was moved to XcodeDefault.xctoolchain, and the binary at /usr/bin/lipo is a thin wrapper that appears to just call xcrun lipo (see nm /usr/bin/lipo), which in turn finds the location of lipo based on xcode-select.

Pre-Mavericks和Xcode 5.x,/ usr / bin / lipo似乎是实际lipo工具的实际位置(试试cat / usr / bin / lipo - 看起来像一个大二进制文件)。在Mavericks / Xcode 5.x中,lipo被移动到XcodeDefault.xctoolchain,而/ usr / bin / lipo中的二进制文件是一个瘦的包装器,看起来只是调用xcrun lipo(参见nm / usr / bin / lipo),其中turn基于xcode-select找到lipo的位置。

Probably, new versions of xcode-select and/or Mavericks replace /usr/bin/lipo with the wrapper version. If you then try to use lipo with the 4.x toolchain xcode-select'd, it won't work, since the tool isn't contained in older versions of Xcode. Luckily, it's still included in iPhoneOS.platform for some reason, else you'd probably have to pull it from an uncorrupted <=10.8 machine.

可能是xcode-select和/或Mavericks的新版本用包装版本替换/ usr / bin / lipo。如果你然后尝试使用4.x工具链xcode-select'd的lipo,它将无法工作,因为该工具不包含在旧版本的Xcode中。幸运的是,由于某种原因,它仍然包含在iPhoneOS.platform中,否则你可能不得不从一台未损坏的<= 10.8机器中取出它。

It looks as if there was a lot of shuffling of tools between Developer/usr/bin and Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin in the 4->5 switch - it wouldn't surprise me if there were similar problems with other less-often-used command line tools as well.

看起来在4-> 5交换机中Developer / usr / bin和Developer / Toolchains / XcodeDefault.xctoolchain / usr / bin之间有很多工具混乱 - 如果出现类似问题,我不会感到惊讶其他不太常用的命令行工具。

Finally, the fact that xcrun hangs when it can't find a tool seems like an apple bug, plain and simple.

最后,当xcrun找不到工具时挂起的事实看起来像一个苹果bug,简单明了。

#2


12  

This one works for me:

这个对我有用:

xcode-select -–install
sudo mv /usr/bin/lipo /usr/bin/lipo.orig
sudo ln -s /Library/Developer/CommandLineTools/usr/bin/lipo /usr/bin

#3


3  

I got the same problem, fixed by replace the /usr/bin/lipo with an old one from Max OS 10.7.

我遇到了同样的问题,修复了将/ usr / bin / lipo替换为Max OS 10.7中的旧版本。

Update: replace /usr/bin/lipo with /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin will work. You need Xcode application or img file.

更新:用/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin替换/ usr / bin / lipo将起作用。你需要Xcode应用程序或img文件。

#4


3  

The simplest solution is probably upgrading to XCode 5.x.

最简单的解决方案可能是升级到XCode 5.x.

#5


0  

I restored /usr/bin/lipo from my TimeMachine backup (timestamp before updating to OSX 10.9). Then XCode 4.x worked fine, archiving did not hang any more.

我从TimeMachine备份(更新到OSX 10.9之前的时间戳)恢复了/ usr / bin / lipo。然后XCode 4.x工作正常,存档不再挂起。