philpennock / homebrew-protocols

UNMAINTAINED [was: Homebrew formulae for protocol things which interest me]
2 stars 5 forks source link

SSLeay.xs:140:20: fatal error: EXTERN.h: No such file or directory #4

Closed jinnko closed 4 years ago

jinnko commented 4 years ago

Fails to build on Ubuntu 18.04 with an up-to-date homebrew installation.

Before reaching this point I had to install a system package due to Can't locate Module/Build.pm in @INC. On Ubuntu libmodule-build-perl was the necessary package.

Readline fails to build in homebrew, hence the --without-readline in the following.

Not sure where EXTERN.h should come from to satisfy SSLeay.

 $ brew install sieve-connect --without-readline
==> Installing sieve-connect from philpennock/protocols
==> Downloading https://people.spodhuis.org/phil.pennock/software/sieve-connect-0.90.tar.bz2
Already downloaded: /home/jinn/.cache/Homebrew/downloads/07ac78264c19b94abbf8d1d9afbf3348c10eec888d304eb6dba6d8994a854234--sieve-connect-0.90.tar.bz2
==> Patching
patching file sieve-connect.pl
Hunk #1 succeeded at 70 (offset 15 lines).
==> Downloading https://www.cpan.org/authors/id/R/RS/RSIMOES/Mozilla-PublicSuffix-v1.0.0.tar.gz
Already downloaded: /home/jinn/.cache/Homebrew/downloads/8069306cd4db0c2f0b1aa73371d5299f3ed1ad17d7101836d0d76df3395854bc--Mozilla-PublicSuffix-v1.0.0.tar.gz
==> sh -c PERL_MM_USE_DEFAULT=t perl Build.PL --install_base=/home/linuxbrew/.linuxbrew/Cellar/sieve-connect/0.90/libexec
==> ./Build
==> ./Build test
==> ./Build install
==> Downloading https://www.cpan.org/authors/id/M/MI/MIKEM/Net-SSLeay-1.85.tar.gz
######################################################################## 100.0%
*** Found OpenSSL-1.1.1d installed in /home/linuxbrew/.linuxbrew/opt/openssl
*** That's newer than what this module was tested with
    You should consider checking if there is a newer release of this module
    available. Everything will probably work OK, though.
*** Be sure to use the same compiler and options to compile your OpenSSL, perl,
    and Net::SSLeay. Mixing and matching compilers is not supported.
Do you want to run external tests?
These tests *will* *fail* if you do not have network connectivity. [n] Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Net::SSLeay
Writing MYMETA.yml and MYMETA.json
==> make PERL5LIB=/home/linuxbrew/.linuxbrew/Cellar/sieve-connect/0.90/libexec/lib:/home/linuxbrew/.linuxbrew/Cellar/sieve-connect/0.90/libexec/lib/perl5
Last 15 lines from /home/jinn/.cache/Homebrew/Logs/sieve-connect/05.make:
  post_https.al, post_https3.al, post_https4.al, post_http.al, post_http3.al, post_http4.al, post_httpx.al, post_httpx3.al, post_httpx4.al truncate to post_htt
  put_https.al, put_https3.al, put_https4.al, put_http.al, put_http3.al, put_http4.al, put_httpx.al, put_httpx3.al, put_httpx4.al truncate to put_http
  ssl_read_all.al, ssl_read_until.al, ssl_read_CRLF.al truncate to ssl_read
  ssl_write_all.al, ssl_write_CRLF.al truncate to ssl_writ
  tcp_read_all.al, tcp_read_until.al, tcp_read_CRLF.al truncate to tcp_read
  tcp_write_all.al, tcp_write_CRLF.al truncate to tcp_writ
cp lib/Net/SSLeay.pod blib/lib/Net/SSLeay.pod
chmod 644 "SSLeay.bs"
"/usr/bin/perl" "-Iinc" -MExtUtils::Command::MM -e 'cp_nonempty' -- SSLeay.bs blib/arch/auto/Net/SSLeay/SSLeay.bs 644
mv SSLeay.xsc SSLeay.c
x86_64-linux-gnu-gcc -c  -I/home/linuxbrew/.linuxbrew/opt/openssl/include -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"1.85\" -DXS_VERSION=\"1.85\" -fPIC "-I/usr/lib/x86_64-linux-gnu/perl/5.26/CORE"   SSLeay.c
SSLeay.xs:140:20: fatal error: EXTERN.h: No such file or directory
compilation terminated.
Makefile:353: recipe for target 'SSLeay.o' failed
make: *** [SSLeay.o] Error 1

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/philpennock/homebrew-protocols/issues
philpennock commented 4 years ago

Confirmed, I can reproduce. I've only ever used this tap on macOS. I've tried, but I'm sorry: I'm now explicitly not supporting using this formula on Linux.

While sieve-connect is packaged for Debian/Ubuntu/various-others, on Ubuntu at least the package is old and doesn't have fixes for some regular expressions which Perl started (rightly) complaining about. You might need to apt-get build-dep sieve-connect and then manually install the package, or open tickets with the OS vendor to get them to update.


The docs in Linuxbrew.md state:

Linuxbrew does not use any libraries provided by your host system

It seems that Linuxbrew is deliberately masking out parts of the system tree? The complaint about EXTERN.h happens despite /usr/lib/x86_64-linux-gnu/perl/5.28/CORE/EXTERN.h existing, and that compilation step working if I use brew --debug and invoke it manually.

I get past that by depending upon a Brew-owned Perl. And apt install libz-dev, but then the libmodule-build-perl package is unused and the build breaks there. Suddenly I need to manually specify Module::Build as a dependency with URLs and checksums within my Formula? So I'm then responsible for auditing changes to core language support libraries?

Life is too short to be forced into taking on responsibility for auditing every part of the interpreter stack's core system libraries, with each update, to ship one CLI tool.