This section describes the process that abuild uses to
construct the build set. First, abuild creates a list of build
items that directly match the criteria of the specified build
set. If --only-with-traits was specified, only
build items that match the build set criteria and have all of the
named traits are included.
Next, if we are building (as opposed to cleaning) or if the
--apply-targets-to-deps option has been
specified (even if we are cleaning), the build set is expanded to
include all dependencies of any items already in the build set.
Then, if --related-by-traits has been specified,
abuild gathers up a list of all items that have all of the
traits listed in the --related-by-traits option
and that declare at least one of those traits referent to one of
the build items in the build set so far. As it finds them, it
adds them to the build set. Once that process has completed, if
we are building or --apply-targets-to-deps was
specified, abuild once again expands the build set to include
the dependencies of all items that are in the build set.
Note that we do not take a second pass at expanding the build set
based on traits specified with
--related-by-traits. Usually this won't matter,
but there are some cases in which it does actually make a
difference. For example, suppose the original build set contains
A and B, and that
AC-test is declared as a tester of item
A, which is in the build set, and also of
item C which is not in the build set. If
we are adding items related by the tester
trait, the AC-test build item will be
added to the build set. Assuming AC-test
depends on C, then
C will also be added to the build set.
Now if there is another build item called
C-test that tests
C, it will not be
added to the build set because the item that it tests was not an
original member of the build set. This situation is reproduced
in abuild's test suite.