depot_tools更新失败

2016-12-14 19:10:26来源:CSDN作者:yyinhai人点击

depot_tools更新失败

鉴于伟大的墙,windows系统下使用depot_tools命令(比如gclient)时会出现更新失败的错误:

Ensuring CIPD client is up-to-date
GET https://chrome-infra-packages.appspot.com/_ah/api/repo/v1/instance/resolve?version=bccdb9a605037e3dd2a8a64e79e08f691a6f159d&package_name=infra%2Ftools%2Fcipd%2Fwindows-amd64
Failed to fetch https://chrome-infra-packages.appspot.com/_ah/api/repo/v1/instance/resolve?version=bccdb9a605037e3dd2a8a64e79e08f691a6f159d&package_name=infra%2Ftools%2Fcipd%2Fwindows-amd64
Retrying in 1 sec.
GET https://chrome-infra-packages.appspot.com/_ah/api/repo/v1/instance/resolve?version=bccdb9a605037e3dd2a8a64e79e08f691a6f159d&package_name=infra%2Ftools%2Fcipd%2Fwindows-amd64
Failed to fetch https://chrome-infra-packages.appspot.com/_ah/api/repo/v1/instance/resolve?version=bccdb9a605037e3dd2a8a64e79e08f691a6f159d&package_name=infra%2Ftools%2Fcipd%2Fwindows-amd64
Retrying in 2 sec.
GET https://chrome-infra-packages.appspot.com/_ah/api/repo/v1/instance/resolve?version=bccdb9a605037e3dd2a8a64e79e08f691a6f159d&package_name=infra%2Ftools%2Fcipd%2Fwindows-amd64
Failed to fetch https://chrome-infra-packages.appspot.com/_ah/api/repo/v1/instance/resolve?version=bccdb9a605037e3dd2a8a64e79e08f691a6f159d&package_name=infra%2Ftools%2Fcipd%2Fwindows-amd64
Retrying in 3 sec.

笔者尝试使用Lantern、Shadowsocks(尚未支持全局代理时)更新都不行。无奈之下,买了个国外的windows云服务器,在服务器上下载更新好再复制回来。
此时再次执行gclient,命令行窗口卡了一段时间以后出现如下错误:

fatal: unable to access >’https://chromium.googlesource.com/chromium/tools/depot_tools.git/‘: Failed to connect to chromium.googlesource.com port 443: Timed out

还是归功于伟大的墙,解决方法是禁用自动更新(如果你使用了类似文末的方法支持了shadowsocks全局代理,那么这一步不是必须的),在update_depot_tools.bat里加入:

:: MODIFY: Disable automatic update!
set DEPOT_TOOLS_UPDATE=0

至此,depot_tools就可以用了,执行gclient,得到如下输出:

Usage: gclient.py <command> [options]

Meta checkout dependency manager for Git.

Commands are:
cleanup dEPRECATED: SVN-only. Cleaned up all working copies
config creates a .gclient file in the current directory
diff displays local diff for every dependencies
fetch fetches upstream commits for all modules
grep greps through git repos managed by gclient
help prints list of commands or help for a specific command
hookinfo outputs the hooks that would be run by gclient runhooks
pack generates a patch which can be applied at the root of the tree
recurse operates [command args …] on all the dependencies
revert reverts all modifications in every dependencies
revinfo outputs revision info mapping for the client and its dependencies
root outputs the solution root (or current dir if there isn’t one)
runhooks runs hooks for files that have been modified in the local working copy
status shows modification status for every dependencies
sync checkout/update all modules
verify verifies the DEPS file deps are only from allowed_hosts

Options:
–version show program’s version number and exit
-h, –help show this help message and exit
-j JOBS, –jobs=JOBS Specify how many SCM commands can run in parallel;
defaults to 8 on this machine
-v, –verbose Produces additional output for diagnostics. Can be
used up to three times for more logging info.
–gclientfile=CONFIG_FILENAME
Specify an alternate .gclient file
–spec=SPEC create a gclient file containing the provided string.
Due to Cygwin/Python brokenness, it can’t contain any
newlines.
–no-nag-max Ignored for backwards compatibility.

附上windows版下载链接:我是人见人爱花见花开的传送门,门票3分,别看了,戳我就对了!,此版本已禁用depot_tools的更新,如需启用,使用原始文件update_depot_tools.bat.original替换update_depot_tools.bat即可。
需要macos版的话由此传送,门票1分,这是我从git仓库下载的版本。

温馨提示:如果你需要准备翻墙梯子的话,可以看这里shadowsocks和proxifier的安装配置。

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台