17

Google introduced Soong build system the replacement of old makefile system.

Have any idea about how it works? What is this Android.bp in the sources?

peterh
  • 11,875
  • 18
  • 85
  • 108
Midhun PM
  • 512
  • 1
  • 7
  • 24

3 Answers3

22
  1. ninja is the new build tools for aosp, which using *.ninja to work;
  2. for the legacy Android.mk, kati is applied to transform Androd.mk to *.ninja;
  3. google is now using Android.bp file to describe module compile details, which is also transformed to *.ninja by blueprint/soong;
  4. after all Android.mk is rewrite to Android.bp, kati will be removed, and we will have blueprint/soong/ninja only;

as this link explains.

oscarthecat
  • 1,811
  • 1
  • 18
  • 28
13

Only Googlers can probably explain, some basic documentation is here:

https://android.googlesource.com/platform/build/soong/

Try search Google groups as well:

https://groups.google.com/forum/#!topic/android-building/0Hy7kLwlBBk

Note that in Oreo Android.mk files continue to work and can depend on Android.bp files, however Android.bp files cannot depend on Android.mk files. Apparently more and more of the build system will be converted to Android.bp as time goes on, hopefully Google does a better job with documentation.

UPDATE Jan 2020

More info added by Google here: https://source.android.com/setup/build/index

satur9nine
  • 13,927
  • 5
  • 80
  • 123
7

Soong build system is equivalent to legacy "Android make build system". Therefore Soong is collection of program, which are recipes "how to build hundreds of android modules" with lots of small tools.

Ninja is a process to really handle the final build manifest(Build.ninja) which is made by Blueprint or Kati (translate Android.mk to Android.bp).

Blueprint is like GNU Make grammar, so called "framework for build system". it made by Go language, hence it better provides multi-processing. Blueprint translate "hand-writing build manifest"(*.bp) to final manifest(build.ninja) which is ninja format.

OfusJK
  • 676
  • 1
  • 5
  • 13
  • 3
    Even this description, I don't agree introducing Soong/Blueprint/Ninja. it is a hell of knowledge-fragments ruin traditional build system (make & shell ..). Still under improving by Google and still annoying developers. Why google does not take over and improve traditional well working system. – OfusJK Jun 19 '18 at 03:41
  • According to my understanding, it's because of the performance. If they don't move traditional makefile system to ninja, android&chrome SW building system take tooo long time to finish one time system building, engineers couldn't endure it. And because ninja is only fucsed on how to distribute the tasks to different CPU cores, so google also need design soong&ckati to translate *.bp&*.mk files to *.ninja. Their final target is improving performance, sometimes, designing a new system is much easier than improving an old system. – Clock ZHONG Nov 18 '20 at 02:39
  • @OfusJK Message from the future: 1.5 years later and practically nothing changed. Meanwhile, fastboot will be likely removed from the next debian release because not even the deb developers could compile it (without compiling a whole android release together). – peterh Jan 05 '21 at 20:03
  • 1
    @ClockZHONG Make is very fast, close to the theoretical maximum. It parallelizes automatically. Already ninja was unneeded. Just correct Makefile-s should be produced, and instead of the disastrous "git-repo" tool, a well-defined subset of packages - depending as a DAG on each other - should have been created. The Linux kernel developers did it well. The Linux distributions do it well. Only Google does horrible work. They have probably an incompetent boss syndrome (starting a new project sounds always better on the meetings than improving an existing one). – peterh Jan 05 '21 at 20:07