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