brew install (or upgrade, reinstall) a single, official formula (not cask)? If it's a general brew problem please file this issue at Homebrew/brew: https://github.com/Homebrew/brew/issues/new/choose. If it's a brew cask problem please file this issue at https://github.com/Homebrew/homebrew-cask/issues/new/choose. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.brew update and can still reproduce the problem?brew doctor, fixed all issues and can still reproduce the problem?brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?$ brew install perl
$ brew install perl
==> Downloading https://www.cpan.org/src/5.0/perl-5.26.2.tar.xz
######################################################################## 100.0%
==> ./Configure -des -Dprefix=/marconi/home/userinternal/fficarel/.linuxbrew/Cellar/perl/5.26.2_1 -Dprivlib=/marconi/home/userinternal/fficarel/.linuxbrew/Cella
Last 15 lines from /marconi/home/userinternal/fficarel/.cache/Homebrew/Logs/perl/01.Configure:
#include <stdio.h>
int main() { printf("Ok\n"); return(0); }
I used the command:
cc -o try -O2 -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/marconi/home/userinternal/fficarel/.linuxbrew/include -fstack-protector-strong -L/usr/local/lib try.c -lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
./try
and I got the following output:
/marconi/home/userinternal/fficarel/.linuxbrew/bin/ld: cannot find -ldb
collect2: error: ld returned 1 exit status
I can't compile the test program.
You have a BIG problem. Shall I abort Configure [y]
Ok. Stopping Configure.
READ THIS: https://github.com/Linuxbrew/brew/wiki/troubleshooting
Please do not report this issue to Homebrew/brew or Homebrew/core, which support macOS only.
These open issues may also help:
Disable perl -Duserelocatableinc on Linux https://github.com/Linuxbrew/homebrew-core/pull/8081
To have perl correctly installed.
brew install commands)$ brew install perl
Build of perl formula fails during configure phase due to missing berkeley-db library (-ldb). Please note that if I try to install brewed berkeley-db to rely on that, it turns out that perl formula itself is pulled in via berkeley-db -> openssl -> perl, so it looks like libdb.{a,so} must be provided by the host system to break the dependency cycle.
Please find all the troubleshooting requested informations in the following gist:
https://gist.github.com/nazavode/99d898ddc6659bfe174a2cd6add4099c
In detail:
HOMEBREW_MAKE_JOBS=1 brew install -v perl 2>&101.Confgure and 01.Confgure.ccbrew --configbrew doctorHi. Thanks for reporting. I removed the berkeley-db dependency here: #8045
This was needed to fix the following problem:
berkeley-db depends on perl
perl depends on berkeley-db
berkeley-db depends on openssl
openssl depends on berkeley-db
The problem you see is that if you have berkeley-db installed on your system, brew will filter out the include paths and the compiler will not be able to find berkeley-db. We do not want to rely on system libraries if possible.
This was just a quick solution to get things working. Not sure how to fix this properly.
@sjackman may have an idea
Hi @iMichka , firstly thanks a lot for looking into this. I'm not a perl user (I was just trying to install git that in turn pulls in openssl and so on) but it looks like berkeley-db is listed among its optional dependencies, don't really know what would happen to perl functionalities without it.
I got the same problem too. Here is my workaround:
brew edit berkeley-db and comment out depends_on "openssl" (ex: https://github.com/Linuxbrew/homebrew-core/blob/master/Formula/berkeley-db.rb#L17)HOMEBREW_BUILD_FROM_SOURCE=1 brew install berkeley-dbbrew install perlbrew uninstall --ignore-dependencies berkeley-dbbrew install opensslbrew install berkeley-db # this will install the berkeley-db from bottlesMy guess is the
berkeley-dbis required to build the corresponding Perl module forberkeley-db. If a tool depends on that module, it may not work. We'll have to wait and see if that issue comes up. There's still thegdbmmodule, so some tools may be able to use either.
https://github.com/Linuxbrew/homebrew-core/pull/8045#issuecomment-398573859
I think that I am going to add berkeley-db back to perl. This should fix your problem.
The real fix needs to be done in openssl. We need to be able to drop the perl dependency from there, see for example: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=860254
I think I will try to vendor a minimal perl for openssl (similar to perl-base), and this should be good
openssl is always built from source, since openssl is not relocatable, and openssl is a common dependency. Having to build Perl from source to build OpenSSL will add to the build time of a package that already takes a while to build. Most systems have /usr/bin/perl. Can we use that when it's available, rather than re-building Perl?
perl is just there to run make test. We could also disable that ...
Firstly thanks everyone for the help on this blocker issue! If I can express my opinon on this as a linuxbrew user: I would personally prefer the solution @sjackman is proposing (I'm not aware of a distro that could be actually shipped without /usr/bin/perl, maybe alpine only), disabling tests on a component as critical as openssl would make me a bit uncomfortable :)
Let's try this then: #8122
Perl is a prerequisite for Linuxbrew (though not explicit). It is installed by build-essentials for example, which is required. On alpine there is no perl, there you will have to install it yourself.
@iMichka just tried with #8122 and it works like a charm 馃憤
Adding berkeley-db back to perl: #8123
Should be fixed now.
Tested #8123 too, works perfectly. Thank you so much!