2017-05-27 150 views
0

我嘗試在ubuntu上構建v8(使用docker,因爲我的開發環境沒有root權限)。在Ubuntu上構建v8(docker)

我嘗試按照這裏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 run -it v8build(泊塢窗圖像的名稱)運行泊塢窗和運行fetch v8

編輯(把版本信息):

  • Ubuntu的:16.04
  • git:2.7.4
  • python:2.7.12

回答

0

我已經弄清楚是什麼問題,這裏是答案。希望有人能夠從中受益。

事實證明,您可以運行fetch -n v8來查看將要運行的所有命令。和命令如下:如由錯誤輸出描述的gclient sync --with_branch_heads發生

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 

該錯誤。

我一個一個地運行命令來手動複製該過程,以便可以打印出運行fetch v8隱藏的消息。 而錯誤原來是ubuntu:latest泊塢窗圖像沒有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 

旅程繼續...