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