'Follow dependent links and find the root of this spec\'s DAG.
In spack specs, there should be a single root (the package being
installed).  This will throw an assertion error if that is not
the case.'

@property
def root(self):

    if (not self._dependents):
        return self
    depiter = iter(self._dependents.values())
    first_root = next(depiter).parent.root
    assert all(((first_root is d.parent.root) for d in depiter))
    return first_root
