hhvm / homebrew-hhvm

Official Mac OS X Homebrew formula for HHVM
MIT License
81 stars 22 forks source link

Installation failed with error "'libxml/parser.h' file not found" #60

Closed abirchall closed 8 years ago

abirchall commented 8 years ago

Description

Installation failed with error fatal error: 'libxml/parser.h' file not found

Note: I already had a look at #40; this seems like a distinct issue.

Output

...
[ 54%] Building CXX object hphp/runtime/CMakeFiles/hphp_runtime_static.dir/base/http-stream-wrapper.cpp.o
[ 54%] Building CXX object hphp/runtime/CMakeFiles/hphp_runtime_static.dir/base/ini-setting.cpp.o
[ 54%] Building CXX object hphp/runtime/CMakeFiles/hphp_runtime_static.dir/base/init-fini-node.cpp.o
[ 54%] Building CXX object hphp/runtime/CMakeFiles/hphp_runtime_static.dir/base/intercept.cpp.o
2 warnings generated.
[ 54%] Building CXX object hphp/runtime/CMakeFiles/hphp_runtime_static.dir/base/intl-convert.cpp.o
[ 54%] Building CXX object hphp/runtime/CMakeFiles/hphp_runtime_static.dir/base/libevent-http-client.cpp.o
[ 54%] Building CXX object hphp/runtime/CMakeFiles/hphp_runtime_static.dir/base/mem-file.cpp.o
[ 54%] Building CXX object hphp/runtime/CMakeFiles/hphp_runtime_static.dir/base/memory-manager.cpp.o
[ 54%] Building CXX object hphp/runtime/CMakeFiles/hphp_runtime_static.dir/base/mixed-array.cpp.o
[ 54%] Building CXX object hphp/runtime/CMakeFiles/hphp_runtime_static.dir/base/object-data.cpp.o
In file included from /tmp/hhvm-20161016-37855-1d27nm5/hhvm-3.15.1/hphp/runtime/base/object-data.cpp:32:
In file included from /tmp/hhvm-20161016-37855-1d27nm5/hhvm-3.15.1/hphp/runtime/ext/simplexml/ext_simplexml.h:22:
/tmp/hhvm-20161016-37855-1d27nm5/hhvm-3.15.1/hphp/runtime/ext/libxml/ext_libxml.h:23:10: fatal error: 'libxml/parser.h' file not found
#include <libxml/parser.h>
         ^
