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