[已解決]下載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的編譯器 老是報錯。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM