1. 程式人生 > >fetch chromium 只能到最新的版本,如何指定特定的版本

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

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 at

http://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