New experimental build system feature: out/ directories in another location

860 views
Skip to first unread message

Jean-Baptiste Queru

unread,
Jan 6, 2012, 11:45:55 AM1/6/12
to android-...@googlegroups.com
Following some interesting discussions about how to speed up the build
time, we've implemented a new feature in the build system, that allows
storing the out/ directories away from the source tree. This is only
implemented in the master tree.

This should be useful when storing the build output on a physically
different volume. Additional benefits might come from using a
dedicated volume for that where journaling is disabled, and/or from
using an SSD.

To use it, set the OUT_DIR_COMMON_BASE environment to the directory
where the output directories will be created. A subdirectory will be
created there for each source tree. The name of the subdirectory
matches that of the source tree.

As an example, if you have your source trees in
/usr/local/android-src/master1 and /usr/local/android-src/master2 and
you set OUT_DIR_COMMON_BASE to /ssd/android-out, the output
directories will be /ssd/android-out/master1 and
/ssd/android-out/master2

Note that only the leaf directory name of the source tree is used, and
that no attempt is made at resolving collisions. If you have e.g.
/usr/local/android/master and /home/me/android-src/master and you use
OUT_DIR_COMMON_BASE, the two source tree will attempt to use the same
out/ directory and things won't be pretty. Don't do that.

This has been tested to work when creating images that get flashed
with fastboot, and with the emulator. It's possible that other tools
might have hard-coded the classic path to the out/ directory.

We'd like to hear feedback about whether this is useful, and about
bugs that might exist when using OUT_DIR_COMMON_BASE.

Thanks,
JBQ

--
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

Jesse Godsey

unread,
Jan 6, 2012, 12:26:14 PM1/6/12
to android-...@googlegroups.com

Absolutely awesome, separate out that io activity. 

--
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

Cédric Cabessa

unread,
Jan 7, 2012, 12:47:45 PM1/7/12
to android-...@googlegroups.com
2012/1/6 Jean-Baptiste Queru <j...@android.com>:

> To use it, set the OUT_DIR_COMMON_BASE environment to the directory
> where the output directories will be created. A subdirectory will be
> created there for each source tree. The name of the subdirectory
> matches that of the source tree.
...

> We'd like to hear feedback about whether this is useful, and about
> bugs that might exist when using OUT_DIR_COMMON_BASE.
>

Hi,

I used to set the OUT variable to do something similar (not for perf,
I simply use ../out in order to have src and binary at the same level,
this make find and grep easier).
For my part, I have only one source tree, but I am wondering what's
the big advantage of OUT_DIR_COMMON_BASE, except that now we can use
the same name in all source tree ?

--
Cédric

Jean-Baptiste Queru

unread,
Jan 9, 2012, 10:39:53 AM1/9/12
to android-...@googlegroups.com
It's really about having multiple source trees. Things grow up
quickly. one release branch and one dev branch for each of froyo,
gingerbread and icecreamsandwich, plus a master branch, and you're
already using 7 clients at the same time, without even doing anything
fancy. With OUT_DIR_COMMON_BASE you just need to set a single
environment variable once and not have to worry about it.

JBQ

> --
> 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

--

Reply all
Reply to author
Forward
0 new messages