Sync of https://github.com/pantsbuild/pants/commit/e5cca4c1661235eedb4050db185f34c6edade820