-
Notifications
You must be signed in to change notification settings - Fork 124
Create Crosswalk tarball
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.
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?
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).
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 "" by using git log
, for example.
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
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
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/xwalk/tools/upstream_revision.py \
-r `python -B -c 'exec(open(".gclient-xwalk").read()); print blink_upstream_rev'` \
-o src/xwalk/build/UPSTREAM.blink
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).