Sync of https://github.com/pantsbuild/pants/commit/44043be01259257ebf18a09f50e5d825e4db83e9