hhvm / homebrew-hhvm

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

Add an option to compile Hack TypeChecker only #45

Closed RaeesBhatti closed 7 years ago

RaeesBhatti commented 8 years ago

Description

Like many others, I only use Hack TypeChecker on Mac OS, the HHVM is usually in the container or remote. It would be nice to have an option in the Home-Brew formula to only build the Hack Typechecker (hh_client and hh_server utilities) without the HHVM part. That will save A LOT of build time for people don't need HHVM locally.

jwatzman commented 8 years ago

A prerequisite to this would likely be changes to the HHVM cmake configuration so that we don't need the huge list of HHVM-only dependencies.

Orvid commented 8 years ago

The hack section of the cmake build searches for its dependencies separately from HHVM.

jwatzman commented 8 years ago

Yes, but there is no mechanism to configure one without the other AFAIK, it's all tangled together. Or does CMake have some magic?

Orvid commented 8 years ago

Adding SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../CMake" ${CMAKE_MODULE_PATH}) before the find_package calls in hphp/hack/CMakeLists.txt and then just calling cmake . from hphp/hack/ should work just fine.

Orvid commented 8 years ago

Ideally it would be better to move the IF(HPHP_HOME) check out of the loop and use that as the base path for finding /CMake, but it's not required.

jwatzman commented 8 years ago

Ah, cool.

@raeesiqbal this isn't something I'm likely to have time to work on myself, but I'd be happy to review a PR to do it. (You'll need to update the CMake scripts in HHVM itself as above, then submit a change to the brew formula to take advantage of it.)

RaeesBhatti commented 8 years ago

I'm not familiar with Ruby and HomeBrew formulas, so, I tried a lot of things but could not make cmake inside the hphp/hack directory work. We can't just cmake HHVM first and then Hack because that will require a lot of packages to be present that Hack doesn't need. Here are my finding:

fredemmott commented 8 years ago

That referenced commit means this is now supported by hhvm itself, just not by brew. Would also like this so that when the hhvm build is broken by folly/clang/apple can hopefully keep using nuclide with local hh_client

fredemmott commented 7 years ago

For now, I'm wontfixing this, as we should have bottles up very shortly (#5)