homebrew-postgresql
homebrew-postgresql copied to clipboard
macOS Mojave 10.14: configure: error: header file <libxml/parser.h> is required for XML support
On the current beta of macOS Mojave 10.14 (18A314k) I get this error:
$ brew install petere/postgresql/postgresql@10
==> Installing postgresql@10 from petere/postgresql
==> Downloading https://ftp.postgresql.org/pub/source/v10.4/postgresql-10.4.tar.bz2
Already downloaded: /Users/thomasfuchs/Library/Caches/Homebrew/[email protected]
==> ./configure --prefix=/usr/local/Cellar/postgresql@10/10.4 --enable-dtrace --enable-nls --with-bonjour --with-gssapi --with-i
Last 15 lines from /Users/thomasfuchs/Library/Logs/Homebrew/postgresql@10/01.configure:
checking gssapi/gssapi.h presence... yes
checking for gssapi/gssapi.h... yes
checking openssl/ssl.h usability... yes
checking openssl/ssl.h presence... yes
checking for openssl/ssl.h... yes
checking openssl/err.h usability... yes
checking openssl/err.h presence... yes
checking for openssl/err.h... yes
checking security/pam_appl.h usability... yes
checking security/pam_appl.h presence... yes
checking for security/pam_appl.h... yes
checking libxml/parser.h usability... no
checking libxml/parser.h presence... no
checking for libxml/parser.h... no
configure: error: header file <libxml/parser.h> is required for XML support
I do have libxml2 installed.
Update, on Beta 3, I get another error:
brew install petere/postgresql/postgresql@10
==> Installing postgresql@10 from petere/postgresql
==> Downloading https://ftp.postgresql.org/pub/source/v10.4/postgresql-10.4.tar.bz2
Already downloaded: /Users/thomasfuchs/Library/Caches/Homebrew/[email protected]
==> ./configure --prefix=/usr/local/Cellar/postgresql@10/10.4 --enable-dtrace --enable-nls --with-bonjour --wi
Last 15 lines from /Users/thomasfuchs/Library/Logs/Homebrew/postgresql@10/01.configure:
checking for library containing bind_textdomain_codeset... -lintl
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for msgfmt... /usr/local/opt/gettext/bin/msgfmt
checking for msgfmt flags... -c
checking for msgmerge... /usr/local/opt/gettext/bin/msgmerge
checking for xgettext... /usr/local/opt/gettext/bin/xgettext
checking for tclsh... /usr/local/opt/tcl-tk/bin/tclsh
checking for tclConfig.sh... /usr/local/Cellar/tcl-tk/8.6.8/lib/tclConfig.sh
checking tcl.h usability... yes
checking tcl.h presence... yes
checking for tcl.h... yes
checking for perl.h... no
configure: error: header file <perl.h> is required for Perl
The only temporary workaround for the error: header file <perl.h> is required for Perl issue I've found so far is to:
brew edit petere/postgresql/postgresql@10
Replace --with-perl line, with: --without-perl, and
brew install petere/postgresql/postgresql@10
Same works for @11 --devel.
Obv won't work if you rely on PLperlβ¦
Can you post the entire configure output and perhaps even config.log. Maybe the system Perl and libxml installations have changed in Mojave. Or perhaps a matching XCode update is needed.
I'm not sure what exactly are you asking for. My best guess being contents of ~/Library/Logs/Homebrew/postgresql@11, and that would be: https://gist.github.com/meeDamian/141ab9e517fa34a320fc28b4b128a97a - lmk if you need sth different instead.
I've found in some other thread that Mojave lacks some header files, and that installing this: /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg would help, unfortunately it doesn't seem to cut it for me :/.
So according to config.log, there is a perl.h, which includes EXTERN.h, which is missing. Take a look around /System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/ to see what's going on there. Maybe after the upgrade there is also a newer Perl version under /System/Library/Perl/.
$ ls -lha /System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/
total 4832
drwxr-xr-x 3 root wheel 96B Jul 22 08:31 .
drwxr-xr-x 56 root wheel 1.8K Jul 22 08:31 ..
-rwxr-xr-x 1 root wheel 2.4M Jul 13 17:53 libperl.dylib
$ tree -L 2 /System/Library/Perl/
/System/Library/Perl/
βββ 5.18
βΒ Β βββ AnyDBM_File.pm
βΒ Β βββ App
βΒ Β βββ Archive
βΒ Β βββ Attribute
βΒ Β βββ AutoLoader.pm
βΒ Β βββ AutoSplit.pm
βΒ Β βββ B
βΒ Β βββ Benchmark.pm
βΒ Β βββ CGI
βΒ Β βββ CGI.pm
βΒ Β βββ CORE.pod
βΒ Β βββ CPAN
βΒ Β βββ CPAN.pm
βΒ Β βββ CPANPLUS
βΒ Β βββ CPANPLUS.pm
βΒ Β βββ Carp
βΒ Β βββ Carp.pm
βΒ Β βββ Class
βΒ Β βββ Compress
βΒ Β βββ Config
βΒ Β βββ DB.pm
βΒ Β βββ DBM_Filter
βΒ Β βββ DBM_Filter.pm
βΒ Β βββ Devel
βΒ Β βββ Digest
βΒ Β βββ Digest.pm
βΒ Β βββ DirHandle.pm
βΒ Β βββ Dumpvalue.pm
βΒ Β βββ Encode
βΒ Β βββ English.pm
βΒ Β βββ Env.pm
βΒ Β βββ Exporter
βΒ Β βββ Exporter.pm
βΒ Β βββ ExtUtils
βΒ Β βββ Fatal.pm
βΒ Β βββ File
βΒ Β βββ FileCache.pm
βΒ Β βββ FileHandle.pm
βΒ Β βββ Filter
βΒ Β βββ FindBin.pm
βΒ Β βββ Getopt
βΒ Β βββ HTTP
βΒ Β βββ I18N
βΒ Β βββ IO
βΒ Β βββ IPC
βΒ Β βββ JSON
βΒ Β βββ Locale
βΒ Β βββ Log
βΒ Β βββ Math
βΒ Β βββ Memoize
βΒ Β βββ Memoize.pm
βΒ Β βββ Module
βΒ Β βββ NEXT.pm
βΒ Β βββ Net
βΒ Β βββ Object
βΒ Β βββ Package
βΒ Β βββ Params
βΒ Β βββ Parse
βΒ Β βββ Perl
βΒ Β βββ PerlIO
βΒ Β βββ PerlIO.pm
βΒ Β βββ Pod
βΒ Β βββ Safe.pm
βΒ Β βββ Search
βΒ Β βββ SelectSaver.pm
βΒ Β βββ SelfLoader.pm
βΒ Β βββ Symbol.pm
βΒ Β βββ TAP
βΒ Β βββ Term
βΒ Β βββ Test
βΒ Β βββ Test.pm
βΒ Β βββ Text
βΒ Β βββ Thread
βΒ Β βββ Thread.pm
βΒ Β βββ Tie
βΒ Β βββ Time
βΒ Β βββ UNIVERSAL.pm
βΒ Β βββ Unicode
βΒ Β βββ User
βΒ Β βββ XSLoader.pm
βΒ Β βββ _charnames.pm
βΒ Β βββ autodie
βΒ Β βββ autodie.pm
βΒ Β βββ autouse.pm
βΒ Β βββ base.pm
βΒ Β βββ bigint.pm
βΒ Β βββ bignum.pm
βΒ Β βββ bigrat.pm
βΒ Β βββ blib.pm
βΒ Β βββ bytes.pm
βΒ Β βββ bytes_heavy.pl
βΒ Β βββ charnames.pm
βΒ Β βββ constant.pm
βΒ Β βββ darwin-thread-multi-2level
βΒ Β βββ deprecate.pm
βΒ Β βββ diagnostics.pm
βΒ Β βββ dumpvar.pl
βΒ Β βββ encoding
βΒ Β βββ feature.pm
βΒ Β βββ fields.pm
βΒ Β βββ filetest.pm
βΒ Β βββ if.pm
βΒ Β βββ inc
βΒ Β βββ integer.pm
βΒ Β βββ less.pm
βΒ Β βββ locale.pm
βΒ Β βββ open.pm
βΒ Β βββ overload
βΒ Β βββ overload.pm
βΒ Β βββ overloading.pm
βΒ Β βββ parent.pm
βΒ Β βββ perl5db.pl
βΒ Β βββ perlfaq.pm
βΒ Β βββ pods
βΒ Β βββ sigtrap.pm
βΒ Β βββ sort.pm
βΒ Β βββ strict.pm
βΒ Β βββ subs.pm
βΒ Β βββ unicore
βΒ Β βββ utf8.pm
βΒ Β βββ utf8_heavy.pl
βΒ Β βββ vars.pm
βΒ Β βββ version
βΒ Β βββ version.pm
βΒ Β βββ version.pod
βΒ Β βββ vmsish.pm
βΒ Β βββ warnings
βΒ Β βββ warnings.pm
βββ Extras
βββ 5.18
60 directories, 71 files
# And this returns nothing:
$ tree /System/Library/Perl/ | grep -i EXTERN.h
I'm really not sure what's going on here, but I'm happy to provide any information that might be useful to you ^^.
The headers are in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/ on Mojave but that is not where Perl expects them to be.
FWIW I just modified my local recipes to depend on brew's Perl and I think it fixed it?
I see no need to have an extra Perl distribution, so unless 5.20+ is necessary for other reasons, I'd like to have this Mojave oddity addressed upstream in ExtUtils::MakeMaker.
Seems like an unstable location, too βΒ mine are in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/ π
I believe that Command Line Tools put them under /Library. The problem is though that Perl has many other modules apart from ExtUtils::MakeMaker that may need to take into account that Mojave oddity. I wish macOS could do union mounts with directories...
I just got it working by cd /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library rm -r Perl ln -s /System/Library/Perl then rerun the Xcode Command Line Tools installer. The headers end up in the correct places.
Thanks for the tip, I prefer
cd /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library
mv Perl Perl.off
ln -s /Library/Perl # (works as well)
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
rm Perl
mv Perl.off Perl
Apple patched ExtUtils::MakeMaker to work with their new header locations: https://opensource.apple.com/source/perl/perl-113.200.7/5.18/fix/perl_inc.diff.auto.html If ExtUtils::MakeMaker gets upgraded in some way, including if it got upgraded prior to upgrading to Mojave I believe, then it won't have this patch and won't be able to build many modules properly. We are looking in to how we want to address this in ExtUtils::MakeMaker and related tools.
In a stock install of Mojave, ExtUtils::MakeMaker and related modules will exist in /System/Library/Perl/5.18. If a newer version is installed, it will be placed in /Library/Perl/5.18 and take precedence over the version in /System.
For a general solution, all alternative modules for installing things must be considered, like Module::Build, ExtUtils::HasCompiler, Alien::Build. (I see ExtUtils::CBuilder has been patched.) And all "smart" modules that include their own versions of the above in their distributions or run an equivalent of configure.sh; they all look into Config, though, so the change must be reflected there.
Module::Build uses ExtUtils::CBuilder to do its compiles. I'm not sure about Alien::Build, but it wouldn't surprise me if Apple broke various other tools with this patch. They didn't communicate with anyone involved with perl when making the change, but we're reaching out to them to see if there's a better solution that can be used.
Twogee,
Could you explain what makes following commands different from just jsgillen1's ?
ln -s /Library/Perl # (works as well) open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
The second command starts an installer for headers only rather than the whole CLT. I was thinking about a symlink to /System/Library/Perl where the header files magically end up anyway, so the comment is redundant π.
Are there environment vars that might solve this problem? Or maybe use the Homebrew install of perl?
Perl is pretty rigid (or minimalistic π) with respect to placement of headers. See my comment in October regarding an extra distribution of Perl.
Are there environment vars that might solve this problem? Or maybe use the Homebrew install of perl?
Yeah, why not thisβ¦
I finally updated to Mojave to be able to look into this better, but everything builds fine for me. So I don't know what to do.
I had this issue (more specifically, the one in #44, missing perl.h) and fixed it with the solution from this comment https://github.com/petere/homebrew-postgresql/issues/44#issuecomment-451487767
Edit: While setting up a new mac, Xcode was not installed.
FWIW I just modified my local recipes to depend on brew's Perl and I think it fixed it?
This worked for me as well.
brew edit postgresql
Then I changed
uses_from_macos "perl"
to
depends_on "perl"