Exclude build metadata from equality checking

Closes #12438