Building v8 with Visual Studio 2015 on Windows 10

1,217 views
Skip to first unread message

Pieter

unread,
Sep 20, 2016, 4:04:15 AM9/20/16
to v8-users

I have been struggling for a couple of days to get the correct incantations to get a build of v8 working on windows 10 with visual studio 2015.

In short the steps that i've been attempting are as follows
  • set DEPOT_TOOLS_WIN_TOOLCHAIN=0
  • set GYP_MSVS_VERSION=2015
  • set GYP_GENERATORS=msvs-ninja,ninja
  • Get depot tools from: wget https://storage.googleapis.com/chrome-infra/depot_tools.zip -OutFile depot_tools.zip
  • Expand Archive: Expand-Archive .\depot_tools.zip -dest depot_tools
  • Set the path for depot tools
  • Checkout the v8 source code by running: fetch v8
  • Change directory to /v8 and checkout 5.2git checkout branch-heads/5.2
  • Run sync so that all the dependencies are up to date with the branch: gclient sync
  • To generate the project files run: third_party/python_26/python.exe build\gyp_v8 -Dtarget_arch=x64
  • To build: : "c:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.com" /build Release gypfiles\All.sln
I am running into all kinds of issues related with the build and after running the last command it ends with

The first occurrence of the error is 

1>  ninja -t msvc -e environment.x64 -- "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe" /nologo /showIncludes /FC @obj\third_party\icu\source\i18n\icui18n.collationkeys.obj.rsp /c..\..\third_party\icu\source\i18n\collationkeys.cpp /Foobj\third_party\icu\source\i18n\icui18n.collationkeys.obj /Fdobj\third_party\icu\icui18n.cc.pdb
1>C:\source\v8build\v8\third_party\icu\source\i18n\collationkeys.cpp : fatal error C1083: Cannot open compiler generated file: 'C:\source\v8build\v8\out\Release_x64\obj\third_party\icu\source\i18n\icui18n.collationkeys.obj': Permission denied

I am not sure why i'm getting a permission denied.

the build then ends with

40>  ninja: build stopped: subcommand failed.
40>ninja : warning : premature end of file; recovering
40>C:\source\v8build\v8\test\fuzzer\wasm_fuzzer.vcxproj(334,5): error MSB3073: The command "call ninja.exe -C ..\..\out\Release_x64\ wasm_fuzzer" exited with code 1.

 
..\..\out\Release_x64\ wasm_fuzzer" exited with code 1.
========== Build: 20 succeeded, 21 failed, 0 up-to-date, 0 skipped ==========


Any help would be much appreciated

Jochen Eisinger

unread,
Sep 21, 2016, 4:54:39 AM9/21/16
to v8-users
If you want to build with MSVS, you need the msvs gyp generator. msvs-ninja only supports browsing the project, not building it

--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups "v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pieter

unread,
Sep 21, 2016, 4:56:55 AM9/21/16
to v8-users
Thanks for the reply Jochen,
How do I specify the msvs gyp generator?

Michael Achenbach

unread,
Sep 21, 2016, 8:39:37 AM9/21/16
to v8-users
That'd be with
set GYP_GENERATORS=msvs

But I'm afraid we dropped official support for this a while back.

Why not build with ninja? E.g. gyp_generator like you specified and then build with:
ninja -C out\Release

on x64 platforms might require:
ninja -C out\Release_x64

jan.eh...@monitor.nl

unread,
Nov 24, 2016, 4:58:07 PM11/24/16
to v8-users

Michael Achenbach

unread,
Nov 28, 2016, 10:40:14 AM11/28/16
to v8-users
Please refer to the authors of the gn --ide=vs extension. I don't know what this is supposed to be doing.

V8 officially only supports building with ninja. E.g.
gn gen v5.4/x64.release
ninja -C v5.4/x64.release d8
Message has been deleted

jan.eh...@monitor.nl

unread,
Nov 28, 2016, 11:15:56 AM11/28/16
to v8-users
And it is in in the gn help:

D:\chromium\v8>gn gen --help | grep ide
  gn gen [<ide options>] <out_dir>
  GN optionally generates files for IDE. Possibilities for <ide options>
  --ide=<ide_name>
      Override default sln file name ("all"). Solution file is written
      Override defaut workspace file name ("all"). The workspace file
      Overrides default file name (project.json) of generated JSON file.
  --json-ide-script=<path_to_python_script>
  --json-ide-script-args=<argument>

jan.eh...@monitor.nl

unread,
Nov 28, 2016, 11:22:16 AM11/28/16
to v8-users
Or:

D:\chromium\v8>gn gen --help | grep -A10 ide=
  --ide=<ide_name>
      Generate files for an IDE. Currently supported values:
      "eclipse" - Eclipse CDT settings file.
      "vs" - Visual Studio project/solution files.
             (default Visual Studio version: 2015)
      "vs2013" - Visual Studio 2013 project/solution files.
      "vs2015" - Visual Studio 2015 project/solution files.
      "xcode" - Xcode workspace/solution files.
      "qtcreator" - QtCreator project files.
      "json" - JSON file containing target information

Michael Achenbach

unread,
Nov 29, 2016, 8:56:00 AM11/29/16
to v8-users
I don't know if the --ide option can be used for building V8. We don't officially support it. The stackoverflow link you provided contains also the answer we officially support:

Could you try building with ninja and see if it works for you?

Of course, if you or anybody makes building with msbuild work, feel free to post it here.

Gautham B A

unread,
Mar 5, 2017, 12:56:15 AM3/5/17
to v8-users
Hi all,

I was able to build v8 (branch 4.8) on Windows 10 using Visual Studio 2015. I followed these instructions -
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GYP_MSVS_VERSION=2015
set GYP_GENERATORS=
msvs
wget https
://storage.googleapis.com/chrome-infra/depot_tools.zip -OutFile depot_tools.zip

Expand-Archive .\depot_tools.zip -dest depot_tools

Set the path for depot tools using Control panel
fetch v8git checkout branch-heads/4.8
gclient sync
python
.exe build\gyp_v8 -Dtarget_arch=x64

After generating the build files, it actually shows some warning messages asking us to manually delete some directories -
del v8\base\trace_event\common
del v8\third_party\instrumented_libraries
del v8\test\test262\harness
del v8\third_party\markupsafe
del v8\third_party\jinja2
del v8\test\wasm-js

Now open v8\build\all.sln in Visual Studio 2015 and build the whole solution.

james....@lafargeholcim.com

unread,
Mar 30, 2017, 6:39:44 PM3/30/17
to v8-users
This is not correct: fetch v8git checkout branch-heads/4.8

Since one cannot fetch "v8git" I assume you meant two separate lines there:

fetch v8
git checkout branch-heads/4.8

;)

Gautham B A

unread,
Mar 30, 2017, 9:30:16 PM3/30/17
to v8-users
Yes. They're separate commands. Thanks, I didn't notice that.
Reply all
Reply to author
Forward
0 new messages