Search code examples
androidmakefileandroid-sourceninjaandroid-soong

how to make Soong and Kati translate ninja rules in parallel?


Android build system has Soong and Kati where:

  • Soong translates .bp file to .ninja files
  • Kati translates .mk files to .ninja files

When profiling the AOSP build time with soong_ui, I saw these translation processes occurred sequentially which I don't think is necessary? - Is that possible to make the two translation process run in parallel?

Cited from here: https://android.googlesource.com/platform/build/soong/+/HEAD/docs/perf.md


Solution

  • turns out it's not always feasible to run Soong and Kati in parallel at least at the current stage with Android 10. The reason being a .mk file can depend on a .bp file so Soong has to translate those dependency .bp first before Kati can translate all .mk files to generate build rules.