hhvm/homebrew-hhvm

Won't compile with error in LZ4

ptarjan opened this issue · 9 comments

Description

Build Failed

==> Downloading http://dl.hhvm.com/source/hhvm-3.21.0.tar.bz2
######################################################################## 100.0%
==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/hhvm/3.21.0 -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 -DCMAKE_ASM_COMPILER=/usr/local/opt/llvm/bin/clang -DENABLE_MCRO
==> make
Last 15 lines from /Users/pt/Library/Logs/Homebrew/hhvm/02.make:
#    define LZ4_DEPRECATED(message) [[deprecated(message)]]
                                    ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /tmp/hhvm-20170829-24164-1hdma8b/hhvm-3.21.0/hphp/runtime/ext/lz4/ext_lz4.cpp:21:
/usr/local/opt/lz4/include/lz4hc.h:205:12: error: an attribute list cannot appear here
LZ4LIB_API LZ4_DEPRECATED("use LZ4_compress_HC_extStateHC() instead") int LZ4_compressHC_withStateHC               (void* state, const char* source, char* dest, int inputSize);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/opt/lz4/include/lz4.h:423:37: note: expanded from macro 'LZ4_DEPRECATED'
#    define LZ4_DEPRECATED(message) [[deprecated(message)]]
                                    ^~~~~~~~~~~~~~~~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [hphp/runtime/ext/CMakeFiles/hphp_runtime_ext.dir/lz4/ext_lz4.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [hphp/runtime/ext/CMakeFiles/hphp_runtime_ext.dir/all] Error 2
make: *** [all] Error 2

Context and Logs

Parameter Value
OS X Version: 10.12.6
Homebrew Version: 1.3.1-138-g156bca7
Xcode Version:

Output of clang -v:

$ clang -v
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Build logs: Link to public gist created with brew gist-logs hhvm

Build logs: Link to public gist created with brew gist-logs hhvm

Can you include the full build logs -- brew gist-logs hhvm should generate a link you can attach here? The clipped bit at the end looks to me like "something confused the compiler very much and so it's spewing crap now". :)

I ran into the same issue. Here are the build logs. https://gist.github.com/anonymous/5ed47af189d4d7e74d7607dbf977e10c

Huh, that does appear to be the root error. I don't work extensively on HHVM anymore so someone who knows more will have to take a closer look, if lz4 was updated or whatever.

In file included from /tmp/hhvm-20170830-22769-1owhdb3/hhvm-3.21.0/hphp/runtime/ext/lz4/ext_lz4.cpp:20:
/usr/local/opt/lz4/include/lz4.h:437:12: error: an attribute list cannot appear here
LZ4LIB_API LZ4_DEPRECATED("use LZ4_compress_default() instead") int LZ4_compress               (const char* source, char* dest, int sourceSize);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/opt/lz4/include/lz4.h:423:37: note: expanded from macro 'LZ4_DEPRECATED'
#    define LZ4_DEPRECATED(message) [[deprecated(message)]]
                                    ^~~~~~~~~~~~~~~~~~~~~~~

Also not currently working on HHVM, but as a workaround, the docker images work nicely on Mac, including hh_client with bind-mounted directories.

Can confirm that brew did work fine on multiple machines with latest updates when 3.21.0 was released and doesn't now with no changes to the HHVM side of things, so it is an ecosystem change - LZ4 or clang most likely.

On a machine where I built 3.21, lz4/lz4@dab3590 is not present in /usr/local/opt/lz4/include/lz4.h

lz4/lz4@252ce14 is what we need, but it's not yet in any release.

I'll go use docker while I let it try to recompile (I lost my log file trying to recompile and CTRL+Cing). Then I'll upload the log file once its done.

Thanks @fredemmott and @jwatzman and 👋 friends!

We're not using the standard apple compiler because it didn't support thread_local; apparently this changed in XCode 8.

I'll try removing our compiler overrides when I get home; this might also solve the long-standing abort() problems

LZ4 is broken with Apple's clang too in C++ mode, and AFAICT homebrew won't let us pin to a specific release. Best option seems to be to wait for an update that includes that commit, hopefully 3.18.1

Testing this workaround:

$ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/ce19efc46713fa5ca58edc0c3d76793afc318113/Formula/lz4.rb
$ brew switch lz4 1.7.5