Sync of https://github.com/pantsbuild/pants/commit/15c9cd5e29e7577175c272cb9c3013aa0db4d6f1