告诉自制程序永远不要从源代码构建

zzh*_*996 6 macos homebrew

在 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
Run Code Online (Sandbox Code Playgroud)

aj-*_*gas 5

较晚的答案,但在不从源代码构建的情况下使其失败的另一种方法是设置手册页HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK中解释的环境变量,例如。export HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK=1

我还没有测试过,因为我需要它后找到了解决方案。