Issue building AOSP with docker running on Mojave

753 views
Skip to first unread message

6020peaks /\/\/\

unread,
May 14, 2020, 12:30:19 PM5/14/20
to Android Building
Hi,

I wonder if anyone tried to build the master branch of AOSP using a Docker container with Ubuntu 18.04 running on Mojave. If I compare the process with a Docker container running on Linux, on Mac it is way slower. And also the following issue appears when building. Any clue of what might be happening?

Thanks!

07:58:34 Build sandboxing disabled due to nsjail error.

============================================

PLATFORM_VERSION_CODENAME=S

PLATFORM_VERSION=S

TARGET_PRODUCT=aosp_x86_64

TARGET_BUILD_VARIANT=eng

TARGET_BUILD_TYPE=release

TARGET_ARCH=x86_64

TARGET_ARCH_VARIANT=x86_64

TARGET_2ND_ARCH=x86

TARGET_2ND_ARCH_VARIANT=x86_64

HOST_ARCH=x86_64

HOST_2ND_ARCH=x86

HOST_OS=linux

HOST_OS_EXTRA=Linux-4.19.76-linuxkit-x86_64-Ubuntu-18.04.4-LTS

HOST_CROSS_OS=windows

HOST_CROSS_ARCH=x86

HOST_CROSS_2ND_ARCH=x86_64

HOST_BUILD_TYPE=release

BUILD_ID=AOSP.MASTER

OUT_DIR=out

============================================

[100% 39/39] 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

Killed

08:00:37 soong bootstrap failed with: exit status 1

ninja: build stopped: subcommand failed.


#### failed to build some targets (03:48 (mm:ss)) ####

Dan Willemsen

unread,
May 14, 2020, 2:16:36 PM5/14/20
to Android Building
How much RAM have you given docker? `free -h` shows how much is available. IIRC, unlike on linux, because docker on Mac is a VM, it can't grow to use as much as necessary. Our docs list 16GB as the minimum available to the build.

- 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/dc5e8f99-b0b8-46e2-9701-4f39f0f3dc13%40googlegroups.com.

6020peaks /\/\/\

unread,
May 15, 2020, 12:27:38 PM5/15/20
to android-...@googlegroups.com
Thanks Dan! So I had a few issues which I enumerate below, so that this can be useful for the next one hitting the wall like I did:
0. I created a case-sensitive volume on Mac that I shared with the docker container.
1. I had to run the docker container with --privileged as suggested here: https://issuetracker.google.com/issues/123210688 I was getting the famous "nsjail error".
2. I added extra RAM to Docker Desktop on Mac to avoid the build process being killed by the host.
3. For some reason the build would stop after 30 minutes. I did a `repo sync` and then it started to build passing that time.

For the sake of comparing, the build is now at 44% after running longer than 12 hours. The performance is quite poor in comparison to Docker running on Linux. I read that this can be due to the I/O and the fact that I shared a volume with the host OS. I didn't try this setup on Windows, but I expect the same behavior. Definitely Linux is the way to go as recommended everywhere.

Reply all
Reply to author
Forward
0 new messages