Closed dfings closed 2 years ago
We currently use FindLibElf.cmake
and FindLibDwarf.cmake
which use a specified list of paths instead of using pkg-config. While there is a copyright notice, it only mentions the original author, not project, so I can't find a newer version or history to understand why pkg-config is not being used here - or if it would be safe to switch.
It would be good to use pkg-config if possible, but testing this on all supported platforms would be very time consuming (there are 22 libraries with a similar setup which may also give you problems if this is resolved) - and it's unlikely we'll be able to spare that time soon.
That said, these two libraries check the CPATH
and LIBRARY_PATH
variables for includes and libraries respectively; if set to the paths in your homebrew prefix, you may be able to build, if there are not other dependencies with similar problems that do not respect those paths. If successful, the build may take several hours (depending on your computer) and will need a lot of RAM - 8GB may be insufficient.
Is this issue fixed by https://github.com/facebook/hhvm/commit/1d99b206b8fc78184cc771129a02b3fdaa3fcc4e ?
Yep
It would be good to use pkg-config if possible, but testing this on all supported platforms would be very time consuming
Ended up having to do this
It is not really fixed according to my test
==> Installing hhvm/hhvm/hhvm-nightly
==> cmake -DCMAKE_INSTALL_SYSCONFDIR=/Users/atry/homebrew/etc -DDEFAULT_CONFIG_DIR=/Users/atry/homebrew/etc/hhvm -DSYSTEM_PCRE_HAS_JIT=0 -DENABLE_MCROUTER=OFF -DENABLE_EXTENSION_MCROUTER=OFF -DENABLE_EXTENSION_IMAP=OFF -DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock -DCMAKE_C_FL
Last 15 lines from /Users/atry/Library/Logs/Homebrew/hhvm-nightly/01.cmake:
-- Could NOT find LibElf (missing: LIBELF_INCLUDE_DIRS)
-- Performing Test ELF_GETSHDRSTRNDX
-- Performing Test ELF_GETSHDRSTRNDX - Failed
CMake Error at /Users/atry/homebrew/Cellar/cmake/3.22.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find LibDwarf (missing: LIBELF_FOUND)
Call Stack (most recent call first):
/Users/atry/homebrew/Cellar/cmake/3.22.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
CMake/FindLibDwarf.cmake:61 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMake/HPHPFindLibs.cmake:259 (find_package)
CMakeLists.txt:79 (include)
-- Configuring incomplete, errors occurred!
See also "/tmp/hhvm-nightly-20220202-9823-23ujv6/hhvm-nightly-2022.01.29/CMakeFiles/CMakeOutput.log".
See also "/tmp/hhvm-nightly-20220202-9823-23ujv6/hhvm-nightly-2022.01.29/CMakeFiles/CMakeError.log".
Do not report this issue to Homebrew/brew or Homebrew/core!
Have you installed libdwarf and libelf with brew? See https://docs.hhvm.com/hhvm/installation/building-from-source#installing-build-dependencies__homebrew
I think https://github.com/facebook/hhvm/commit/1d99b206b8fc78184cc771129a02b3fdaa3fcc4e did not change FindLibElf.cmake
. We need to apply similar approach to FindLibElf.cmake
Also, see https://docs.hhvm.com/hhvm/installation/building-from-source#building-hhvm__macos for extra variables that need setting.
Though, in general, hhvm's mac build is only tested with homebrew using it's default paths (as that is required for the binaries to be reusable)
Description
When trying to install hhvm, I get the following error:
This is on an install with a custom homebrew in my home directory (
/Users/dfingal/homebrew/
)Context and Logs
Output of clang -v:
Build logs: https://gist.github.com/dfings/90be449372fe6016f3b4fe67aaed1a2d