Tell homebrew never build from source - macos

During package installation via homebrew on macOS, if my network is not stable and one download fails, homebrew will download the source and start building from source. This will take a long time and high CPU usage, which is unwanted. How can I tell homebrew retry or just stop when downloading fails?
==> 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

Late answer but another way to make it fail without building from source is setting the HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK environment variable explained in the man page, e.g. export HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK=1.
I haven't tested it yet, as I found the solution after I needed it.

You can brew fetch --retry <formula> to retry the fetching if it fails. Once the bottle is fetched, you can brew install it.
Combine both commands with:
brew fetch --retry <formula> && brew install <formula>

Related

Fakeroot on OSX Monterey

How can I install fakeroot on OSX Monterey
Using brew install fakeroot:
Warning: fakeroot has been deprecated because it does not build!
Error: fakeroot: no bottle available!
You can try to install from source with:
brew install --build-from-source fakeroot
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.
Using brew from sources brew install --build-from-source fakeroot:
Warning: fakeroot has been deprecated because it does not build!
==> Downloading https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=0001-Implement-openat-2-wrapper-which-handles-optional-ar.patch;att=1;bug=766649
Already downloaded: /Users/michal/Library/Caches/Homebrew/downloads/e6d4dac68230de33e16ff9c899395f60a9dfbc703a45dc4e6bbed7e39eba44eb--0001-Implement-openat-2-wrapper-which-handles-optional-ar.patch
==> Downloading https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=0002-OS-X-10.10-introduced-id_t-int-in-gs-etpriority.patch;att=2;bug=766649
Already downloaded: /Users/michal/Library/Caches/Homebrew/downloads/446b9b9c92c24195ef463099617d6e92a00027a69e8ba4478a8a01b7d28e372b--0002-OS-X-10.10-introduced-id_t-int-in-gs-etpriority.patch
==> Downloading https://deb.debian.org/debian/pool/main/f/fakeroot/fakeroot_1.24.orig.tar.gz
curl: (22) The requested URL returned error: 404
Error: fakeroot: Failed to download resource "fakeroot"
Download failed: https://deb.debian.org/debian/pool/main/f/fakeroot/fakeroot_1.24.orig.tar.gz
Using sudo port install fakeroot:
---> Computing dependencies for fakeroot
---> Fetching archive for fakeroot
---> Attempting to fetch fakeroot-1.24_0+universal.darwin_21.arm64-x86_64.tbz2 from https://packages.macports.org/fakeroot
---> Attempting to fetch fakeroot-1.24_0+universal.darwin_21.arm64-x86_64.tbz2 from https://fra.de.packages.macports.org/fakeroot
---> Attempting to fetch fakeroot-1.24_0+universal.darwin_21.arm64-x86_64.tbz2 from https://nue.de.packages.macports.org/fakeroot
---> Building fakeroot
Error: Failed to build fakeroot: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_fakeroot/fakeroot/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port fakeroot failed
Any other ideas?
Here I found working version (only old 1.19),
http://mackyle.github.io/fakeroot/
I've installed by pkg installer, and all seems to be working

Libtiff dependancy fails when installing wine with homebrew OSX 10.12.3

I am trying to install wine through homebrew. When its installing the dependancies, the libtiff fails because the source package url is not found and whole installer quits. I installed libtiff seperately and then tried, still this problem occurs. Any workaround ?
Rangarajans-MBP:homebrew-core ranga$ brew install wine
==> Installing dependencies for wine: libtiff, gd, libgphoto2, little-cms2, cmake, jasper, libicns, makedepend, openssl, net-snmp, sane-backends, libtasn1, gmp, nettle, libunistring, libffi, p11-kit, gnutls
==> Installing wine dependency: libtiff
==> Using the sandbox
==> Downloading http://download.osgeo.org/libtiff/tiff-4.0.7.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ocf.berkeley.edu/debian/pool/main/t/tiff/tiff_4.0.7-4.debian.tar.xz
curl: (22) The requested URL returned error: 404 Not Found
Trying a mirror...
==> Downloading https://mirrorservice.org/sites/ftp.debian.org/debian/pool/main/t/tiff/tiff_4.0.7-4.debian.tar.xz
curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "libtiff--patch"
Download failed: https://mirrorservice.org/sites/ftp.debian.org/debian/pool/main/t/tiff/tiff_4.0.7-4.debian.tar.xz
Rangarajans-MBP:homebrew-core ranga$
ftp.debian.org/debian/pool/main/t/tiff/tiff_4.0.7-4.debian.t‌​ar.xz has been superseded by ftp.debian.org/debian/pool/main/t/tiff/tiff_4.0.7-5.debian.t‌​ar.xz. If you compare the files, there's an extra CVE patch added.
To get homebrew to install wine, patch the libtiff formula to use the updated Debian package:
Open /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libtiff.rb
Patch the following lines so it looks like this: https://gist.github.com/georghendrik/c649b62c017c89980ec6fcad31513510
url "https://mirrors.ocf.berkeley.edu/debian/pool/main/t/tiff/tiff_4.0.7-5.debian.tar.xz"
sha256 "f4183c48ed74b6c3c3a74ff1f10f0cf972d3dba0f840cf28b5a3f3846ceb2be6"
"patches/16-CVE-2016-10094.patch", (note the comma)
"patches/17-CVE-2017-5225.patch"
Run brew install wine. Homebrew will update itself and stash your work.
Run cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/; git stash pop
Run brew install wine again.

Trouble installing Ruby (Failed to download resource "readline--patch")

