设置 chromium depot_tools 时无法运行 fetch android
Posted
技术标签:
【中文标题】设置 chromium depot_tools 时无法运行 fetch android【英文标题】:Fail to run fetch android while setting up chromium depot_tools 【发布时间】:2021-01-16 07:07:21 【问题描述】:我正在关注以下链接 [安装 Chromium depot 工具。][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.
我一直被困在这个问题上。
在这里了解任何潜在客户
【问题讨论】:
找不到这个目录:/home/ubuntu/abc/src
是的,我知道。如果您在开始时查看错误日志,您会发现它无法创建 /src 文件夹。这就是问题的出发点。 raise subprocess2.CalledProcessError( subprocess2.CalledProcessError: Command 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress chromium.googlesource.com/chromium/src.git /home/ubuntu/abc/_gclient_src_82brwjmn' 在冲突目录中返回非零退出状态 128在 /home/ubuntu/abc/src 中找到。移动到 /home/ubuntu/abc/_bad_scm/srcml99933n。
您应该在您具有写入权限的目录中运行该 fetch 命令。在那里将创建一个 src 文件夹,所有代码都将驻留
是的,我正在这样做。我创建了一个新目录“abc”并在其中运行 fetch 命令
遇到了同样的问题,在没有历史记录的情况下获取有助于至少克服错误:fetch --no-history chromium
不确定是什么原因造成的。
【参考方案1】:
您需要确保内存足够大。 https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/android_build_instructions.md#system-requirements
我也有同样的问题:android添加内存就解决了。
【讨论】:
以上是关于设置 chromium depot_tools 时无法运行 fetch android的主要内容,如果未能解决你的问题,请参考以下文章