[ 54%] Building CXX object hphp/runtime/CMakeFiles/hphp_runtime_static.dir/base/output-file.cpp.o
[ 55%] Building CXX object hphp/runtime/CMakeFiles/hphp_runtime_static.dir/base/packed-array.cpp.o
[ 55%] Building CXX object hphp/runtime/CMakeFiles/hphp_runtime_static.dir/base/php-globals.cpp.o
1 error generated.
make[2]: *** [hphp/runtime/CMakeFiles/hphp_runtime_static.dir/base/object-data.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [hphp/runtime/CMakeFiles/hphp_runtime_static.dir/all] Error 2
make: *** [all] Error 2
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
==> Formula
Tap: hhvm/hhvm
Path: /usr/local/Homebrew/Library/Taps/hhvm/homebrew-hhvm/hhvm.rb
==> Configuration
HOMEBREW_VERSION: 1.0.7-74-g7ac9061
ORIGIN: https://github.com/Homebrew/brew
HEAD: 7ac90613fd5a9719a03e180947522bfd4a8790be
Last commit: 15 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 2dc00898ecd236b6b641dc5d27f5d2beb98babab
Core tap last commit: 15 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: octa-core 64-bit haswell
Homebrew Ruby: 2.0.0-p648
Clang: 8.0 build 800
Git: 2.8.0 => /opt/facebook/bin/git
Perl: /opt/local/bin/perl => /opt/local/bin/perl5.22
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 1.7.0_51
macOS: 10.12-x86_64
Xcode: 8.0
CLT: N/A
X11: N/A
MacPorts/Fink: /opt/local/bin/port
==> ENV
HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
SDKROOT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
MAKEFLAGS: -j8
CMAKE_PREFIX_PATH: /usr/local/opt/llvm:/usr/local/opt/boost160:/usr/local/opt/gettext:/usr/local/opt/icu4c:/usr/local/opt/openssl:/usr/local/opt/readline:/usr/local/opt/sqlite:/usr/local
CMAKE_INCLUDE_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/apache2:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
CMAKE_FRAMEWORK_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks
MACOSX_DEPLOYMENT_TARGET: 10.12
PKG_CONFIG_PATH: /usr/local/opt/libelf/lib/pkgconfig:/usr/local/opt/libpng/lib/pkgconfig:/usr/local/opt/freetype/lib/pkgconfig:/usr/local/opt/fontconfig/lib/pkgconfig:/usr/local/opt/libtiff/lib/pkgconfig:/usr/local/opt/webp/lib/pkgconfig:/usr/local/opt/gd/lib/pkgconfig:/usr/local/opt/glog/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/xz/lib/pkgconfig:/usr/local/opt/imagemagick/lib/pkgconfig:/usr/local/opt/jemalloc/lib/pkgconfig:/usr/local/opt/openssl/lib/pkgconfig:/usr/local/opt/libevent/lib/pkgconfig:/usr/local/opt/libmemcached/lib/pkgconfig:/usr/local/opt/libzip/lib/pkgconfig:/usr/local/opt/lz4/lib/pkgconfig:/usr/local/opt/oniguruma/lib/pkgconfig:/usr/local/opt/pcre/lib/pkgconfig:/usr/local/opt/sqlite/lib/pkgconfig
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.12
HOMEBREW_SDKROOT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
ACLOCAL_PATH: /usr/local/opt/gettext/share/aclocal:/usr/local/share/aclocal
PATH: /usr/local/Homebrew/Library/Homebrew/shims/super:/usr/local/opt/llvm/bin:/usr/local/opt/autoconf/bin:/usr/local/opt/automake/bin:/usr/local/opt/cmake/bin:/usr/local/opt/dwarfutils/bin:/usr/local/opt/gawk/bin:/usr/local/opt/libtool/bin:/usr/local/opt/md5sha1sum/bin:/usr/local/opt/ocaml/bin:/usr/local/opt/ocamlbuild/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libpng/bin:/usr/local/opt/freetype/bin:/usr/local/opt/fontconfig/bin:/usr/local/opt/jpeg/bin:/usr/local/opt/libtiff/bin:/usr/local/opt/webp/bin:/usr/local/opt/gd/bin:/usr/local/opt/gettext/bin:/usr/local/opt/gflags/bin:/usr/local/opt/icu4c/bin:/usr/local/opt/xz/bin:/usr/local/opt/imagemagick/bin:/usr/local/opt/jemalloc/bin:/usr/local/opt/openssl/bin:/usr/local/opt/libevent/bin:/usr/local/opt/memcached/bin:/usr/local/opt/libmemcached/bin:/usr/local/opt/libzip/bin:/usr/local/opt/lz4/bin:/usr/local/opt/mcrypt/bin:/usr/local/opt/oniguruma/bin:/usr/local/opt/pcre/bin:/usr/local/opt/sqlite/bin:/usr/bin:/bin:/usr/sbin:/sbin

Error: hhvm/hhvm/hhvm 3.15.1 did not build
Logs:
     /Users/abirchall/Library/Logs/Homebrew/hhvm/01.cmake
     /Users/abirchall/Library/Logs/Homebrew/hhvm/01.cmake.cc
     /Users/abirchall/Library/Logs/Homebrew/hhvm/02.make
     /Users/abirchall/Library/Logs/Homebrew/hhvm/02.make.cc
     /Users/abirchall/Library/Logs/Homebrew/hhvm/CMakeCache.txt

These open issues may also help:
brew install hhvm results in error 2 on os x el captain 10.11.6 https://github.com/hhvm/homebrew-hhvm/issues/59
brew install failure for hhvm 3.15.1, build target folly https://github.com/hhvm/homebrew-hhvm/issues/58

Notice that the CMAKE_INCLUDE_PATH includes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 This directory exists (as well as libxml/parser.h)

abirchall-mbp: ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2/libxml/parser.h
-rw-r--r--  7 root  wheel  39717 Aug  3 22:22 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2/libxml/parser.h

Note that I already have the developer tools installed

abirchall-mbp: xcode-select -p
/Applications/Xcode.app/Contents/Developer
abirchall-mbp: gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.38)
Target: x86_64-apple-darwin16.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I also tried installing libxml2 from brew on a whim but no luck

abirchall-mbp: brew install libxml2
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
gnumeric                                        goffice                                         gssdp                                           gupnp                                           gupnp-av

Warning: libxml2-2.9.4 already installed

Context and Logs

Parameter Value
OS X Version: 10.12 (updated to Sierra today to get past issue #50)
Homebrew Version: 1.0.7-74-g7ac9061 (updated today)
Xcode Version: 8.0 (8A218a)

Output of clang -v:

abirchall-mbp: clang -v
Apple LLVM version 8.0.0 (clang-800.0.38)
Target: x86_64-apple-darwin16.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Build logs: https://gist.github.com/1c76edc7b65f99e1f149c96bf9a26255

jwatzman commented 8 years ago

Notice that the CMAKE_INCLUDE_PATH includes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 This directory exists (as well as libxml/parser.h)

Due to issues with cmake automagically picking up the wrong libs, we have this code to defeat the default path detection, which IIRC makes CMAKE_INCLUDE_PATH irrelevant. We explicitly specify the location of libxml2 as in /usr/include.

Picking it up out of the xcode dir might be better, if you know how to do that in a safe and consistent way.

Note that I already have the developer tools installed

Have you done xcode-select --install recently? I believe you that the tools are installed, but there are bits of the CLI tools that seem to go missing from time to time (I don't really understand), and this libxml error is the usual symptom of that. You pointed out lots of details of the tools, and even mentioned #40, but never mentioned if you ran xcode-select --install as suggested there :)

I also tried installing libxml2 from brew on a whim but no luck

Yeah, this is irrelevant due to the above path trickery.

abirchall commented 8 years ago

Thanks for the fast reply!

xcode-select install performs a no-op since the tools are already installed:

abirchall-mbp: xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

What's even more bizarre is that the libxml2 headers exist under /usr/include:

abirchall-mbp: ls /usr/include/libxml2/libxml/parser.h
-rw-r--r--  1 root  wheel  39717 Aug  3 19:48 /usr/include/libxml2/libxml/parser.h

haha. I just tried rebuilding and it worked... I don't recall changing anything since I posed the original message though. How strange.