v8depottools

How to build own v8 fork


I have my own fork of v8 and would like to build it. However, gn and gclient keep failing and telling me that I need to be inside a checkout.

$> git clone <ownRepository>
$> gn gen out/build
gn.py: Could not find checkout in any parent of the current path.
This must be run inside a checkout.
``

How can I build my own fork? `fetch` does not seem to accept custom repositories.

Solution

  • The V8 git repository (or a fork of it) simply doesn't contain everything that's required for building; in particular it misses third-party dependencies and shared build configuration logic. The purpose of the official build tools/workflow is to set all that up. So the easiest path forward for you is probably to get a regular V8 checkout (using fetch v8), and then replacing the v8 directory in there with your own. Make sure that the versions match (at least approximately).

    The alternative is to figure out what fetch v8, gclient sync and gclient runhooks do, and doing all of that by hand -- totally possible, as they're all just scripts and entirely open source, but it's a lot of work and not much fun, so I wouldn't recommend that.