Search code examples
pythonv8

build v8 error when using command " python tools\dev\v8gen.py x64.release "


i try build v8 in the following steps:

  1. git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

  2. set PATH=C:\v8\depot_tools;%PATH%

  3. set DEPOT_TOOLS_WIN_TOOLCHAIN=0

  4. set GYP_MSVS_VERSION=2017

  5. fetch v8 6 .cd v8

  6. python tools\dev\v8gen.py x64.release

  7. ninja -C out.gn\x64.release

my computer enviroment:

  1. Visual Studio 2017,community
  2. Windows SDK (15063)
  3. python 2.7

error:

E:\work_space\Technology_related\V88888\v8>python tools\dev\v8gen.py x64.release -vv
################################################################################
C:\Python27\python.exe -u tools\mb\mb.py gen -f infra\mb\mb_config.pyl -m developer_default -b x64.release out.gn/x64.release

  Writing """\
  dcheck_always_on = false
  is_debug = false
  target_cpu = "x64"
  """ to E:\work_space\Technology_related\V88888\v8\out.gn\x64.release\args.gn.

  E:\work_space\Technology_related\V88888\v8\buildtools\win\gn.exe gen out.gn/x64.release --check
    -> returned 1
  ERROR at //build/config/win/visual_studio_version.gni:27:7: Script returned non-zero exit code.
        exec_script("../../vs_toolchain.py", [ "get_toolchain_dir" ], "scope")
        ^----------
  Current dir: E:/work_space/Technology_related/V88888/v8/out.gn/x64.release/
  Command: C:/Users/moush/AppData/Local/Microsoft/WindowsApps/python3.exe E:/work_space/Technology_related/V88888/v8/build/vs_toolchain.py get_toolchain_dir
  Returned 9009.
  See //build/config/win/BUILD.gn:11:1: whence it was imported.
  import("//build/config/win/visual_studio_version.gni")
  ^----------------------------------------------------
  See //build/config/BUILDCONFIG.gn:355:5: which caused the file to be included.
      "//build/config/win:lean_and_mean",
      ^---------------------------------
  GN gen failed: 1
Traceback (most recent call last):
  File "tools\dev\v8gen.py", line 309, in <module>
    sys.exit(gen.main())
  File "tools\dev\v8gen.py", line 303, in main
    return self._options.func()
  File "tools\dev\v8gen.py", line 169, in cmd_gen
    gn_outdir,
  File "tools\dev\v8gen.py", line 213, in _call_cmd
    stderr=subprocess.STDOUT,
  File "C:\Python27\lib\subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['C:\\Python27\\python.exe', '-u', 'tools\\mb\\mb.py', 'gen', '-f', 'infra\\mb\\mb_config.pyl', '-m', 'developer_default', '-b', 'x64.release', 'out.gn/x64.release']' returned non-zero exit status 1
    

I don't know how to fix this bug,Can someone help me?thanks


Solution

  • From the verbose output, you can see that the command C:/Users/moush/AppData/Local/Microsoft/WindowsApps/python3.exe E:/work_space/Technology_related/V88888/v8/build/vs_toolchain.py get_toolchain_dir failed. You can try running that on its own to see if it reports any additional details, which might help you figure out what's wrong and how to fix it.

    From the fact that "it failed" alone, I would guess that it somehow didn't detect your Visual Studio and/or Windows SDK installation. FWIW, the official instructions how to install VS are here (linked from the V8 docs). It looks like your SDK might simply be too old.

    You can also try the convenience workflow based on tools/dev/gm.py to see if that avoids this issue, but I'd guess that it will probably run into the same problem.