I'm building AOSP11 and building on Ubuntu 18.04 and early in the build process I get the following error:
soong bootstrap failed with: exit status 1
It fails during this step:
out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
It runs for about 1:15 and then the entire system hangs. When running the system performance monitor I see that all available CPU (all cores) and memory is used at the point it hangs. Dmesg shows an out-of-memory error.
[ 18984] 637467462 18984 655554 79950 1187840 0 0 soong_uiJun 22 18:13:11 u4002491698b25b kernel: [30273.095111] [ 20075] 637467462 20075 7301 94 102400 0 0 nsjail
Jun 22 18:13:11 u4002491698b25b kernel: [30273.095113] [ 20076] 637467462 20076 18361 1104 131072 0 0 ninja
Jun 22 18:13:11 u4002491698b25b kernel: [30273.095114] [ 22876] 637467462 22876 1159 17 53248 0 0 sh
Jun 22 18:13:11 u4002491698b25b kernel: [30273.095116] [ 22877] 637467462 22877 3498675 3378317 27357184 0 0 soong_build
Jun 22 18:13:11 u4002491698b25b kernel: [30273.095116] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/,task=soong_build,pid=22877,uid=637467462
Jun 22 18:13:11 u4002491698b25b kernel: [30273.095187] Out of memory: Killed process 22877 (soong_build) total-vm:13994700kB, anon-rss:13513268kB, file-rss:0kB, shmem-rss:0kB, UID:637467462 pgtables:26716kB oom_score_ad
Searching the web shows that I should try using a lower -j value. I tried using -j1 or -j2 but the error still occurs. Sometimes, it will complete if I try it over and over again but the number of times varies.
I'm using make 4.1 and have 16 GB of RAM. Builds are performed on an SSD via a gnome terminal.
I've tried removing the entire "out" directory along with "make clean" and nothing seems to help.
Would more memory help?
EDIT: The following is from verbose.log.1 and shows the failing command:
[221/221] 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.