OpenSSL 1.1.1g build failure on Linux

Error:

==> perl Makefile.PL INSTALL_BASE=/opt/app/home/p712003/.linuxbrew/Cellar/openssl@1.1/1.1.1g/libexec
Last 15 lines from /home/p712003/.cache/Homebrew/Logs/openssl@1.1/01.perl:
2020-05-07 11:46:25 -0400

perl
Makefile.PL
INSTALL_BASE=/opt/app/home/p712003/.linuxbrew/Cellar/openssl@1.1/1.1.1g/libexec

Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /opt/app/home/p712003/.linuxbrew/Cellar/openssl@1.1/1.1.1g/libexec/lib/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 8.
BEGIN failed--compilation aborted at Makefile.PL line 8.

READ THIS: https://docs.brew.sh/Troubleshooting

Full gist logs are here: https://gist.github.com/gwerbin/2378e173cb01117474ad44a5fe945bc5

I don’t see an issue about it on the Github issue tracker. Is this a bug in Homebrew, or something wrong in my setup?

Consider installing Linuxbrew in /home/linuxbrew/.linuxbrew/ if possible so that you can use precompiled binary packages (known as bottles) for non-relocatable formula like openssl@1.1 .
Another possible workaround for you is brew install --force-bottle openssl@1.1, but no promises.

If it’s an option for you, you could open a ticket with your information systems department to ask that they create a linuxbrew role account with home directory /home/linuxbrew.

The precompiled binary bottles of non-relocatable bottles can only be used if you install in /home/linuxbrew/.linuxbrew, otherwise they have to be built from source. See the documentation below. On macOS the default installation directory is /usr/local. On Linux the default installation directory is /home/linuxbrew/.linuxbrew.

1 Like

Alternatively, run brew edit openssl@1.1 and add a line uses_from_macos "perl" => :build and brew install openssl@1.1

I don’t know if it helps, but I just installed openssl in a custom directory and it went fine.

==> Installing cmake dependency: openssl@1.1
==> Downloading https://www.openssl.org/source/openssl-1.1.1g.tar.gz
######################################################################## 100.0%
==> Downloading https://cpan.metacpan.org/authors/id/L/LE/LEONT/Test-Harness-3.42.tar.gz
######################################################################## 100.0%
==> perl Makefile.PL INSTALL_BASE=/cvmfs/brew/.homebrew/Cellar/openssl@1.1/1.1.1g/libexec
==> make PERL5LIB=/cvmfs/brew/.homebrew/Cellar/openssl@1.1/1.1.1g/libexec/lib/perl5 CC=gcc-7
==> make install
==> Downloading https://cpan.metacpan.org/authors/id/E/EX/EXODIST/Test-Simple-1.302175.tar.gz
######################################################################## 100.0%
==> perl Makefile.PL INSTALL_BASE=/cvmfs/brew/.homebrew/Cellar/openssl@1.1/1.1.1g/libexec
==> make PERL5LIB=/cvmfs/brew/.homebrew/Cellar/openssl@1.1/1.1.1g/libexec/lib/perl5 CC=gcc-7
==> make install
==> perl ./Configure --prefix=/cvmfs/brew/.homebrew/Cellar/openssl@1.1/1.1.1g --openssldir=/cvmfs/brew/.homebrew/etc/openssl@1.1 no-ssl3 no-ssl3-method no-zlib  enable-md2 linux-x86_64
==> make
==> make install MANDIR=/cvmfs/brew/.homebrew/Cellar/openssl@1.1/1.1.1g/share/man MANSUFFIX=ssl
==> make test
==> Downloading https://curl.haxx.se/ca/cacert-2020-01-01.pem
Already downloaded: /home/smosciat/.cache/Homebrew/downloads/e2b36a2c425753a7b9d6a8eccb44b33cb7ed93cb91f96dafcf35fa18d8e0513a--cacert-2020-01-01.pem
==> Downloading https://curl.haxx.se/ca/cacert-2020-01-01.pem
Already downloaded: /home/smosciat/.cache/Homebrew/downloads/e2b36a2c425753a7b9d6a8eccb44b33cb7ed93cb91f96dafcf35fa18d8e0513a--cacert-2020-01-01.pem
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /cvmfs/brew/.homebrew/etc/openssl@1.1/certs

and run
  /cvmfs/brew/.homebrew/opt/openssl@1.1/bin/c_rehash
==> Summary
🍺  /cvmfs/brew/.homebrew/Cellar/openssl@1.1/1.1.1g: 8,293 files, 23.1MB, built in 4 minutes 25 seconds

Thanks. I do not have the option to create a system-wide installation, nor does it make sense for my usage even if i had the option.

I will try editing the formula, but do you mind explaining what that additional directive changes? Has Homebrew made an incorrect assumption about what is available system-wide?

I made that change and encountered a circular dependency:

Error: openssl@1.1 contains a recursive dependency on itself:
  openssl@1.1 depends on berkeley-db
  berkeley-db depends on openssl@1.1
  openssl@1.1 depends on perl
  perl depends on openssl@1.1

Does Homebrew assume I have MakeMaker installed and available system-wide?

Evidently, yes. I believe Debian/Ubuntu includes this Perl package by default.

I see. It’d be nice if there was a more complete list of system-wide requirements like this.

Regardless, I installed it with --force-bottle and it seems to work fine.