Conversation

For anyone who ends up with an "argument list too long" error when trying to build Android: run ulimit -s 9999999 first. The maximum command line size on Linux is a percentage of the stack size ulimit.
4
144
Replying to and
I'm curious whether this is just an oversight in the build script. I recently ran into the "argument list too long" issue with my shell, and it was because I was using subshells instead of named pipes.
1
2
Replying to and
"Oversight" is a very kind way of putting "they NIH'd an utterly hideous build system just because they couldn't be bothered to understand how good existing ones are supposed to work".
3
10
Replying to and
AOSP build system is ninja, and that's not my experience with it. It chooses the number of jobs based on the number of hardware threads by default rather than opting in, so if you're comparing to using 1 thread that's relevant. CPU cgroup + SCHED_BATCH helps with this in general.
2
Replying to and
It's optimized for incremental builds for developers. It only generates the ninja files for the initial build, and then incrementally updates them if there are changes. It adds a couple minutes to a full build but building the entire OS from scratch already takes incredibly long.
2
1
Show replies
Signing a production release and generating the update package, delta update packages and factory images also takes a very long time. I definitely wouldn't want to be doing that as part of development. It's also a waste of time to actually flash an update, or even the images.
1
For development, the best way to test most changes is using userdebug builds, dynamically disabling dm-verity (which is possible on userdebug) and then using adb root && adb sync to sync over the changes incrementally. The ninja build takes a small fraction of the previous time.