Skip to content

Commit 7fa7edd

Browse files
committed
ci: Minor fix so that if gettext/libsodium is cached, don't warn
Previously when we try to set up a cached package, Homebrew generates an annoying "already installed, it's just not linked" warning which is distracting when parsing CI logs. Just make sure to run `brew install` if we don't have the package cached. Note that when a package is not cached and we have to rebuild it, Homebrew will still warn needlessly because we have HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK set. This is mostly ok because most of the time our packages should be cached in CI.
1 parent fd1c3fc commit 7fa7edd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/actions/universal-package/action.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ runs:
7272
# which cause brew install to return non-zero and fail the build.
7373
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
7474
75-
# This will be a no-op if formula was cached
76-
brew install --quiet --formula -s ./${formula}.rb
75+
# This will be a no-op if formula was cached. We check if the package
76+
# exists first just to avoid an "already installed" warning.
77+
brew list ${formula} &>/dev/null || brew install --quiet --formula -s ./${formula}.rb
7778
7879
# If formula was cached, this step is necessary to relink it to brew prefix (e.g. /usr/local)
7980
brew unlink ${formula} && brew link ${formula}

0 commit comments

Comments
 (0)