This will be reimplemented in https://github.com/Homebrew/brew/pull/11955 but this allows us to merge the homebrew-core changes before that PR is merged. Closes https://github.com/Homebrew/brew/pull/11946
Co-authored-by: Nanda H Krishna <nanda.harishankar@gmail.com>