fetch chromium 只能到最新的版本,如何指定特定的版本

本文介绍了如何从git获取Chromium的特定版本源码,而不是最新的canary版本。提供了两种解决方案:方案1是通过`git fetch`和`git checkout`指定tag版本;方案2是使用`fetch chromium`确保获取所有分支,然后切换到所需版本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

缘由:

chromium现在分四大分支:

canary:最前沿的版本,每日发布,bug比较多,一般不推荐下载,特别是国内使用vpn普通网络不好的情况;

dev:每2星期发布,比较稳定,可以体验新功能和新特性
beta:每周小版本更新,6周大版本更新。比dev稳定,比同期dev版小1个版本号,基本上就是stable的待发版本

statle:比同期dev小2个版本号,2到3周版本更新一次,每6周主版本更新。这是正式发布的版本,推荐使用这个


从chromium39.0.2313.2版本之后的源码不能再通过之前那种gclient config http://*的方式通过制定的版本号(或者默认下载最新)的方式来获取源码了,因为之后的chromium的代码刚好全部迁移到了git管理了,那么通过默认使用fetch chromium,获取到的将是最新的canary版本,怎么获取statle稳定版本呢,可以通过下面的两种方式:



方案1:(方案1本机已经验证没有问题)

mengjianjun:src mengjianjun$ git fetch origin 42.0.2311.153

From https://chromium.googlesource.com/chromium/src

 * tag               42.0.2311.153 -> FETCH_HEAD

mengjianjun:src mengjianjun$ git checkout -b my_stable_branch FETCH_HEAD

Checking out files: 100% (28149/28149), done.

Previous HEAD position was b1e4962... Roll src/third_party/WebKit 8e110e4:36757d61 (svn 195456:195459)

Switched to a new branch 'my_stable_branch'

mengjianjun:src mengjianjun$ gclient sync --with_branch_heads



来源自stackoverfloat:
http://stackoverflow.com/questions/4481803/how-to-get-code-of-specified-tag-version-of-chromium-from-git

how to get code of specified tag version of Chromium from git?


i just need code of specified version of Chromium like r69297 which is the latest dev version of Chrome. i use git so i follow the instruction here:http://code.google.com/p/chromium/wiki/UsingGit however, after i sync all the code, and review the commit log, i can't find this revision! then i thought about tag, and searched here. How to use git to checkout a specified version of Webkit? here i found, but after follow all the steps, and wait for quite a long long time, i still get nothing. does the git repository of chromium keep the tag information? how can i get them? thx

share improve this question
 
 
What do you mean, "I still get nothing"? Could you show the result of running these commands? –  Jean Hominal  Dec 19 '10 at 10:53
 
@Jean Hominal: nothing output. in the git tree there doesn't exist a revision 69297, only r69298. –  ayanamist  Dec 19 '10 at 14:47
 
try to use gitk to see the history of a Git repository - you can reference a precise commit by its hash –  Jean Hominal  Dec 19 '10 at 15:40
 
@Jean Hominal: yes, i use it. there is no r69297. coomit message of git of chromium has a revision id of subversion. –   ayanamist  Dec 24 '10 at 8:51

2 Answers

up vote 4 down vote accepted

When the question was asked, Chromium used SVN. Nowadays, git is the primary VC system, so I will use git tags/hashes instead of r#### revisions.

In this answer, I assume that you have already set up the pre-requisites for building Chromium (including an initial checkout). If you don't have that one, follow the tutorial athttp://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html before continuing. You can skip the gclient sync step because you'll replace the dependencies anyway in the steps below.

Scenario: I want to apply a patch on top of the latest stable Chromium version. To find out the latest stable build, just visit https://omahaproxy.appspot.com/. According to that page, the latest version is 38.0.2125.104. If you want to see previous/next releases, visithttp://blink.lc/chromium/refs/ for an overview of tags. This list of tags includes unreleased versions, e.g. 38.0.2125.106 (the last build number increases when new patches are applied on top of the baseline that is identifier by the third number).

