Oreo: building modules with mm is incredibly slow compared to nougat

1,395 views
Skip to first unread message

Jeffrey Blattman

unread,
Jan 10, 2018, 10:41:56 AM1/10/18
to Android Building
Here are some numbers. Same code, same makefile. This is from a non-clean, previously built module in both cases. So there should be nothing to do at all.

On Nougat

SetupWizard $ time mm
============================================
PLATFORM_VERSION_CODENAME=REL
... cut ...
============================================
make: Entering directory `...'
Running kati to generate build-d09ceb6bedfc4dba54e0e2e097f22474.ninja...
No need to regenerate ninja file
Starting build with ninja
ninja: Entering directory `.'
[100% 1/1] Ensure Jack server is installed and started
Jack server already installed in "/home/jeff/.jack-server"
Server is already running
Bad request, see Jack server log
make: Leaving directory `...'

#### make completed successfully (2 seconds) ####


real 0m2.146s
user 0m0.700s
sys 0m0.268s


On Oreo

SetupWizard $ time mm
make: Entering directory `...'
============================================
PLATFORM_VERSION_CODENAME=REL
... cut ...
============================================
[2/2] bootstrap out/soong/.minibootstrap/build.ninja.in
[1/1] out/soong/.bootstrap/bin/minibp out/soong/.bootstrap/build.ninja
[1/1] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
Clang SA is not enabled
No need to regenerate ninja file
[100% 1/1] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
Clang SA is not enabled
[100% 1/1] Ensuring Jack server is installed and started
Jack server already installed in "/home/jeff/.jack-server"
Server is already running
make: Leaving directory `...'

#### make completed successfully (23 seconds) ####


real 0m22.377s
user 1m4.048s
sys 0m9.104s

So on Oreo, it takes 22 seconds to perform a build that does nothing?

???
Thanks.

Jeffrey Blattman

unread,
Jan 18, 2018, 7:14:49 PM1/18/18
to Android Building
Some feedback here would be great to all of us that are struggling with this every day.

oliver wang

unread,
Feb 7, 2018, 11:46:47 PM2/7/18
to Android Building
I also have the same problem, any fix for this?

在 2018年1月19日星期五 UTC+8上午8:14:49,Jeffrey Blattman写道:

Quang Lam

unread,
Apr 4, 2018, 10:43:06 AM4/4/18
to Android Building
The strungle is real. When I use mmm command on Android 8.1, I spend a lot of time here:

[2/2] bootstrap out/soong/.minibootstrap/build.ninja.in
[1/1] out/soong/.bootstrap/bin/minibp out/soong/.bootstrap/build.ninja
[1/1] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja

in comparation with Android 7.1.

Jacob Abrams

unread,
Apr 4, 2018, 2:45:37 PM4/4/18
to Android Building
It's not a Google issue. If you checkout pure AOSP 8.1 and build it you will see performance of mm is fast. It's a problem with Qualcomm modifications to the build system. Search your build directory for the string "Fix Later" and run git blame.

Jacob

Dan Willemsen

unread,
Apr 4, 2018, 3:18:06 PM4/4/18
to Android Building
I do have some documentation posted on how to debug slow issues like this: https://android.googlesource.com/platform/build/soong/+/master/docs/perf.md -- It can definitely be caused by $(shell) commands in Android.mk files, but from the first log here, you may also be hitting a known issue: https://android.googlesource.com/platform/build/soong/+/master/docs/perf.md#android-8_1-oreo-mr1

You may find it faster to use `mma` rather than `mm` over time, since the results can be shared between more different invocations (though some of the regen and loading steps are slower).

- Dan

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Quang Lam

unread,
Apr 5, 2018, 12:13:55 PM4/5/18
to android-...@googlegroups.com
Thank you for your replies. I will check it out.

To post to this group, send email to android-building@googlegroups.com

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-building+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-building@googlegroups.com

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-building+unsubscribe@googlegroups.com.

Zoltan Kuscsik

unread,
Jul 26, 2018, 8:17:36 AM7/26/18
to Android Building
It may be not the perfect fix, but after you do a first time mm you can do a rebuild without regenerating the ninja files by:

prebuilts/build-tools/linux-x86/bin/ninja   -f out/build-<the_ninja_file_generated_after_first_mm>_Android.mk.ninja <module_name_derfined_in_Android.mk>


//Z
To post to this group, send email to android-...@googlegroups.com

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.

Dan Willemsen

unread,
Jul 26, 2018, 1:34:38 PM7/26/18
to Android Building
That will produce a different build than `m`, as the environment is
modified before we run ninja. Some versions of the build support `m
--skip-make` which does something similar, but with the correct
environment, and automatically choosing the correct files. Expect
things not to work properly however -- it's only remotely safe if
you've already run the command without it, and only modify source
files (no build files, no syncing, no adding/removing files, etc).

- Dan
Reply all
Reply to author
Forward
0 new messages