I'm getting this error when I try to install Ruby. I've tried looking at this and this but to no avail
➜ ~ brew install ruby
Warning: You are using OS X 10.12.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.
==> Installing dependencies for ruby: readline, libyaml, makedepend
==> Installing ruby dependency: readline
==> Downloading https://ftpmirror.gnu.org/readline/readline-6.3.tar.gz
==> Downloading from http://mirror.team-cymru.org/gnu/readline/readline-6.3.tar.gz
######################################################################## 100.0%
==> Downloading https://gist.githubusercontent.com/jacknagel/d886531fb6623b60b2af/
curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "readline--patch"
Download failed: https://gist.githubusercontent.com/jacknagel/d886531fb6623b60b2af/raw/746fc543e56bc37a26ccf05d2946a45176b0894e/readline-6.3.8.diff
I've met the same problems when I installed Ruby on my Mac. Maybe you could try the following steps to solve this problem, it works for me :)
update your brew, paste /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" at a Terminal prompt. (or following instructions on brew homepage) Or just brew update
Run brew install ruby
Good luck to you! :)

Error: inreplace failed while installling with homebrew?

I would like to install treetagger in OS X. In order to make it easier I tried to search if this is possible with Homebrew. So I look at the web and found this formula from pepijnkokke user. Next, I tried to install treetagger as follows:
user#MacBook-Pro-User-2:~$ brew install /Users/user/Downloads/tree-tagger.rb
However, I got the following error:
==> Installing dependencies for tree-tagger: openssl, wget
==> Installing tree-tagger dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2g.el_capitan.
######################################################################## 100.0%
==> Pouring openssl-1.0.2g.el_capitan.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
This formula is keg-only, which means it was not symlinked into /usr/local.
Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
==> Summary
🍺 /usr/local/Cellar/openssl/1.0.2g: 1,678 files, 12.0M
==> Installing tree-tagger dependency: wget
==> Downloading https://homebrew.bintray.com/bottles/wget-1.17.1.el_capitan.bot
######################################################################## 100.0%
==> Pouring wget-1.17.1.el_capitan.bottle.1.tar.gz
🍺 /usr/local/Cellar/wget/1.17.1: 9 files, 1.5M
==> Installing tree-tagger
==> Downloading http://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/data/tr
######################################################################## 100.0%
Warning: SHA1 support is deprecated and will be removed in a future version.
Please switch this formula to SHA256.
Error: SHA1 mismatch
Expected: d823320b718eb41a5b4fef449a711307caaf0d88
Actual: 340e09912101acd996642eeed8f623315fa6d672
Archive: /Library/Caches/Homebrew/tree-tagger-3.2.tar.gz
To retry an incomplete download, remove the file above.
I removed the above file and the sha line (sha1 "d823320b718eb41a5b4fef449a711307caaf0d88") and tried again. Nevertheless I got this:
user#MacBook-Pro-de-User-2:~$ brew install /Users/user/Downloads/tree-tagger.rb==> Downloading http://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/data/tr
######################################################################## 100.0%
==> wget http://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/data/tagger-sc
==> wget http://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/data/english-p
==> wget http://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/data/english-c
==> wget http://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/data/install-t
==> chmod +x ./install-tagger.sh
==> ./install-tagger.sh
Error: inreplace failed
cmd/chunker-read-lemma.perl:
expected replacement of /BIN=.*/ with "BIN=/usr/local/Cellar/tree-tagger/3.2/libexec/bin"
expected replacement of /CMD=.*/ with "CMD=/usr/local/Cellar/tree-tagger/3.2/libexec/cmd"
expected replacement of /LIB=.*/ with "LIB=/usr/local/Cellar/tree-tagger/3.2/libexec/lib"
Any idea of how to install treetagger with homebrew?.
Have you tried installing openssl via homebrew?
brew install openssl
brew link openssl --force
brew install treehugger
Why don't you just install it the normal way as mentioned in the document?
The following steps are necessary to install the TreeTagger (see below for the Windows version). Download the files by right-clicking on the link. Then select "save file as". All files should be stored in the same directory.
Download the tagger package for your system (PC-Linux, Mac OS-X
(Intel-CPU), PC-Linux (version for older kernels)).
Download the tagging scripts into the same directory.
Download the installation script install-tagger.sh.
Download the parameter files for the languages you want to process.
Open a terminal window and run the installation script in the
directory where you have downloaded the files:
sh install-tagger.sh
Make a test, e.g. echo 'Hello world!' | cmd/tree-tagger-english
You might want to add ~/homebrew-compling/cmd and ~/homebrew-compling/bin to the PATH variable so that you do not need to specify the full path to run the tagging scripts.
This worked for me fine!

Failing while running `brew install

I am trying to re-install Nokogiri dependencies with homebrew following the steps described here. I had nokogiri working fine before, but had to remove macports to make some space on my mac.
Running into errors at the first step:
$ brew install libxml2 libxslt
Warning: Your Xcode (3.2.2) is outdated
Please install Xcode 3.2.6.
==> Downloading ftp://xmlsoft.org/libxml2/libxml2-2.8.0.tar.gz
Warning: Failed to create the file
Warning: /Library/Caches/Homebrew/libxml2-2.8.0.tar.gz
0.0%
curl: (23) Failed writing body (0 != 1448)
Error: Download failed: ftp://xmlsoft.org/libxml2/libxml2-2.8.0.tar.gz
Any idea how to fix this?
Is the warning about Xcode version significant?
The relevant message above seemed to be Warning: Failed to create the file.
Tried to create the /Library/Caches/Homebrew/libxml2-2.8.0.tar.gz file manually, and got a Permission denied error.
Changed the ownership of the folder to my username:group with
sudo chown <username>:<group> /Library/Caches/Homebrew/
With that change, the brew install step worked successfully!
Note: The answers to brew install mongodb error: Cowardly refusing to `sudo brew install' Mac OSX Lion helped in figuring out the problem.

Resources