Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Create Crosswalk tarball

Raphael Kubo da Costa edited this page Aug 22, 2016 · 5 revisions

This is a small set of instructions for creating a Crosswalk tarball from a git checkout. The generated tarball is around 300M in size, and does not contain huge items such as NaCl toolchains and Blink layout tests.

Prerequisites

A valuable suggestion is to use a git cache (a gclient concept, not a git one) to store the actual git checkouts, so that if you need to erase your entire src/ and start over the git directories will still be stored somewhere else and you will not need to download several gigabytes over the network again. In the example below, the git cache will be stored in /my/git/cache.

In addition to that, make sure you have carefully chosen the version you want to package: is it the latest master, or a certain release, or a branch snapshot?

Clone Crosswalk

Start by creating a new Crosswalk checkout.

$ gclient config --name src/xwalk --cache-dir /my/git/cache --unmanaged \
          https://github.com/crosswalk-project/crosswalk.git
$ gclient sync --nohooks

This will check out only src/xwalk but not the rest of the repositories. --unmanaged is being passed so that gclient will not try to switch your branch back to the original position in case you have to switch it to another commit (see the next point).

Optional: change Crosswalk revision

Running gclient config and gclient sync like the above will check out the latest version of Crosswalk's master branch. If you are creating a tarball, it is likely that you want to package a more stable version that corresponds to a certain "Bump version to X.Y.Z" commit.

For example, if you want to package a Crosswalk 13 beta like 13.42.319.10, you need to switch to the appropriate branch.

$ cd src/xwalk
$ git checkout -b crosswalk-13 origin/crosswalk-13
$ git reset --hard <the hash you want>
$ cd ../..

You can find out the value of "<the hash you want>" by using git log, for example.

Generate .gclient-xwalk

Since we do not run Crosswalk's hooks, we need to run some commands manually. One of them generates .gclient-xwalk, which contains all the other repositories that need to be checked out.

Important: Make sure you do not have the XWALK_OS_ANDROID environment variable set to 1, otherwise several big Android repositories will be checked out and make the tarball needlessly bigger.

XWALK_OS_ANDROID=0 python src/xwalk/tools/generate_gclient-xwalk.py

Fetch the additional repositories

This is when chromium-crosswalk, blink-crosswalk and others are checked out. Again, we do not want to run any hooks, otherwise big things like NaCl's toolchains will be downloaded and make the tarball larger.

gclient sync --nohooks --gclientfile=.gclient-xwalk

Generate UPSTREAM.blink

This file is used for remote debugging to work with Crosswalk. It is generated automatically by one hook in .gclient-xwalk, but since we do not run hooks we need to call it automatically. The line below is a way to run a single command without having to inspect the file to know blink_upstream_rev's value:

python src/build/util/lastchange.py \
       --git-hash-only \
       --source-dir src/third_party/WebKit \
       --output src/xwalk/build/UPSTREAM.blink

Note that this is only possible with Crosswalk >= 17. Versions prior to Crosswalk 16 need to use the tools/upstream_revision.py script in src/xwalk, while Crosswalk 16 itself needs --git-svn-go-deeper instead of --git-hash-only. If in doubt, take a look at the respective hook in src/xwalk/DEPS.xwalk.

Create the tarball

After everything is done, it is time to finally generate our tarball. We use Chromium's export_tarball.py script for that. Given a file name like "foo", it will create a file called "foo.tar.xz" with everything in src/ except for useless things such as layout tests.

python src/tools/export_tarball/export_tarball.py \
       --basename crosswalk-13.42.319.10/ \
       --progress --remove-nonessential-files \
       crosswalk-13.42.319.10

The --basename part is very important (including the trailing "/"), otherwise all the files in the tarball will be archived without a root directory. The whole process takes from 10 to 15 minutes.

The --progress option requires a utility called pv to be installed first. If you do not need progress information, you can leave it out. If you do use it, you should remove the .tar file generated at the end as it is has no use (it is removed automatically if --progress is not used).

Clone this wiki locally