在设置chrome depot_tools时无法运行获取android

y1aodyip  于 2022-11-20  发布在  Android
关注(0)|答案(2)|浏览(371)

我正在使用以下链接[安装Chromium软件仓库工具。][1]
[1]:https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up获取安卓系统。
正如在链接中提到的,我成功地克隆了depot_tools存储库。

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=/path/to/depot_tools:$PATH

接下来我尝试使用以下命令获取android

fetch android

以下是上述执行的输出

Running: gclient root
WARNING: Your metrics.cfg file was invalid or nonexistent. A new one will be created.
Running: gclient config --spec 'solutions = [
  {
    "name": "src",
    "url": "https://chromium.googlesource.com/chromium/src.git",
    "managed": False,
    "custom_deps": {},
    "custom_vars": {},
  },
]
target_os = ["android"]
'
Running: gclient sync

________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src.git /home/ubuntu/abc/_gclient_src_82brwjmn' in '/home/ubuntu/abc'
Cloning into '/home/ubuntu/abc/_gclient_src_82brwjmn'...

1>WARNING: subprocess '"git" "-c" "core.deltaBaseCacheLimit=2g" "clone" "--no-checkout" "--progress" "https://chromium.googlesource.com/chromium/src.git" "/home/ubuntu/abc/_gclient_src_82brwjmn"' in /home/ubuntu/abc failed; will retry after a short nap...

________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src.git /home/ubuntu/abc/_gclient_src_82brwjmn' in '/home/ubuntu/abc' attempt 2 / 4
Cloning into '/home/ubuntu/abc/_gclient_src_82brwjmn'...

1>WARNING: subprocess '"git" "-c" "core.deltaBaseCacheLimit=2g" "clone" "--no-checkout" "--progress" "https://chromium.googlesource.com/chromium/src.git" "/home/ubuntu/abc/_gclient_src_82brwjmn"' in /home/ubuntu/abc failed; will retry after a short nap...

________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src.git /home/ubuntu/abc/_gclient_src_82brwjmn' in '/home/ubuntu/abc' attempt 3 / 4
Cloning into '/home/ubuntu/abc/_gclient_src_82brwjmn'...
fatal: Malformed response in ref list: c3cf127a33b227abcf63

1>WARNING: subprocess '"git" "-c" "core.deltaBaseCacheLimit=2g" "clone" "--no-checkout" "--progress" "https://chromium.googlesource.com/chromium/src.git" "/home/ubuntu/abc/_gclient_src_82brwjmn"' in /home/ubuntu/abc failed; will retry after a short nap...

