How to avoid soong_build run in every build

8,607 views
Skip to first unread message

Mikael Björklund

unread,
Apr 12, 2021, 11:52:22 AM4/12/21
to Android Building
I have an AOSP tree were out/soong/.bootstrap/bin/soong_build out/soong/build.ninja always reruns, I have another AOSP tree were it only ran for the first build.

I am on the limit when it comes to RAM so I need to close down all processes in order to have a chance for the build to pass:
[100% 1770/1770] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
out/soong/.bootstrap/bin/soong_build -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/build.ninja.d -globFile out/soong/.bootstrap/build-globs.ninja -o out/soong/build.ninja Android.bp
Clang SA is not enabled
Killed
06:03:27 soong bootstrap failed with: exit status 1
ninja: build stopped: subcommand failed.

#### failed to build some targets (01:08 (mm:ss)) ####

Is there a way to avoid this memory consuming step to run for every build?

Thanks in advance

ed21...@gmail.com

unread,
Apr 13, 2021, 11:08:34 AM4/13/21
to android-...@googlegroups.com

Hello Mikael,

 

If you are correct in assuming that there is not enough RAM available. You can sometimes see around 4GB of RAM usage per CPU core at build process. As an example, with 4 cores and the OS, you need 4x4GB+2GB RAM for the build system.

If your system is low on RAM, use "make -j4" and change the number of CPU cores to match the availability of RAM. And if possible start the build after „make clobber“ (cleanup the build).

 

This was my pain with my first times to build. It just caused aborts at various points. I build on Ubuntu 20.4 LTS in a VM (Hyper-V), 18GB RAM and 4 Cores. The VM Host runs with installed 32GB RAM.

 

Best regards

Ed

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/62e9b15a-cb3d-45f3-b748-42493950016en%40googlegroups.com.

Dan Willemsen

unread,
Apr 13, 2021, 2:45:10 PM4/13/21
to Android Building
Clang SA is not enabled

This isn't an AOSP tree.

My guess is that either an Android.bp, environment variable, or other file/directory soong_build reads is changing every build, but since you have some custom changes to the build system, I can't say for certain. You can check out/soong.log and compare timestamps of the files in out/soong/build.ninja.d to see what's triggering soong_build to run.

- Dan

--
Reply all
Reply to author
Forward
0 new messages