hhvm / homebrew-hhvm

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

brew install failure for hhvm 3.15.1, build target folly #58

Closed claylo closed 7 years ago

claylo commented 8 years ago

Description

While upgrading to version hhvm 3.15.1, build target folly fails with:

Last 15 lines from /Users/clay/Library/Logs/Homebrew/hhvm/02.make:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libfolly.a(Environment.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libfolly.a(Fcntl.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libfolly.a(Malloc.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libfolly.a(Sockets.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libfolly.a(Stdio.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libfolly.a(Stdlib.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libfolly.a(SysFile.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libfolly.a(SysMman.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libfolly.a(SysResource.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libfolly.a(SysStat.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libfolly.a(SysTime.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libfolly.a(Time.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libfolly.a(Unistd.cpp.o) has no symbols
[ 24%] Built target folly
make: *** [all] Error 2

Context and Logs

Parameter Value
OS X Version: 10.11.6
Homebrew Version: 1.0.6
Xcode Version: 8.0

Output of clang -v:

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

Build logs: https://gist.github.com/db27eda334021ec66467722b9b7f0ef2

danslo commented 8 years ago

From that log, looks like this is the primary issue:

dyld: Symbol not found: _clock_gettime
  Referenced from: /private/tmp/hhvm-20161009-21725-1vfzt2i/hhvm-3.15.1/third-party/webscalesqlclient/mysql-5.6/extra/./comp_err
  Expected in: /usr/lib/libSystem.B.dylib

A quick google search leads me to believe it's a Sierra issue. Someone posted a workaround for Percona server here, which you could try.

mofarrell commented 8 years ago

I am still running LLVM 7.3. If you get it building please submit a pull request

ejc3 commented 8 years ago

I tried adding this to the hhvm.rb formula as indicated in the percona issue and an error occured at a different place:

In file included from /tmp/hhvm-20161010-60324-bhq20p/hhvm-3.15.1/hphp/runtime/vm/type-constraint.h:21: In file included from /tmp/hhvm-20161010-60324-bhq20p/hhvm-3.15.1/hphp/runtime/vm/named-entity.h:28: In file included from /tmp/hhvm-20161010-60324-bhq20p/hhvm-3.15.1/third-party/folly/folly/AtomicHashMap.h:93: In file included from /tmp/hhvm-20161010-60324-bhq20p/hhvm-3.15.1/third-party/folly/folly/AtomicHashArray.h:41: In file included from /tmp/hhvm-20161010-60324-bhq20p/hhvm-3.15.1/third-party/folly/folly/ThreadCachedInt.h:30: In file included from /tmp/hhvm-20161010-60324-bhq20p/hhvm-3.15.1/third-party/folly/folly/ThreadLocal.h:53: In file included from /tmp/hhvm-20161010-60324-bhq20p/hhvm-3.15.1/third-party/folly/folly/detail/ThreadLocalDetail.h:34: In file included from /tmp/hhvm-20161010-60324-bhq20p/hhvm-3.15.1/third-party/folly/folly/MicroSpinLock.h:50: In file included from /tmp/hhvm-20161010-60324-bhq20p/hhvm-3.15.1/third-party/folly/folly/detail/Sleeper.h:27: /tmp/hhvm-20161010-60324-bhq20p/hhvm-3.15.1/third-party/folly/folly/portability/Time.h:32:17: error: typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t') typedef uint8_t clockid_t; ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/time.h:171:3: note: previous definition is here } clockid_t; ^ ocamldep.opt -modules hh_server.ml > hh_server.ml.depends -- Looking for include file dlfcn.h - found -- Looking for include file execinfo.h

gavro commented 8 years ago

Tried the same as @ejc3 but I don't think that this is the same issue as "build target folly". It seems that macOS Sierra has changed something to make parts more POSIX compliant: It now has a clock_gettime function ...? See: https://github.com/Homebrew/homebrew-core/issues/1957

My logs can be found here:

Tried:

if MacOS.version == "10.11" && MacOS::Xcode.installed? && MacOS::Xcode.version >= "8.0"     
  cmake_args << "-DHAVE_CLOCK_GETTIME:INTERNAL=0"       
end
if MacOS.version == "10.12" && MacOS::Xcode.installed? && MacOS::Xcode.version >= "8.0"     
  cmake_args << "-DHAVE_CLOCK_GETTIME:INTERNAL=0"       
end

Brew config:

HOMEBREW_VERSION: 1.0.7
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 0546d90e3dbdae30407e5256d680be5ed5f5f000
Last commit: 31 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 307cc066d5c337ecc647e3108929aa08a7cd2686
Core tap last commit: 4 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 ivybridge
Homebrew Ruby: 2.0.0-p648
Clang: 8.0 build 800
Git: 2.10.1 => /usr/local/bin/git
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.12_1/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 1.8.0_51, 1.8.0_25
macOS: 10.12-x86_64
Xcode: 8.0
CLT: 8.0.0.0.1.1472435881
X11: 2.7.9 => /opt/X11
mofarrell commented 8 years ago

The issue is being fixed in folly, and we will update our dependency when it lands https://github.com/facebook/folly/pull/488

It looks like HHVM has the same issue as folly in https://github.com/facebook/hhvm/blob/master/hphp/runtime/vm/debug/perf-jitdump.cpp#L96

I will look to get a fix into HHVM for this issue. In the meantime a hack like https://github.com/Homebrew/homebrew-core/commit/6a5d45d2dd98dba7fa16528a3506cc588f10d2d4 (used to fix folly in homebrew) might do.

mofarrell commented 8 years ago

A new update. Even after fixing all the clock get time issues, jemalloc's brew formula is broken in 10.12 (https://github.com/Homebrew/homebrew-core/issues/1957#issuecomment-244268143)

Orvid commented 8 years ago

I've already fixed the Folly issues via https://github.com/facebook/folly/commit/a34e06a196443023c4b5fe2c18579996565e57f1, just waiting until Monday for the weekly tag to be created, then the upstream brew recipe for Folly can be fixed.

@jasone: I'm not entirely sure the state of jemalloc with brew on Sierra (https://github.com/Homebrew/homebrew-core/issues/1957 and https://github.com/jemalloc/jemalloc/issues/420 make it far from clear), perhaps you have a better idea of the current state?

mofarrell commented 8 years ago

The latest version should work on Sierra. If you are just upgrading, you may need to reinstall jemalloc and possibly other dependencies such that they will be compatible with Sierra as well. Some patching added in 525605e816379a25db77d428f45ae4ef28ab4b94 should be removed when new versions are release, and are compatible with Sierra.

gavro commented 8 years ago

@mofarrell thank you very much, works like a charm for me.

csdougliss commented 7 years ago

@mofarrell doesn't work for me. I have a clean install of OS X Sierra.

==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/hhvm/3.15.3 -DDEFAULT_CONFIG_DIR=/usr/local/etc/hhvm -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++ -DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang -DC
==> make
Last 15 lines from /Users/ccarnell/Library/Logs/Homebrew/hhvm/02.make:
/Library/Developer/CommandLineTools/usr/bin/libtool: file: /tmp/hhvm-20161205-34409-guafor/hhvm-3.15.3/third-party/webscalesqlclient/mysql-5.6/strings/libstrings.a(longlong2str.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/libtool: file: /tmp/hhvm-20161205-34409-guafor/hhvm-3.15.3/third-party/webscalesqlclient/mysql-5.6/vio/libvio.a(viopipe.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/libtool: file: /tmp/hhvm-20161205-34409-guafor/hhvm-3.15.3/third-party/webscalesqlclient/mysql-5.6/vio/libvio.a(vioshm.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/libtool: file: /tmp/hhvm-20161205-34409-guafor/hhvm-3.15.3/third-party/webscalesqlclient/mysql-5.6/mysys/libmysys.a(thr_mutex.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/libtool: file: /tmp/hhvm-20161205-34409-guafor/hhvm-3.15.3/third-party/webscalesqlclient/mysql-5.6/mysys/libmysys.a(my_getpagesize.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/libtool: file: /tmp/hhvm-20161205-34409-guafor/hhvm-3.15.3/third-party/webscalesqlclient/mysql-5.6/mysys/libmysys.a(my_lockmem.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/libtool: file: /tmp/hhvm-20161205-34409-guafor/hhvm-3.15.3/third-party/webscalesqlclient/mysql-5.6/mysys_ssl/libmysys_ssl.a(my_sha2.cc.o) has no symbols
[100%] Built target webscalesqlclient
Scanning dependencies of target symlink_libwebscalesqlclient_r.a
[100%] Generating libwebscalesqlclient_r.a
[100%] Built target symlink_libwebscalesqlclient_r.a
[  7%] No install step for 'webscalesqlclient'
[  7%] Completed 'webscalesqlclient'
[  7%] Built target webscalesqlclient
make: *** [all] Error 2
mofarrell commented 7 years ago

@craigcarnell I can't really do anything without a paste of the homebrew logs. Those last 15 lines of it don't contain the parts where it went wrong.

csdougliss commented 7 years ago

@mofarrell

https://gist.github.com/5d8befedda88554cf6f4cc6c2bba6521

clang -v

Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
mofarrell commented 7 years ago

@craigcarnell Your build error is unrelated to this issue. Ocaml just bumped the version they are distributing through their brew formula (5 days ago), and that breaks the hack build. Compatibility was actually fixed August 25th by this commit. The next hhvm release will fix this (and will hopefully be out soon). For the moment you might be able to grab an Ocaml 4.0.3 version and that would fix this.

The issue this thread addresses should be resolved at this point and is only open to remind us to remove the hacky fixes in the brew formula. This will be possible once the 10.11 with Xcode 8.0 combination becomes rare, and we have new versions of hhvm out.

robopuff commented 7 years ago

This problem still occurs, Full error log: https://gist.github.com/robopuff/6693eb1bd5f03a4d4a9ba58c0bdf6a11

mofarrell commented 7 years ago

@robopuff That is the same issue that @craigcarnell brought up. It is not the issue this thread is tracking. If you want open another issue go ahead, but that issue will be fixed with the next release as described above.

mofarrell commented 7 years ago

Patches are incorporated into the source.