commit | 0850f7d9192fa5dda7030617a9d7d28d4ea91226 | [log] [tgz] |
---|---|---|
author | Colin Cross <ccross@android.com> | Mon Sep 14 15:11:45 2015 -0700 |
committer | Colin Cross <ccross@android.com> | Mon Sep 14 15:21:31 2015 -0700 |
tree | 83befb03e924e1f390d4c97557860bcc7c812edb | |
parent | 36b6582e5690f473f8ebbd6e255df92b955c696e [diff] |
Write .kati_stamp file atomically It is possible to get a mismatch between the .kati_stamp file and the build.ninja file by exiting due to error or interrupt after the ninja file is written but before the stamp file is written. If the change that caused the previous stamp file verification to fail are then reverted, for example an environment variable set back to what it was in the stamp file, the next run of kati could see the old stamp file and not rewrite the non-matching ninja file. To avoid stamp and ninja file mismatches, delete the old stamp file just before starting to write any new files. To avoid a partially written stamp file write the stamp file to .kati_stamp.tmp, and then atomically rename it to .kati_stamp. Change-Id: Id5c7d7ab2b7f051a430ebbf919b8535b219ca290
kati is an experimental GNU make clone. The main goal of this tool is to speed-up incremental build of Android.
Currently, kati does not offer a faster build by itself. It instead converts your Makefile to a ninja file.
Now AOSP has kati and ninja, so all you have to do is
% export USE_NINJA=true
All Android's build commands (m, mmm, mmma, etc.) should just work.
Set up kati:
% cd ~/src % git clone https://github.com/google/kati % cd kati % make
Build Android:
% cd <android-directory> % source build/envsetup.sh % lunch <your-choice> % ~/src/kati/m2n --kati_stats # Use --goma if you are a Googler. % ./ninja.sh
You need ninja in your $PATH.
% ./ninja.sh -t clean
Note ./ninja.sh passes all parameters to ninja.
For example, the following is equivalent to "make cts":
% ./ninja.sh cts
Or, if you know the path you want, you can do:
% ./ninja.sh out/host/linux-x86/bin/adb