3

I've been trying to compile V8. I've obtained a copy of the v8-master folder from GitHub, but I can't figure out how to compile it. A lot of the documentation I could find online are conflicting.

From what I've gathered, it appears as if my best chance of getting it to compile (out of the various methods I've found, though I couldn't get any of them to work) is to create the project files by calling the gyp_v8 script (located in the build folder of v8-master). But it simply gives me File "gyp_v8", line 86 print 'Error running GYP' SyntaxError: Missing parentheses in call to 'print'. From there, I tried to install Gyp (since according to the documentation, I'm led to believe that's what's causing the error). That required me to install depot_tools and do gclient sync. That failed with the error Error: client not configured; see 'gclient config'. And gclient config fails with the erropr gclient.py: error: Inconsistency arguments. Use either --spec or one or 2 args.

Honestly, I'm lost at this point. Is there any way I could just use CMake or something? Or at least a build tutorial that doesn't assume you have a bunch of Google-specific build tools involved?

user112513312
  • 399
  • 4
  • 13

2 Answers2

2
  1. Confirm Git is installed. git 2.2.1+ recommended.
  2. Temporarily, disable Windows Indexing.
  3. Install "Microsoft Visual C++ 2008 Redistributable Package"
  4. Run bat file as administrator

Bat file:

@echo on

CD /D %~dp0
SET DEPOT_TOOLS_WIN_TOOLCHAIN=0
SET DEPOT_TOOLS=%CD%/depot_tools
SET PYTHONHOME=%DEPOT_TOOLS%/python276_bin
SET PYTHONPATH=%CD%/v8/build/gyp
SET PATH=%DEPOT_TOOLS%;%PYTHONHOME%;%PATH%

SET GYP_DEFINES=target_arch=x64
REM SET GYP_DEFINES=target_arch=x64 component=shared_library v8_use_snapshot=false
REM About GYP_DEFINES: https://github.com/v8/v8/wiki/Building-with-Gyp

IF EXIST %DEPOT_TOOLS% (
  ECHO Updating depot_tools
  CD %DEPOT_TOOLS%
  CALL git pull
  CD ..
) ELSE (
  ECHO Getting depot_tools
  CALL git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
)

CALL gclient
CALL gclient config https://chromium.googlesource.com/v8/v8.git
CALL gclient sync
Andrey Volk
  • 3,400
  • 2
  • 15
  • 28
  • On the last line I get the error `gyp: Call to 'cd .. && python -c "import os; print os.getcwd()"' returned exit status 1 in v8\build\all.gyp` (it shows the full filepath but it's long so I shortened it). – user112513312 Feb 02 '16 at 07:02
  • I updated an answer. My Chief used this solution. In v8\build will appear all.sln – user3115937 Feb 05 '16 at 11:48
1

I've previously built V8 from source for Visual Studio 2010 and then for Visual Studio 2013. Very time consuming tasks in both cases. However for Visual Studio 2017 I found that the headers and prebuilt libraries are available from NuGet. I no longer needed to build from source.

user3717478
  • 783
  • 1
  • 7
  • 14