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