8

I don't want build master branch. Instead I would like to build a specific tag which the latest stable release as same as my Desktop Chrome.

Ling
  • 1,033
  • 1
  • 9
  • 17

1 Answers1

11

This is probably the fastest way to fetch Chromium's source code. Suppose 59.0.3071.115 is the version of Chromium, you wish to build. You run this command:

git fetch https://chromium.googlesource.com/chromium/src.git +refs/tags/59.0.3071.115:chromium_59.0.3071.115

If you don't want the history to be fetched (faster fetching of Chromium source code):

git fetch https://chromium.googlesource.com/chromium/src.git +refs/tags/59.0.3071.115:chromium_59.0.3071.115 --depth 1

Now from your Chromium repo, use the following command to show a list of tags available

git tag

You have to checkout that tag by running

git checkout tags/59.0.3071.115

Then run these commands in the order listed below to pull all the third-party dependencies:

gclient sync
gclient sync --with_branch_heads
gclient runhooks

You can find the dev, beta, canary, latest and stable version info of Chromium from this page: https://chromiumdash.appspot.com/schedule

Now, you should be able to build Chromium. Let me know, if it works

Paul Rooney
  • 20,879
  • 9
  • 40
  • 61
Asesh
  • 3,186
  • 2
  • 21
  • 31
  • Other answers have you also do a `git checkout`. Can you explain why you only have to do a `fetch` and then `gclient sync`? – Ebsan Oct 03 '18 at 17:51
  • 2
    @WiteCastle You have to checkout that tag by running ``git checkout tags/59.0.3071.115``. Use ``git tag`` to show a list of tags available. That fetch command will just fetch the last commit of that branch, so it won't fetch the whole history. ``gclient sync`` will download the third party dependencies needed for Chromium to compile – Asesh Oct 04 '18 at 04:16
  • 1
    @Asesh Thank you so much. Your knowledge fill the last part of the picture. I finally automate the build of headless chrome and published on Docker HUB. https://hub.docker.com/r/microbox/chromium-headless – Ling Mar 05 '19 at 08:16
  • 3
    If using `--depth` flag with `git fetch`, make sure to use `--depth 4` or a reasonable number so that at least one commit in the history has `Cr-Commit-Position:` in the commit message. This metadata is necessary for the hooks (and build) to run successfully. – Alesandro Ortiz May 17 '22 at 20:07