告诉自制软件永远不要从源代码构建

Tell homebrew never build from source

在macOS上通过homebrew安装包时,如果我的网络不稳定,一次下载失败,homebrew会下载源码并从源码开始构建。这将花费很长时间并且 CPU 使用率很高,这是不需要的。下载失败时如何告诉自制程序重试或停止?

==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.27.1.mojave.bottle.tar.gz

curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to homebrew.bintray.com:443 
Error: Failed to download resource "sqlite"
Download failed: https://homebrew.bintray.com/bottles/sqlite-3.27.1.mojave.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading https://sqlite.org/2019/sqlite-autoconf-3270100.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/sqlite/3.27.1 --enable-dynamic-extensions --enable-readline --disable-editline
^C

如果失败,您可以brew fetch --retry <formula>重试抓取。取回瓶子后,您可以 brew install 它。

将两个命令合并为:

brew fetch --retry <formula> && brew install <formula>

迟到的答案,但另一种不从源代码构建而使其失败的方法是设置 man page 中解释的 HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK 环境变量,例如export HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK=1.

我还没有测试它,因为我在需要它之后找到了solution