The main out/soong/build.ninja file is too large, making localhost compilation difficult

126 views
Skip to first unread message

Yuxin Hu

unread,
Sep 28, 2022, 3:01:10 PMSep 28
to Android Building
Android 13

PLEASE READ:

Our colleagues are developing on Android 13 and often encounter the problem of compilation process interruption during compilation。

soong_build process returns abnormally shortly after compilation

```
Killed
19:51:22 soong bootstrap failed with: exit status 1
```

The information that can be obtained by analyzing the `dmesg` log of the host is that the soong_build process was killed because of Out of memory. 
20220926-151825.png

After analysis, we believe that one of the main reasons for this problem at the beginning of compilation is that out/soong/build.ninja is too large, which leads to out of memory.

```
huyuxin@nj-builder-01:~/missi_t_qcom/out$ cat combined-missi_phone_cn.ninja

builddir = out
pool highmem_pool
 depth = 31
subninja out/build-missi_phone_cn.ninja
subninja out/build-missi_phone_cn-package.ninja
subninja out/soong/build.ninja
huyuxin@nj-builder-01:~/missi_t_qcom/out$
huyuxin@nj-builder-01:~/missi_t_qcom/out$ ls -lh build-missi_phone_cn.ninja
-rw-rw-r-- 1 huyuxin huyuxin 1.2G Sep 26 14:41 build-missi_phone_cn.ninja
huyuxin@nj-builder-01:~/missi_t_qcom/out$ ls -lh build-missi_phone_cn-package.ninja
-rw-rw-r-- 1 huyuxin huyuxin 43K Sep 26 10:08 build-missi_phone_cn-package.ninja
huyuxin@nj-builder-01:~/missi_t_qcom/out$ ls -lh soong/build.ninja
-rw-rw-r-- 1 huyuxin huyuxin 22G Sep 26 14:36 soong/build.ninja
```

On my host this file size is over 20 GB,My source code is from Qualcomm's distribution. The file may not be this large on the AOSP distribution.

Usually the memory on our developer's work host is not very rich, usually around 32GB.

Can we crop or split this file so that it can be easily compiled locally to verify some module issues? For example framework.jar services.jar Settings.apk etc.

(Our current workaround is to increase the size of the host's swap space, which results in a slow compilation process)

Thx !

Reply all
Reply to author
Forward
0 new messages