29.4. Computing Valid Traits

The way in which abuild determines the list of traits that are valid for items in a particular build tree has some subtleties with respect to backing areas and externals. In particular, it is possible to have a build tree actually remove traits from the list of valid traits declared in its backing area.

To construct the list of valid traits for a build tree, abuild creates the union of the supported traits declared in a tree's own root Abuild.conf with those in any of its externals. Backing areas are not consulted since the assumption is that a build tree's root Abuild.conf generally starts out as a copy of the one from its backing area and therefore initially lists the same traits. There is one notable case in which the assumption does not apply: when an external is resolved from a backing area. [49] We handle that case specially in order to include that external's traits. When an external is resolved from a backing area, abuild internally creates a build tree object that has no root build item. In this case alone, abuild copies the list of supported traits from that tree's backing area. Since such a build tree can, by its very nature, never have any local build items, the effect of this is that the resolved external is treated identically to any actual external that actually exists at its specified location. This makes externals that are resolved to backing areas behave properly with respect to traits. The corner cases of this logic are exercised in abuild's test suite. It also makes it possible to remove traits that were present in your backing area by simply removing them from your own build tree's root Abuild.conf.



[49] Such an external shows up in abuild's --dump-data output (see Appendix C, --dump-data Format) with the backed="1" attribute.