resolve dependencies, clone if necessary