From 3e8100c7d2c7db32818d9c2050b061a2f62ca278 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 25 Nov 2024 09:06:52 +0100 Subject: [PATCH] CI macos: pkg-config install fix THe problem seems to be that there is preinstalled pkg-config@0.29.2 in CI but the version that is being to be installed is an alias for pkgconf. The problem seems to be cumbersome, because installing pkgconf fails, pkg-config as well (tries to install pkgconf 2.3.0; installed version of pkg-config is pkg-config@0.29.2). So made just a workaround, that will not be needed after the updated pkg-config (linked to pkgconf) applies to all macos runners (will be preinstalled). The problematic package is pkg-config in current macos-13 runner but pkg-config@0.29.2 in macos-14 image. --- .github/scripts/macOS/prepare.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/scripts/macOS/prepare.sh b/.github/scripts/macOS/prepare.sh index 0f4f88404..8af312850 100755 --- a/.github/scripts/macOS/prepare.sh +++ b/.github/scripts/macOS/prepare.sh @@ -31,14 +31,18 @@ echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig" >> "$GITHUB_ENV" echo "/usr/local/opt/qt/bin" >> "$GITHUB_PATH" echo "DYLIBBUNDLER_FLAGS=$DYLIBBUNDLER_FLAGS" >> "$GITHUB_ENV" -# Ensure that pkg-config is installed but unlinked. -# This is to prevent interference with pkgconf - both can be installed as -# a dependency of other packages so ensure a defined state (both installed; -# pkgconf installed and enabled later). -if ! brew list pkg-config 2>/dev/null; then +# TOREMOVE: temporal CI fix, remove after a short period (let say after 2024) +for n in $(brew list --formula -1 | grep -E '^(pkg-config(@.*)?|pkgconf)$'); do + brew uninstall "$n" +done +brew install pkg-config +# if pkg-config is not alias for pkgconf, install it for deps but unlink +if brew list pkg-config | grep -qv pkgconf; then + brew uninstall pkg-config + brew install pkgconf + brew unlink pkgconf brew install pkg-config fi -brew unlink pkg-config set -- \ asciidoctor \