Generate build_id if one is not set.