Can no longer build Hack stand alone
#7595 has caused running cmake . && make from inside hphp/hack to no longer work. Reverting 53e828ca693029d73d4f7903ca1d60e9481cd402 allows it to build again.
Scanning dependencies of target hack
/bin/sh: -ccopt: command not found
make[4]: *** [Makefile:196: _build/utils/get_build_id.gen.o] Error 127
make[3]: *** [Makefile:177: _build/hh_server.native] Error 2
make[2]: *** [CMakeFiles/hack.dir/build.make:57: CMakeFiles/hack] Error 2
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/hack.dir/all] Error 2
make: *** [Makefile:128: all] Error 2
Running cmake . && cd hphp/hack && make however does work.
I'm not sure that doing cmake . from within the hack folder was ever intended to work. When I revert 53e828c and try it I get:
$ cmake .
-- Found ocamlc: /usr/bin/ocamlc
-- Found ocamlc.opt: /usr/bin/ocamlc.opt
-- Could NOT find LZ4 (missing: LZ4_LIBRARY LZ4_INCLUDE_DIR)
-- Using third-party bundled LZ4
-- Configuring done
CMake Warning (dev) at CMakeLists.txt:93 (add_dependencies):
Policy CMP0046 is not set: Error on non-existent dependency in
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
The dependency target "lz4" of target "hack" does not exist.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:100 (add_dependencies):
Policy CMP0046 is not set: Error on non-existent dependency in
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
The dependency target "sqlite3" of target "hack" does not exist.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:94 (add_dependencies):
Policy CMP0046 is not set: Error on non-existent dependency in
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
The dependency target "lz4" of target "hack_test" does not exist.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:101 (add_dependencies):
Policy CMP0046 is not set: Error on non-existent dependency in
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
The dependency target "sqlite3" of target "hack_test" does not exist.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Generating done
-- Build files have been written to: /home/aorenste/hhvm-cmake/hphp/hack
(Note the missing dependencies of sqlite3 and lz4)
The problem is that moving into the hack subfolder and running that way skips all the initialization of the third-party directories.
Your second example (doing the cmake at the top-level and then running make within the hack directory) should be fine. You could also run cmake . && make hack from the top of the tree as well.
Support for building Hack without needing to be able to build HHVM was added by #7210. It's been working fine since then, and is especially important for OSX.
The missing dependencies don't stop Hack from being built.
@HRMsimon If you can please apply PR #7640 and let me know if that works for you.
@aorenste that fixes it :)