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