# Inside chromium/src/
git fetch origin 38.0.2125.106

# Create a new branch "my_stable_branch" that is based on the just-fetched HEAD.
git checkout -b my_stable_branch FETCH_HEAD

# ... apply the patch ...
# (e.g. by editing the files)
# (e.g. by using git cherry-pick [commit id] )
# (e.g. by using git checkout [commit id] [file path] )

# Commit changes (assuming that you want to keep track of your changes)
git commit -va

# Now synchronize the dependencies to the current branch
gclient sync --with_branch_heads  # --jobs 16  if you wish to use parallelism

# Now compile the release build. The output will be stored in src/out/Release.
ninja -C out/Release chrome chrome_sandbox








方案2:( to make sure you get all of the branches locally,所以需要直接用fetch chromium来获取
https://groups.google.com/a/chromium.org/forum/#!searchin/chromium-dev/fetch$20$20chromium$20specify$20version%7Csort:relevance/chromium-dev/4ODv2Q4uzpw/kRphFfRaY-0J


 
How to checkout a specified version after git migration?
3 名作者发布了 4 个帖子
 
 
frameborder="0" hspace="0" marginheight="0" marginwidth="0" scrolling="no" tabindex="0" vspace="0" width="100%" id="I1_1432104282799" name="I1_1432104282799" src="https://apis.google.com/u/0/_/+1/fastbutton?usegapi=1&count=false&size=small&source=google%3Agdf&hl=zh-CN&origin=https%3A%2F%2Fgroups.google.com&url=https%3A%2F%2Fgroups.google.com%2Fa%2Fchromium.org%2Fd%2Fsearchin%2Fchromium-dev%2Ffetch%2420%2420chromium%2420specify%2420version%257Csort%3Arelevance%2Fchromium-dev%2F4ODv2Q4uzpw%2FkRphFfRaY-0J%3Ffromplusone%3D1&gsrc=1p&jsh=m%3B%2F_%2Fscs%2Fabc-static%2F_%2Fjs%2Fk%3Dgapi.gapi.en.dPxK-DAj_pE.O%2Fm%3D__features__%2Fam%3DAAQ%2Frt%3Dj%2Fd%3D1%2Frs%3DAItRSTN0fuoBkyFaoHWfzWWLct0BxZgQSQ#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Cdrefresh%2Cerefresh&id=I1_1432104282799&parent=https%3A%2F%2Fgroups.google.com&pfname=&rpctoken=17501740" data-gapiattached="true" title="+1" style="margin: 0px; padding: 0px; vertical-align: baseline; border-width: 0px; border-style: none; position: static; top: 0px; width: 24px; left: 0px; visibility: visible; height: 15px;">
Cheng Zhao 
14/8/28
Hi chromium-dev, 

Previously I use gclient to checkout a specified version of Chromium 
by setting the "url" field of ".gclient" to something like this: 
" http://src.chromium.org/chrome/releases/{{VERSION}}

But after the git migration I have to set "url" to 
" https://chromium.googlesource.com/chromium/src.git" and there seems 
no way to specify the tag name or commit hash, is there a way to set 
the version of Chromium to checkout in the ".gclient" file? 

Thanks, 
Cheng 
点击此处 回复
agable 
14/8/29
其他收件人:  zcb...@gmail.com
No there is not. But note that gclient's "managed mode" is deprecated, and won't be coming back. What that means is that  you manage the top-level checkout, and gclient uses the DEPS file there to manage everything else. So the workflow is:

fetch chromium  # or just have a checkout already
gclient sync --with-branch-heads  # to make sure you get all of the branches locally
git checkout refs/tags/<version number>  # to update your top-level checkout to the release tag
gclient sync  # to update the dependencies to whatever is pinned there

Aaron

- 显示引用文字 -
- 显示引用文字 -
--
--
Chromium Developers mailing list:  chromi...@chromium.org
View archives, change email options, or unsubscribe:
     http://groups.google.com/a/chromium.org/group/chromium-dev



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值