We need to sort shared dependencies as well as env dependencies.