ci/macos: fix possible issue during brew install (#12767)

```
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /opt/homebrew
Could not symlink bin/pkg-config
Target /opt/homebrew/bin/pkg-config
is a symlink belonging to pkg-config@0.29.2. You can unlink it:
  brew unlink pkg-config@0.29.2

To force the link and overwrite all conflicting files:
  brew link --overwrite pkgconf

To list all files that would be deleted:
  brew link --overwrite pkgconf --dry-run

Possible conflicting files are:
/opt/homebrew/bin/pkg-config -> /opt/homebrew/Cellar/pkg-config@0.29.2/0.29.2_3/bin/pkg-config
/opt/homebrew/share/aclocal/pkg.m4 -> /opt/homebrew/Cellar/pkg-config@0.29.2/0.29.2_3/share/aclocal/pkg.m4
/opt/homebrew/share/man/man1/pkg-config.1 -> /opt/homebrew/Cellar/pkg-config@0.29.2/0.29.2_3/share/man/man1/pkg-config.1
```

This only happen with AMD64 runners, and when using the latest runner images
(e.g. when the luck of the draw yields 14.7.1 23H222 and not 14.7 23H124).
This commit is contained in:
Benoit Pierre
2024-11-21 08:47:31 +01:00
committed by GitHub
parent 93f2fa6702
commit 0debdf0216

View File

@@ -77,7 +77,7 @@ jobs:
# Remove some installed packages to prevent brew
# from attempting (and failing) to upgrade them.
brew uninstall gradle maven
brew install --formula --quiet "${packages[@]}"
brew install --formula --overwrite --quiet "${packages[@]}"
- name: Update PATH
run: >