有时brew install
在make test
步骤中需要很长时间(以小时为单位)。是否可以在跳过测试时安装公式?
我知道这是有风险的,但它可能有其用途。例如,您可能知道公式版本应该在您的系统中正常工作,并且不希望运行测试。或者您可能已经单独执行了测试,并且不希望在安装期间再次运行它们...
例如安装perl
:
$ brew install perl
==> Downloading https://www.cpan.org/src/5.0/perl-5.28.1.tar.gz
Already downloaded: /Users/$USER/Library/Caches/Homebrew/downloads/45e6e5b74854dc24d37224b5ad14fd66b3f9520235c1e1ff5b8decb20e22b755--perl-5.28.1.tar.gz
==> ./Configure -des -Dprefix=/usr/local/Cellar/perl/5.28.1 -Dprivlib=/usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1 -Dsitelib=/usr/local/Cellar/perl/5.28.1/lib/perl5/site_perl/5.28.1 -Dotherlibdirs=/usr/local/lib/perl5/site_perl/5.28.1 -
==> make
==> make test
查看进程,它在perl repo中迭代大多数*.t
文件。
\-+- 24088 $USER /Applications/Xcode.app/Contents/Developer/usr/bin/make test
\-+- 26674 $USER /bin/sh -e ./runtests choose
\-+- 26679 $USER ./perl TEST
\-+- 43493 $USER ./perl -I.. -MTestInit=U1 ../lib/warnings.t
\-+- 48110 $USER sh -c /private/tmp/perl-20190416-7230-1i4txcx/perl-5.28.1/perl -I../../lib "tmp43493C" </dev/null 2>&1
\--- 48111 $USER /private/tmp/perl-20190416-7230-1i4txcx/perl-5.28.1/perl -I../../lib tmp43493C
brew install
帮助没有提到有关跳过测试的任何内容。
$ brew install --help | grep test
--include-test Install testing dependencies required to
run brew test.
更新
我想我可以删除
system "make", "test"
来自perl(或任何公式)公式文件的line。
然后,我想我需要像下面这样调用brew:
HOMEBREW_NO_AUTO_UPDATE=1 brew install …
HOMEBREW_NO_AUTO_UPDATE docs:LINK
不。编写perl
公式的方式,make test
只是主要安装过程的一部分,并且没有选项可以将其关闭。
如果要将其关闭,您只需编辑公式或创建自己的自定义替代公式。