在 ubuntu (docker) 上构建 v8

Building v8 on ubuntu (docker)

我尝试在 ubuntu 上构建 v8(使用 docker 因为我在我的开发环境中没有 root 访问权限)。

我尝试按照此处的说明进行操作https://github.com/v8mips/v8mips/wiki/Get-the-code

我可以得到 depot_tools 但是当我 运行 fetch v8 时,我得到以下错误:

Error: Command '/usr/bin/python v8/third_party/binutils/download.py' 
    returned non-zero exit status 1 in /home
Traceback (most recent call last):
  File "/home/depot_tools/fetch.py", line 300, in <module>
    sys.exit(main())
  File "/home/depot_tools/fetch.py", line 295, in main
    return run(options, spec, root)
  File "/home/depot_tools/fetch.py", line 289, in run
    return checkout.init()
  File "/home/depot_tools/fetch.py", line 132, in init
    self.run_gclient(*sync_cmd)
  File "/home/depot_tools/fetch.py", line 76, in run_gclient
    return self.run(cmd_prefix + cmd, **kwargs)
  File "/home/depot_tools/fetch.py", line 66, in run
    return subprocess.check_output(cmd, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 574, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '('gclient', 'sync', '--with_branch_heads')'
    returned non-zero exit status 2

有谁知道可能是什么问题?这是我的 Dockerfile:

FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -y git
RUN apt-get install -y python
WORKDIR /home
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
ENV PATH /home/depot_tools:"$PATH"

然后我 运行 docker 和 docker run -it v8build(docker 图像的名称)和 运行 fetch v8

编辑(添加版本信息):

我已经弄清楚问题出在哪里,这里是答案。希望有人能够从中受益。

事实证明,您可以 运行 fetch -n v8 查看所有将成为 运行 的命令。命令如下:

fetch -n v8
Running: gclient root
Running: gclient config --spec 'solutions = [
  {
    "url": "https://chromium.googlesource.com/v8/v8.git",
    "managed": False,
    "name": "v8",
    "deps_file": "DEPS",
    "custom_deps": {},
  },
]
'
Running: gclient sync --with_branch_heads
cd /home/x/v8
Running: git submodule foreach 'git config -f $toplevel/.git/config submodule.$name.ignore all'
Running: git config --add remote.origin.fetch '+refs/tags/*:refs/tags/*'
Running: git config diff.ignoreSubmodules all

如错误输出所述,错误发生在 gclient sync --with_branch_heads

我 运行 一个接一个地手动复制该过程的命令,以便它可以打印出被 运行ning fetch v8 隐藏的消息。 结果错误是 ubuntu:latest docker 图片没有 lbzip2.

安装即可解决问题。

已更新Dockerfile

FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -y git python lbzip2 && apt-get clean
WORKDIR /home
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
ENV PATH /home/depot_tools:"$PATH"
RUN cd /home && fetch v8

旅程继续...