Hhvm: Build specific version from source?

Created on 24 Jan 2017  路  7Comments  路  Source: facebook/hhvm

Hi everybody,

How I can build hhvm specific version from source?
I want to build version 3.17,

I did these steps:

git clone https://github.com/facebook/hhvm -b master  hhvm  --recursive
git checkout tags/HHVM-3.17.1
cmake3 .

But failed with this error:

Generating Release build
-- Found ocamlc: /tmp/hhvm/third-party/ocaml/build/bin/ocamlc.opt
CMake Error at CMake/FindOCaml.cmake:18 (message):
  OCaml version is too old to build the Hack typechecker, need at least 4.01.
  Directions at
  https://github.com/facebook/hhvm/wiki/Building-and-Installing-HHVM may have
  instructions how to get a newer version for your distro.
Call Stack (most recent call first):
  hphp/hack/CMakeLists.txt:5 (find_package)
build

Most helpful comment

@ahmadazimi after checking out another git commit (or tag) you need to update the submodules as well. A safe way to get a working build from another git ID is:

git clean -dfx #clean up old build
rm -rf third-party #remove old submodules
git checkout <commit/tag> #change to new commit/tag
git submodule update --init --recursive #get submodules (for the new commit/tag)
cmake .
make -j$(nproc)

All 7 comments

@ahmadazimi make sure you install the necessary dependencies, and initialize the submodules. You can follow the instructions here, just remember to add checkout the tag or branch like you did.

I am going to close this, as it is not technically a bug. If you have additional questions, or believe you have identified a problem. You can follow up with comments on this issue, or open a new issue.

@mofarrell Thanks for your response.

make sure you install the necessary dependencies and initialize the submodules

I've install all dependencies and also initialized all submodules correctly. When I build it in the master branch all things go well and hhvm is built successfully, but when I checkout another version tag for example 3.17.1, above mentioned error occurred.

Do you have any idea about it?

And is there any plan to update wiki build guide page to mention some useful tips about building hhvm from source?

P.S.
I'm trying to build it on Centos 7.

@ahmadazimi after checking out another git commit (or tag) you need to update the submodules as well. A safe way to get a working build from another git ID is:

git clean -dfx #clean up old build
rm -rf third-party #remove old submodules
git checkout <commit/tag> #change to new commit/tag
git submodule update --init --recursive #get submodules (for the new commit/tag)
cmake .
make -j$(nproc)

@ahmadazimi In the master branch we recently added a check which will build a third-party version of ocaml automatically. That check doesn't exist in the 3.17 branch - for 3.17 you need to update your ocaml manually.

@cmuellner Suggests the appropriate way to grab a new copy of third party.
It may also be worth noting that we just added support for building ocaml as a part of our third-party build system. Before you would need to have ocaml 4.03 or newer installed. Some of the tags you are building might require you to have a particular version of ocaml.

@cmuellner Thank you for instruction to make a clean branch of a tag. Finally I could build HHVM-3.17.1 also with the help of issue #7488

Everything seems okay :-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

turadg picture turadg  路  6Comments

doublecompile picture doublecompile  路  3Comments

octmoraru picture octmoraru  路  5Comments

HRMsimon picture HRMsimon  路  4Comments

caioiglesias picture caioiglesias  路  6Comments