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

 

 

 

当使用 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.1
proxy_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.exe
call RunWget.bat  gs://chromium-apache-win32/199cb003a5a40db260f29128ae630f298aaf7702 src/third_party/apache-win32\bin\libapriconv-1.dll
call RunWget.bat  gs://chromium-apache-win32/d76ccf8a113227d63927616a45d7c8eb8df44cc7 src/third_party/apache-win32\bin\libapr-1.dll
call RunWget.bat  gs://chromium-apache-win32/4e51ce1a90b99d7b08a0ed1d151eee023d43966c src/third_party/apache-win32\bin\libaprutil-1.dll
call RunWget.bat  gs://chromium-apache-win32/230b1d13ba0c4c90089e5e239b2f206ce313bb1e src/third_party/apache-win32\bin\libhttpd.dll
call RunWget.bat  gs://chromium-apache-win32/4dca3606f57e1ea9bde5d1e088bda0ae0d4ad3e0 src/third_party/apache-win32\bin\libeay32.dll
call RunWget.bat  gs://chromium-apache-win32/2c7b52a7f6b9651a9ba19119d3d842247d541af6 src/third_party/apache-win32\bin\ApacheMonitor.exe
call RunWget.bat  gs://chromium-apache-win32/02c3d37fac86cd239fe02a1842134775e40a3331 src/third_party/apache-win32\bin\ssleay32.dll
call RunWget.bat  gs://chromium-apache-win32/923f8e771902c6da79ae720817cba8b389a6b275 src/third_party/apache-win32\bin\php5ts.dll
call RunWget.bat  gs://chromium-apache-win32/c54ee354a2cdc075b9b4379cf58aba90ebea774b src/third_party/apache-win32\bin\zlib1.dll
call RunWget.bat  gs://chromium-apache-win32/27b23f5fc9f2ace1ae53edbee3f32ef0a5d37287 src/third_party/apache-win32\bin\openssl.exe
call RunWget.bat  gs://chromium-apache-win32/eb6e8b068a8db9dfa80180ea16b0927b33760298 src/third_party/apache-win32\modules\mod_asis.so
call RunWget.bat  gs://chromium-apache-win32/49345ed7627a7019402c46db98bca55a6da80ace src/third_party/apache-win32\modules\mod_alias.so
call RunWget.bat  gs://chromium-apache-win32/99b9959e5fbec830fd08a8d398c52f23894dd485 src/third_party/apache-win32\modules\mod_autoindex.so
call RunWget.bat  gs://chromium-apache-win32/333d1d54b459797d9419fce049e7d5efe7fb0a69 src/third_party/apache-win32\modules\mod_cgi.so
call RunWget.bat  gs://chromium-apache-win32/b2a72bb8447cda2800be56db3959bb8bac68e810 src/third_party/apache-win32\modules\mod_authz_host.so
call RunWget.bat  gs://chromium-apache-win32/f6eebd3da324d7a4c36593677ccefcb626ac9548 src/third_party/apache-win32\modules\mod_log_config.so
call RunWget.bat  gs://chromium-apache-win32/5926b9d7d4f1e3aae31c10e0498923cb2fbc19a9 src/third_party/apache-win32\modules\mod_headers.so
call RunWget.bat  gs://chromium-apache-win32/b7dd1e015a88c96e03bb8845636472bb256e862b src/third_party/apache-win32\modules\mod_mime.so
call RunWget.bat  gs://chromium-apache-win32/8c81e5e9fa1d6d07d5235e553b42ac02be49b996 src/third_party/apache-win32\modules\mod_ssl.so
call RunWget.bat  gs://chromium-apache-win32/81c42674bc5865c3df35a9f47e3bc6910d89c4b1 src/third_party/apache-win32\modules\php5apache2_2.dll
call RunWget.bat  gs://chromium-apache-win32/ee17b7f92645403edb0c3bb80ceeb49791989995 src/third_party/apache-win32\modules\mod_rewrite.so


cmd

RunWget.bat

@echo off
if "%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.exe
set param1=%1
set param2=%2
echo [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 cover
if "%cover%"=="" set cover=2
if exist %param2% (
    if %cover%==2 (
        set /p cover=文件已存在,是否覆盖?[0=不覆盖 1=覆盖]:
    )
)
popd
if not exist %param2% (
    goto :continue
)
if %cover%==1 goto :continue
echo [INFO][%time%]================END================
goto :eof

:continue
pushd .
cd %SRC_DIR%
wget --no-check-certificate %baseurl% -O %param2%
echo [%time%][SUCCESS] Dwonloads to url:%param2%  success!!!
echo [INFO][%time%]===============END=================
popd
goto :eof

:error
echo 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的编译器 老是报错。

 

你可能感兴趣的:(download)