2

The guide Initializing a Build Environment says that -

Note: The source download is approximately 8.5GB in size. You will need over 30GB free to complete a single build, and up to 100GB (or more) for a full set of builds.

My questions -

  1. As I understand at this point vendor specific applications and graphics are not there in the repository and it basically contains kernel source, generic drivers and basic tools. Why then is it such a large size?
  2. Why on earth would I need 100GB to build it?
  3. Is it possible to obtain a compressed source tarball?
6
  • 1
    All branches, all history are downloaded when you clone the repo. The size of working directory is smaller.
    – Ryan Li
    Feb 22, 2013 at 4:02
  • 1
    @RyanLi Do you happen to know the working directory size? And why it takes 30-100GB to build? Feb 22, 2013 at 4:09
  • Sorry I don't have that handy.
    – Ryan Li
    Feb 22, 2013 at 4:22
  • 1
    The source code for Android 4.0, for example, is only around ~60MB. (repository.grepcode.com/java/ext/com/google/android/android/…) Feb 22, 2013 at 4:45
  • 1
    @OlegVaskevich The link you posted is Android Java SDK Source. I am talking about Android Linux Source. There is no way that could be 60MB since the core Linux kernel 3.7 at kernel.org itself is 477MB (uncompressed). Feb 22, 2013 at 4:53

1 Answer 1

5

Ryan Li provided part of the answer by stating that you are downloading all of the repositories' histories. That tends to add up over time and make the initial download of all the sources take up a rather large amount of space.

A few reasons (not an exhaustive list by any means) for the build taking up so much space:

  • There are a lot of sources that generate a lot of object files, libraries, dex, etc. that are used to build up the final images. With C/C++ toolchains, the linker can throw away sections of objects files that aren't used in a given executable. That in addition to the fact that object files tend to contain a lot of extra information about the various section almost always means that your object files added together are going to be larger than any executable you build.
  • In addition to the object files, you have the libraries and executables themselves in the output (intermediate) directories.
  • In addition to the above two, you have the filesystem images that are generated.
  • I'm not a Java build expert, but I'm guessing there are intermediate files to get to the resulting .dex files.
  • If you want to do a full set of builds, you are going to multiply a normal user build (~30GB) by at least three plus some more (other packages get included in eng and userdebug build types).

If you want a lot more detailed answer, I'd suggest downloading the sources, doing a build, and running a disk space analyzer tool on it (don't have a build handy to do that on at the moment).

1
  • 1
    is there somewhere to find a tarball of it so you don't have all that redundancy? I just want to build a custom linker.
    – Wyatt Ward
    Jul 30, 2015 at 3:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.