________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src.git /home/ubuntu/abc/_gclient_src_82brwjmn' in '/home/ubuntu/abc' attempt 4 / 4
Cloning into '/home/ubuntu/abc/_gclient_src_82brwjmn'...
1>WARNING: subprocess '"git" "-c" "core.deltaBaseCacheLimit=2g" "clone" "--no-checkout" "--progress" "https://chromium.googlesource.com/chromium/src.git" "/home/ubuntu/abc/_gclient_src_82brwjmn"' in /home/ubuntu/abc failed; will retry after a short nap...
Syncing projects: 100% ( 1/ 1) src
src (ERROR)
----------------------------------------
[0:00:00] Started.
[0:00:00] 
Traceback (most recent call last):
  File "/home/ubuntu/depot_tools/gclient_scm.py", line 1043, in _Clone
    self._Run(clone_cmd, options, cwd=self._root_dir, retry=True,
  File "/home/ubuntu/depot_tools/gclient_scm.py", line 1411, in _Run
    gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs)
  File "/home/ubuntu/depot_tools/gclient_utils.py", line 673, in CheckCallAndFilter
    raise subprocess2.CalledProcessError(
subprocess2.CalledProcessError: Command 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src.git /home/ubuntu/abc/_gclient_src_82brwjmn' returned non-zero exit status 128 in /home/ubuntu/abc
[0:25:41] _____ Conflicting directory found in /home/ubuntu/abc/src. Moving to /home/ubuntu/abc/_bad_scm/srcml99933n.
----------------------------------------

Warnings:
Conflicting directory /home/ubuntu/abc/src moved to /home/ubuntu/abc/_bad_scm/srcml99933n.
Traceback (most recent call last):
  File "/home/ubuntu/depot_tools/gclient_scm.py", line 546, in update
    self._Clone(revision, url, options)
  File "/home/ubuntu/depot_tools/gclient_scm.py", line 1043, in _Clone
    self._Run(clone_cmd, options, cwd=self._root_dir, retry=True,
  File "/home/ubuntu/depot_tools/gclient_scm.py", line 1411, in _Run
    gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs)
  File "/home/ubuntu/depot_tools/gclient_utils.py", line 673, in CheckCallAndFilter
    raise subprocess2.CalledProcessError(
subprocess2.CalledProcessError: Command 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src.git /home/ubuntu/abc/_gclient_src_82brwjmn' returned non-zero exit status 128 in /home/ubuntu/abc

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/.vpython-root/04a1a7/lib/python3.8/shutil.py", line 780, in move
    os.rename(src, real_dst)
FileNotFoundError: [Errno 2] No such file or directory: '/home/ubuntu/abc/src' -> '/home/ubuntu/abc/_bad_scm/srcml99933n/src'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/depot_tools/metrics.py", line 267, in print_notice_and_exit
    yield
  File "/home/ubuntu/depot_tools/gclient.py", line 3195, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/home/ubuntu/depot_tools/gclient.py", line 3181, in main
    return dispatcher.execute(OptionParser(), argv)
  File "/home/ubuntu/depot_tools/subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "/home/ubuntu/depot_tools/gclient.py", line 2737, in CMDsync
    ret = client.RunOnDeps('update', args)
  File "/home/ubuntu/depot_tools/gclient.py", line 1779, in RunOnDeps
    work_queue.flush(revision_overrides, command, args, options=self._options,
  File "/home/ubuntu/depot_tools/gclient_utils.py", line 968, in flush
    reraise(e[0], e[1], e[2])
  File "/home/ubuntu/depot_tools/gclient_utils.py", line 67, in reraise
    raise value
  File "/home/ubuntu/depot_tools/gclient_utils.py", line 1045, in run
    self.item.run(*self.args, **self.kwargs)
  File "/home/ubuntu/depot_tools/gclient.py", line 925, in run
    self._got_revision = self._used_scm.RunCommand(command, options, args,
  File "/home/ubuntu/depot_tools/gclient_scm.py", line 132, in RunCommand
    return getattr(self, command)(options, args, file_list)
  File "/home/ubuntu/depot_tools/gclient_scm.py", line 548, in update
    self._DeleteOrMove(options.force)
  File "/home/ubuntu/depot_tools/gclient_scm.py", line 207, in _DeleteOrMove
    shutil.move(self.checkout_path, dest_path)
  File "/home/ubuntu/.vpython-root/04a1a7/lib/python3.8/shutil.py", line 794, in move
    copy_function(src, real_dst)
  File "/home/ubuntu/.vpython-root/04a1a7/lib/python3.8/shutil.py", line 426, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/home/ubuntu/.vpython-root/04a1a7/lib/python3.8/shutil.py", line 259, in copyfile
    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/home/ubuntu/abc/src'

Subprocess failed with return code 1.

我一直被困在这。
了解这里的线索

cbeh67ev

cbeh67ev1#

您需要确保内存足够大。https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/android_build_instructions.md#system-requirements
我也有同样的问题,添加内存解决了这个问题。

jei2mxaa

jei2mxaa2#

我也遇到了这个问题。这似乎是Ubuntu 20和Chromium的糟糕组合。
这是因为chrome的提交历史非常大,它需要太大的空间,而ubuntu 20不支持这么大的空间。
因此,要在ubuntu 20中获得android chromium,您需要按照以下步骤操作:

获取--无钩子--无历史记录android
g客户端同步-D --无历史记录

一旦完成,就触发你的构建命令。2没有补丁历史记录,git包的大小不会超过2GB的限制,它会像旧系统一样正常工作。

相关问题