为什么 Macports 需要花很长时间才能构建简单的软件包?
从 macports 之外的源代码进行构建是一件轻而易举的事。使用 macports 进行构建需要很长时间,并且似乎经常会冻结操作系统。这是典型的行为吗?虽然它对于 os x 来说似乎是一个不错的打包工具,但如果我在每次安装过程中每次都必须经历这种痛苦,我想我会不需要它。
Building from source outside of macports is a breeze. Building with macports takes forever and seems to freeze the os every so often. Is this typical behavior? Although it seems like a nice packaging tool for os x, if I have to go through this pain every time during every install I think I'll do without it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我不介意等待 Mac Ports 在最新的软件包上从源代码构建。但为什么不利用所有这些处理能力,并为用户提供一个选项,让构建自动上传回 MacPorts,或者更好地进行散列,并以点对点方式提供给可以选择“turbo”选项的其他 MacPorts 用户。
I don't mind waiting for Mac Ports to build from source on the latest packages. But why not harness all this processing power and offer users the option to let the build be automatically uploaded back to MacPorts or better still be hashed and offered peer-to-peer to other MacPorts users who can choose a 'turbo' option.
MacPorts 过去仅从源代码构建,与获取二进制文件的软件包系统相比,这可能会导致几个数量级的差异。
例如,考虑一个需要几个小时才能构建的大包的情况,并将其与将其下载为大小为几十 MB 的存档的时间进行比较。
MacPorts 使用 Apple 的工具进行构建,与在 MacPorts 之外获得的相同构建时间相比,它只增加了可以忽略不计的开销,包越大,差异越小。如果您在 MP 之外构建程序时遇到巨大差异,您应该在 问题跟踪器 上提交一份包含详细信息的票证。
也就是说,我发现这个问题已经很老了,因为 2.0 开始支持二进制存档 -cf。 变更日志 - 有一个 macosforge 支持的存储库,其中包含生成签名存档的构建机器人默认情况下是获取这些二进制存档而不是从源代码构建(您可以强制使用 -s 标志)。
当前的用户体验更类似于 apt-get 等二进制管理器,能够轻松更改配置和构建选项。
MacPorts used to only build from source and this can lead to a difference of several orders of magnitudo when compared to a package system that fetch binaries.
Consider as example the case of a somehow big package that takes few hours to be built and compare this to the time of downloading it as an archive having a size of a few tens of MBs.
MacPorts uses Apple's tools to build and it only adds a negligible overhead to the same build time that you would get outside of MacPorts, the bigger the package, the smaller the difference. If you experience a huge difference when building a program outside of MP you should file a ticket on the issue tracker with the details.
That said I see the question is quite old, since 2.0 there's support for binary archives -cf. Changelog- there's a macosforge supported repository with buildbots that produce signed archives and the default is to fetch these binary archives rather than building from source (that you can force using -s flag).
The current user experience is more similar to binary managers like apt-get, with the ability to change configure and build options quite easily.
如果您在 Intel Core 2 Duo 上运行,您可以通过更改位于此处的 Macports 配置选项来使构建速度加倍:
/opt/local/etc/macports/macports.conf
当我在重建后发现这一点时,我正在踢自己gcc ;)
此选项将允许您使用两个 cpu 来构建软件包。
If you are running on an Intel Core 2 Duo you can double the speed of your builds by changing the Macports config option located here:
/opt/local/etc/macports/macports.conf
I was kicking myself when I discovered this AFTER I rebuilt gcc ;)
This option will allow you to use both cpu's for building packages.
“冻结操作系统”?你能说得更具体一些吗?您试图在什么机器上的哪个版本的 OS X 上构建哪些软件包?
根据我的经验,MacPorts 通常可以在几乎所有支持的配置上正常工作,在我的例子中,从运行 10.4 版本的 256MB Pismo G3(2000 年)到最近运行 10.5 版本的双核 Intel iMac。不过,您必须要有耐心:这可能需要很长时间,尤其是在有大量依赖包的情况下,这是使用 MacPorts 或 Fink 等包管理器的缺点之一。好处是,与您自己从源代码安装单独的软件包相比,您通常拥有一个更受控制且经过测试的环境。而且,如果您还没有更新,请确保更新到最新的 MacPorts:1.8.0 刚刚发布,并进行了一些重要改进,包括更好地支持通用版本。
"freeze the os"? Can you be more specific? What packages were you trying to build on what version of OS X on what machine?
In my experience, MacPorts builds generally work correctly on almost any supported configuration, in my case ranging from a 256MB Pismo G3 (year 2000) running 10.4 up though a recent dual-core Intel iMac on 10.5. You have to be patient, though: it may take a long time especially if there are a lot of dependent packages, which is one of the drawbacks of using a package manager like MacPorts or Fink. The upside is that you generally have a much-more controlled and, one hopes, tested environment than if you installed individually packages from source yourself. And, if you haven't already, make sure you update to the latest MacPorts: 1.8.0 was just released and has some important improvements, including better support of universal builds.