[已解决]下载chromium源码 download_from_google_storage 无法下载文件

来源:互联网 发布:电脑语音朗读软件 编辑:程序博客网 时间:2024/04/29 11:14

当使用 gclient runhooks 后

出现下面的错误

 File gs://chromium-gn/1088992877b3a13f25b61c8fc18e25296d8cab33 for src/buildtools/win/gn does not exist. 0> File gs://chromium-gn/1088992877b3a13f25b61c8fc18e25296d8cab33 for src/buildtools/win/gn does not exist, skipping.> Error: Command download_from_google_storage --no_resume --platform=linux* --no_auth --bucket chromium-gn -s src/buildtools/win/gn.sha1 returned non-zero exit status 1 

已经设置 .boto 以及

set NO_AUTH_BOTO_CONFIG=E:\_ChromiumDev\gclient_chromium_src\.boto

.boto 内容是:

[Boto]proxy = 127.0.0.1proxy_port = 8087

但是 貌似通过 download_from_google_storage.py 这个工具,还是无法下载谷歌的文件,上面的是使用了代理。否则某些谷歌的文件无法访问。

现在是工具无法下载,但是浏览器可以下载。

后来 查了下,以及通过浏览器下载了部分文件。没有快速的解决方案,那就自己解决吧。

于是乎 写个 wget 下载的bat脚本,把缺失的文件批量下载下来!

 

RunDownloads.py.bat

复制代码
@rem When Run Command [gclient runhooks]@rem Download_Failed===========================@rem download_from_google_storage --no_resume --platform=win32 --directory --recursive --no_auth --num_threads=16 --bucket chromium-apache-win32  --boto=E:\_ChromiumDev\gclient_chromium_src\.boto src/third_party/apache-win32 @rem Download_Failed===========================call RunWget.bat  gs://chromium-apache-win32/11ba0c1941b9c46ad279f33c2db3e3c628197ae8 src/third_party/apache-win32\bin\httpd.execall RunWget.bat  gs://chromium-apache-win32/199cb003a5a40db260f29128ae630f298aaf7702 src/third_party/apache-win32\bin\libapriconv-1.dllcall RunWget.bat  gs://chromium-apache-win32/d76ccf8a113227d63927616a45d7c8eb8df44cc7 src/third_party/apache-win32\bin\libapr-1.dllcall RunWget.bat  gs://chromium-apache-win32/4e51ce1a90b99d7b08a0ed1d151eee023d43966c src/third_party/apache-win32\bin\libaprutil-1.dllcall RunWget.bat  gs://chromium-apache-win32/230b1d13ba0c4c90089e5e239b2f206ce313bb1e src/third_party/apache-win32\bin\libhttpd.dllcall RunWget.bat  gs://chromium-apache-win32/4dca3606f57e1ea9bde5d1e088bda0ae0d4ad3e0 src/third_party/apache-win32\bin\libeay32.dllcall RunWget.bat  gs://chromium-apache-win32/2c7b52a7f6b9651a9ba19119d3d842247d541af6 src/third_party/apache-win32\bin\ApacheMonitor.execall RunWget.bat  gs://chromium-apache-win32/02c3d37fac86cd239fe02a1842134775e40a3331 src/third_party/apache-win32\bin\ssleay32.dllcall RunWget.bat  gs://chromium-apache-win32/923f8e771902c6da79ae720817cba8b389a6b275 src/third_party/apache-win32\bin\php5ts.dllcall RunWget.bat  gs://chromium-apache-win32/c54ee354a2cdc075b9b4379cf58aba90ebea774b src/third_party/apache-win32\bin\zlib1.dllcall RunWget.bat  gs://chromium-apache-win32/27b23f5fc9f2ace1ae53edbee3f32ef0a5d37287 src/third_party/apache-win32\bin\openssl.execall RunWget.bat  gs://chromium-apache-win32/eb6e8b068a8db9dfa80180ea16b0927b33760298 src/third_party/apache-win32\modules\mod_asis.socall RunWget.bat  gs://chromium-apache-win32/49345ed7627a7019402c46db98bca55a6da80ace src/third_party/apache-win32\modules\mod_alias.socall RunWget.bat  gs://chromium-apache-win32/99b9959e5fbec830fd08a8d398c52f23894dd485 src/third_party/apache-win32\modules\mod_autoindex.socall RunWget.bat  gs://chromium-apache-win32/333d1d54b459797d9419fce049e7d5efe7fb0a69 src/third_party/apache-win32\modules\mod_cgi.socall RunWget.bat  gs://chromium-apache-win32/b2a72bb8447cda2800be56db3959bb8bac68e810 src/third_party/apache-win32\modules\mod_authz_host.socall RunWget.bat  gs://chromium-apache-win32/f6eebd3da324d7a4c36593677ccefcb626ac9548 src/third_party/apache-win32\modules\mod_log_config.socall RunWget.bat  gs://chromium-apache-win32/5926b9d7d4f1e3aae31c10e0498923cb2fbc19a9 src/third_party/apache-win32\modules\mod_headers.socall RunWget.bat  gs://chromium-apache-win32/b7dd1e015a88c96e03bb8845636472bb256e862b src/third_party/apache-win32\modules\mod_mime.socall RunWget.bat  gs://chromium-apache-win32/8c81e5e9fa1d6d07d5235e553b42ac02be49b996 src/third_party/apache-win32\modules\mod_ssl.socall RunWget.bat  gs://chromium-apache-win32/81c42674bc5865c3df35a9f47e3bc6910d89c4b1 src/third_party/apache-win32\modules\php5apache2_2.dllcall RunWget.bat  gs://chromium-apache-win32/ee17b7f92645403edb0c3bb80ceeb49791989995 src/third_party/apache-win32\modules\mod_rewrite.socmd
复制代码

