01 查看chromium 历史发布版本信息
88版本以前在如下网址查看 https://www.chromium.org/developers/calendar/
最新版本信息: https://omahaproxy.appspot.com/
发布计划 https://chromiumdash.appspot.com/schedule
02 查找 与 chromium 对应的 depot_tools 版本
02.01 通过 git 下载 depot_tools 仓库
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
02.02 根据时间查找对应chromium发布附近的depot_tools版本
比如: 要查找 chromium57 版本,可以从 https://www.chromium.org/developers/calendar/ 查到 chromium 57 版本的发布时间是 57 Jan 19th, 2017 , 则在 depto_tools 中用 git map 命令查找过滤,如下查找出3条记录,当然,也可以能查不到当天的,可以用更早一些的日志来查找。
E:\git\depot_tools>git map | findstr 2017-01-19
* [31m[1m0fe50fc42f[39m[49m[0m [33m2017-01-19[39m[49m[0m ~ Roll recipe dependencies (trivial).
* [31m[1m06dba1b159[39m[49m[0m [33m2017-01-19[39m[49m[0m ~ Add JS to git cl format.
* [31m[1m833c94c6fb[39m[49m[0m [33m2017-01-19[39m[49m[0m ~ Create recipe_modules/gerrit to interact with gerrit REST API
这里 0fe50fc42f ,06dba1b159 ,833c94c6fb 是提交记录,切换到最新的版本即可。
git checkout 0fe50fc42f -b b57
::Switched to a new branch 'b57'
::
git branch -vv
::* b57 0fe50fc4 Roll recipe dependencies (trivial).
:: main 2f988479 [origin/main] cpplint: improve root path for header guard behavior
03 如何确定 chromium 下载代码时的 python环境
当按照官网的说明下载代码时,使用 gclient --version 更新完 depot_tools 后,虽然,我们把 depot_tools 设置到环境变量最前面,但实际下载代码时,使用的python,并不在 depot_tools 目录,depot_tools 会把自己目录下的python拷贝到 临时目录,在windows下面是 : %userprofile%\.vpython-root\分支数00 ,或者 %userprofile%\.vpython-root\hash
这说明我们要处理python以来,需要使用这个临时目录。
如下示例:
fetch --nohooks --no-history chromium
Running: 'C:\Users\soft\.vpython-root\297800\Scripts\python.exe' 'E:\banma\chromium572\depot_tools\gclient.py' root
Running: 'C:\Users\soft\.vpython-root\297800\Scripts\python.exe' 'E:\banma\chromium572\depot_tools\gclient.py' config --spec 'solutions = [
{
"name": "src",
"url": "https://chromium.googlesource.com/chromium/src.git",
"managed": False,
"custom_deps": {},
"custom_vars": {},
},
]
'
Running: 'C:\Users\soft\.vpython-root\297800\Scripts\python.exe' 'E:\banma\chromium572\depot_tools\gclient.py' sync --nohooks --no-history
1>________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src.git --depth=1 E:\banma\chromium572\_gclient_src_3jeopf89' in 'E:\banma\chromium572'
1>Cloning into 'E:\banma\chromium572\_gclient_src_3jeopf89'...
1>remote: Finding sources: 100% (400994/400994)
1>Receiving objects: 76% (305075/400994), 778.32 MiB | 1.86 MiB/s
04 解决 win32con 找不到的问题
问题如下:是由于 chromium 在下载代码时,把python环境拷贝到临时路径。引起的。
在系统安装的python下安装pywin32,或者是在 depot_tools下面的python下安装pywin32,都找不到 win32con。但自己在命令行下运行python可以找到win32con。
Running hooks: 7% ( 4/55) sdkextras
________ running 'vpython.bat src/build/android/play_services/update.py download' in 'E:\banma\chromium572'
Traceback (most recent call last):
File "src/build/android/play_services/update.py", line 21, in <module>
import devil_chromium
File "src/build/android/play_services\..\devil_chromium.py", line 15, in <module>
from devil import devil_env
File "E:\banma\chromium572\src\third_party\catapult\devil\devil\devil_env.py", line 32, in <module>
import dependency_manager # pylint: disable=import-error
File "E:\banma\chromium572\src\third_party\catapult\dependency_manager\dependency_manager\__init__.py", line 28, in <module>
from .archive_info import ArchiveInfo
File "E:\banma\chromium572\src\third_party\catapult\dependency_manager\dependency_manager\archive_info.py", line 7, in <module>
from dependency_manager import exceptions
File "E:\banma\chromium572\src\third_party\catapult\dependency_manager\dependency_manager\exceptions.py", line 5, in <module>
from py_utils import cloud_storage
File "E:\banma\chromium572\src\third_party\catapult\common\py_utils\py_utils\cloud_storage.py", line 19, in <module>
from py_utils import lock
File "E:\banma\chromium572\src\third_party\catapult\common\py_utils\py_utils\lock.py", line 18, in <module>
import win32con # pylint: disable=import-error
ImportError: No module named win32con
Error: Command 'vpython.bat src/build/android/play_services/update.py download' returned non-zero exit status 1 in E:\banma\chromium572
Traceback (most recent call last):
File "src/build/android/play_services/update.py", line 21, in <module>
import devil_chromium
File "src/build/android/play_services\..\devil_chromium.py", line 15, in <module>
from devil import devil_env
File "E:\banma\chromium572\src\third_party\catapult\devil\devil\devil_env.py", line 32, in <module>
import dependency_manager # pylint: disable=import-error
File "E:\banma\chromium572\src\third_party\catapult\dependency_manager\dependency_manager\__init__.py", line 28, in <module>
from .archive_info import ArchiveInfo
File "E:\banma\chromium572\src\third_party\catapult\dependency_manager\dependency_manager\archive_info.py", line 7, in <module>
from dependency_manager import exceptions
File "E:\banma\chromium572\src\third_party\catapult\dependency_manager\dependency_manager\exceptions.py", line 5, in <module>
from py_utils import cloud_storage
File "E:\banma\chromium572\src\third_party\catapult\common\py_utils\py_utils\cloud_storage.py", line 19, in <module>
from py_utils import lock
File "E:\banma\chromium572\src\third_party\catapult\common\py_utils\py_utils\lock.py", line 18, in <module>
import win32con # pylint: disable=import-error
ImportError: No module named win32con
问题解决方法: 找到 python的临时路径。
需要在临时目录下(这个临时目录可以在fetch 代码的时候有打印,或者直接到 %userprofile%/.vpython-root/ 下查找。安装对应的python2版本或者python3版本的 pywin32.
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
::运行脚本
python get-pip.py
具体示例:
PS C:\Users\soft\.vpython-root\cdbdc9\Scripts> cd ..
PS C:\Users\soft\.vpython-root\cdbdc9> .\Scripts\pip2.7 install pywin32
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting pywin32
Using cached pywin32-228-cp27-cp27m-win_amd64.whl (7.5 MB)
Installing collected packages: pywin32
Successfully installed pywin32-228
PS C:\Users\soft\.vpython-root\cdbdc9>
05 gn.exe 更新错误问题
这个问题直接提示信息比较有迷惑性,有 Unable to load AWS_CREDENTIAL_FILE 信息比较扎眼。而实际上是因为不能删除本地的 src/buildtools/win/gn.exe 文件引起的。
只要手动删除这个 gn.exe ,在运行 gclient sync 或者 gclient runhooks 即可。
________ running 'download_from_google_storage --no_resume --platform=win32 --no_auth --bucket chromium-gn -s src/buildtools/win/gn.exe.sha1' in 'E:\banma\chromium572'
0> Downloading src/buildtools/win/gn.exe...
0> Warning: deleting src/buildtools/win/gn.exe failed.
0> E:\banma\chromium572\depot_tools\external_bin\gsutil\gsutil_4.15\gsutil\third_party\boto\boto\pyami\config.py:71: UserWarning: Unable to load AWS_CREDENTIAL_FILE ()
warnings.warn('Unable to load AWS_CREDENTIAL_FILE (%s)' % full_path)
Copying gs://chromium-gn/919d6c5911dc38979f44b26f672e05ab385c07df...
OSError: .
Downloading 1 files took 22.636000 second(s)
E:\banma\chromium572\depot_tools\external_bin\gsutil\gsutil_4.15\gsutil\third_party\boto\boto\pyami\config.py:71: UserWarning: Unable to load AWS_CREDENTIAL_FILE ()
warnings.warn('Unable to load AWS_CREDENTIAL_FILE (%s)' % full_path)
Copying gs://chromium-gn/919d6c5911dc38979f44b26f672e05ab385c07df...
OSError: .
Error: Command 'download_from_google_storage --no_resume --platform=win32 --no_auth --bucket chromium-gn -s src/buildtools/win/gn.exe.sha1' returned non-zero exit status 1 in E:\banma\chromium572
Hook 'download_from_google_storage --no_resume --platform=win32 --no_auth --bucket chromium-gn -s src/buildtools/win/gn.exe.sha1' took 22.89 secs
解决方法: 改名本地 gn.exe , 在运行 gclient sync 或者 gclient runhooks 即可
|