xcrun/lipo 在 OS X Mavericks 和 XCode 4.x 中冻结

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18667916/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 03:45:37  来源:igfitidea点击:

xcrun/lipo freezes with OS X Mavericks and XCode 4.x

pythonxcodepsycopg2osx-maverickslipo

提问by Sidwyn Koh

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。

回答by scztt

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 中使用 xcode-select 选择工具链的能力。

Pre- Mavericks and Xcode 5.x, /usr/bin/lipo seems to be the actuallocation of the actuallipo 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/lipois 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 工具的实际位置(尝试- 看起来像一个大二进制文件)。在 Mavericks / Xcode 5.x 中,lipo 被移动到 XcodeDefault.xctoolchain,并且二进制文件 at是一个看起来只是调用(参见)的薄包装器,它反过来根据 .xc找到 lipo 的位置。cat /usr/bin/lipo/usr/bin/lipoxcrun liponm /usr/bin/lipoxcode-select

Probably, new versions of xcode-selectand/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。如果您随后尝试将 lipo 与 4.x 工具链xcode-select'd 一起使用,它将不起作用,因为该工具不包含在旧版本的 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 在找不到工具时挂起的事实看起来像一个苹果错误,简单明了。

回答by avdyushin

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

回答by xfx

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

我遇到了同样的问题,通过用 Max OS 10.7 中的旧的替换 /usr/bin/lipo 来解决。

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.

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

回答by Max

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

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

回答by gtrmn

I restored /usr/bin/lipofrom my TimeMachinebackup (timestamp before updating to OSX 10.9). Then XCode4.x worked fine, archiving did not hang any more.

/usr/bin/lipo从我的TimeMachine备份中恢复(更新到 OSX 10.9 之前的时间戳)。然后XCode4.x 运行良好,归档不再挂起。