RunWget.bat

复制代码
@echo offif "%1"=="" goto error@rem ##########@rem 2> File gs://chromium-apache-win32/11ba0c1941b9c46ad279f33c2db3e3c628197ae8 for@rem src/third_party/apache-win32\bin\httpd.exe does not exist, skipping.@rem 3> File gs://chromium-apache-win32/199cb003a5a40db260f29128ae630f298aaf7702 for@rem src/third_party/apache-win32\bin\libapriconv-1.dll does not exist, skipping.@rem ##########set SRC_DIR=E:\_ChromiumDev\gclient_chromium_src@rem set param1=gs://chromium-apache-win32/11ba0c1941b9c46ad279f33c2db3e3c628197ae8@rem set param2=src/third_party/apache-win32\bin\httpd.exeset param1=%1set param2=%2echo [INFO][%time%] ==========Begin==================echo [INFO][%time%] gs_url=%param1%set baseurl=https://storage.googleapis.com/set baseurl=%baseurl%%param1:~5%echo [INFO][%time%] httpBaseUrl=%baseurl%:StartDownload@rem 进行一次 文件是否 覆盖的用户交互pushd .cd %SRC_DIR%set coverif "%cover%"=="" set cover=2if exist %param2% (    if %cover%==2 (        set /p cover=文件已存在,是否覆盖?[0=不覆盖 1=覆盖]:    ))popdif not exist %param2% (    goto :continue)if %cover%==1 goto :continueecho [INFO][%time%]================END================goto :eof:continuepushd .cd %SRC_DIR%wget --no-check-certificate %baseurl% -O %param2%echo [%time%][SUCCESS] Dwonloads to url:%param2%  success!!!echo [INFO][%time%]===============END=================popdgoto :eof:errorecho Help:echo     %0 [gs://name/hash] [saveToPath]pause
复制代码

wget 单文件 可以从这里下载: wget.zip

 

运行 gclient runhooks 出现的所有 

 0> File gs://chromium-gn/1088992877b3a13f25b61c8fc18e25296d8cab33 for src/buildtools/linux32/gn does not exist, skipping.

这样的错误,只要用上面的bat脚本运行下就可以下载了。直到 gclient runhooks 没有报错。就可以进行下一步 编译 chromium了。

 

 

编译chromium就是命令:

ninja -C src/out/Debug chrome

又出现了错误

ninja: build stopped: subcommand failed.

通过下面命令查看 具体哪里出错了。因为 批量任务,一下子刷屏了,看不到错误在哪里。

ninja -C src/out/Debug chrome|findstr error

rated_cjk_delta_bi_4.cc : error C2220: 警告被视为错误 - 没有生成“object”文件注意: 包含文件:      C:\Program Files (x86)\Windows Kits\8.0\Include\shared\winerror.h注意: 包含文件:      C:\Program Files (x86)\Windows Kits\8.0\Include\shared\winerror.h

 

解决方案,修改文件编码。

复制代码
  今天编译gamebryo,出现error C2220: 警告被视为错误 - 没有生成“object”文件,晕死,在公司编译的时候还好好的。打开文件看了下,就是个头文件,里面定义了几个宏error <wbr>C2220: <wbr>警告被视为错误 <wbr>- <wbr>没有生成“object”文件。没办法,清除,重新编译,错误依旧,又搞了半天终于找到错误原因error <wbr>C2220: <wbr>警告被视为错误 <wbr>- <wbr>没有生成“object”文件这种错误的原因是:原因是该文件的代码页为英文,而我用的系统中的代码页为中文。解决方案:1. 文件->打开->选择,然后保存。从新打开程序文件运行,此错误不再出现。
复制代码

我用 notepad++ 配合everything 快速打开目标文件,然后 格式 转为 ansi编码。原来的是 utf8 no-bom 编码。这种编码,cl.exe MSVC的编译器 老是报错。

0 0