macos 为什么 Macports 需要 FOREVER 来构建简单的包?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1352419/
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-10-21 06:22:14  来源:igfitidea点击:

Why does Macports take FOREVER to build simple packages?

macosinstallationmacports

提问by ennuikiller

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.

从 macports 之外的源代码构建是轻而易举的。使用 macports 构建需要很长时间,并且似乎每隔一段时间就会冻结操作系统。这是典型的行为吗?虽然它看起来是一个很好的 os x 打包工具,但如果我每次安装时都必须经历这种痛苦,我想我会没有它。

采纳答案by galaxywatcher

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:

如果您在 Intel Core 2 Duo 上运行,您可以通过更改位于此处的 Macports 配置选项来使构建速度加倍:

/opt/local/etc/macports/macports.conf

/opt/local/etc/macports/macports.conf

# Number of simultaneous make jobs (commands) to use when building ports
buildmakejobs       2

I was kicking myself when I discovered this AFTER I rebuilt gcc ;)

当我在重建 gcc 后发现这个时,我正在踢自己 ;)

This option will allow you to use both cpu's for building packages.

此选项将允许您使用两个 CPU 来构建软件包。

回答by Ned Deily

"freeze the os"? Can you be more specific? What packages were you trying to build on what version of OS X on what machine?

“冻结操作系统”?你可以说得更详细点吗?你试图在什么机器上什么版本的 OS X 上构建什么包?

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.

根据我的经验,MacPorts 构建通常可以在几乎所有支持的配置上正常工作,在我的情况下,从运行 10.4 的 256MB Pismo G3(2000 年)到最近的双核 Intel iMac 10.5。不过,您必须要有耐心:这可能需要很长时间,尤其是在有很多依赖包的情况下,这是使用 MacPorts 或 Fink 等包管理器的缺点之一。好处是,与您自己从源代码安装单独的软件包相比,您通常拥有一个更加可控且经过测试的环境。而且,如果您还没有,请确保您更新到最新的 MacPorts:1.8.0 刚刚发布并且有一些重要的改进,包括更好地支持通用构建。

回答by anddam

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 过去只从源代码构建,与获取二进制文件的包系统相比,这可能导致几个数量级的差异。以需要几个小时构建的某种大包为例,并将其与将其下载为具有几十 MB 大小的存档的时间进行比较。

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 trackerwith the details.

MacPorts 使用 Apple 的工具进行构建,它只会为您在 MacPorts 之外获得的相同构建时间增加可忽略不计的开销,包越大,差异越小。如果您在 MP 之外构建程序时遇到巨大差异,您应该在问题跟踪器上提交一张包含详细信息的票证。

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.

那就是说我看到这个问题很老了,因为 2.0 支持二进制档案 -cf。更改日志- 有一个 macosforge 支持的存储库,其中包含生成签名档案的构建机器人,默认情况下是获取这些二进制档案,而不是从源代码构建(您可以强制使用 -s 标志)。当前的用户体验更类似于 apt-get 等二进制管理器,能够非常轻松地更改配置和构建选项。

回答by diceman

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.

我不介意等待 Mac Ports 在最新的软件包上从源代码构建。但是为什么不利用所有这些处理能力,并为用户提供让构建自动上传回 MacPorts 的选项,或者更好的是仍然散列并提供给其他 MacPorts 用户的点对点,他们可以选择“turbo”选项。