Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS Mojave 10.14: configure: error: header file <libxml/parser.h> is required for XML support #41

Open
madrobby opened this issue Jul 1, 2018 · 24 comments

Comments

@madrobby
Copy link

madrobby commented Jul 1, 2018

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/postgresql@10-10.4.tar.bz2
==> ./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.

@madrobby
Copy link
Author

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/postgresql@10-10.4.tar.bz2
==> ./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

@meeDamian
Copy link

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…

@petere
Copy link
Owner

petere commented Jul 28, 2018

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.

@meeDamian
Copy link

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 :/.

@petere
Copy link
Owner

petere commented Jul 29, 2018

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/.

@meeDamian
Copy link

$ 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 ^^.

@twogee
Copy link

twogee commented Sep 30, 2018

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.

@jasonmp85
Copy link
Contributor

FWIW I just modified my local recipes to depend on brew's Perl and I think it fixed it?

@twogee
Copy link

twogee commented Oct 16, 2018

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.

@sj26
Copy link

sj26 commented Nov 20, 2018

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/ 😞

@twogee
Copy link

twogee commented Nov 20, 2018

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...

@jsgillen1
Copy link

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.

@twogee
Copy link

twogee commented Jan 3, 2019

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

@haarg
Copy link

haarg commented Jan 4, 2019

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.

@twogee
Copy link

twogee commented Jan 4, 2019

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.

@haarg
Copy link

haarg commented Jan 4, 2019

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.

@akhst7
Copy link

akhst7 commented Jan 5, 2019

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

@twogee
Copy link

twogee commented Jan 5, 2019

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 😄.

@lyda
Copy link

lyda commented Feb 13, 2019

Are there environment vars that might solve this problem? Or maybe use the Homebrew install of perl?

@twogee
Copy link

twogee commented Feb 13, 2019

Perl is pretty rigid (or minimalistic 😄) with respect to placement of headers. See my comment in October regarding an extra distribution of Perl.

@jasonmp85
Copy link
Contributor

Are there environment vars that might solve this problem? Or maybe use the Homebrew install of perl?

Yeah, why not this…

@petere
Copy link
Owner

petere commented Feb 15, 2019

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.

@pmor
Copy link

pmor commented Mar 7, 2019

I had this issue (more specifically, the one in #44, missing perl.h) and fixed it with the solution from this comment #44 (comment)

Edit: While setting up a new mac, Xcode was not installed.

@buck3000
Copy link

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests