commit | d325f591edfafc34167a2f23a2295c434136940b | [log] [tgz] |
---|---|---|
author | Dan Willemsen <dwillemsen@google.com> | Mon Oct 03 01:00:08 2016 -0700 |
committer | Dan Willemsen <dwillemsen@google.com> | Mon Oct 03 01:15:40 2016 -0700 |
tree | 4929f2383b643296a4bc1cdb560c5cbc12c34140 | |
parent | 5e45e973c38c92c42cc86aa5dafeca13e6823b5f [diff] |
Run regen commands sequentially When I remove --ignore-dirty=$(OUT_DIR)/% from an Android build, it turns out that we have $(shell) commands that have side effects and cannot be reordered in relationship to one another. The trivial case is a sequence of 'rm', 'write', 'write'..., 'cmp'. The 'rm' and 'write' commands can be collapsed into a single $(file) function call, but it still needs to be ordered for the 'cmp' function to work properly. I've been making changes to prevent this from slowing down regen too much, but it's still a 2-3x slowdown overall (0.3s -> 0.8s for aosp_arm64-eng on aosp master).
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