A generic dependency-resolution implementation.