Skip to content

Commit

Permalink
CI: Force-remove pkg-config on macOS runners and install pkgconf
Browse files Browse the repository at this point in the history
Homebrew has effectively deprecated the pkg-config formula and instead
aliased pkgconf to that name.

Installing pkg-config via the Brewfile thus leads to Homebrew
attempting to install pkgconf instead, which will fail because the
(older) pkg-config formula is installed by default on macOS runners.
  • Loading branch information
PatTheMav committed Dec 12, 2024
1 parent 994fbc4 commit 9c1930d
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ brew "libtool"
brew "meson"
brew "nasm"
brew "ninja"
brew "pkg-config"
brew "pkgconf"
56 changes: 29 additions & 27 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
ffmpeg-macos-build:
name: Build FFmpeg for macOS
runs-on: macos-14
runs-on: macos-15
needs: pre-checks
strategy:
fail-fast: true
Expand All @@ -78,19 +78,20 @@ jobs:
- name: Setup Environment
id: setup
run: |
print '::group::Enable Xcode 15.2'
sudo xcode-select --switch /Applications/Xcode_15.2.app/Contents/Developer
print '::group::Enable Xcode 16.1'
sudo xcode-select --switch /Applications/Xcode_16.1.0.app/Contents/Developer
print '::endgroup::'
local -a to_remove=()
for formula (llvm gcc postgresql openjdk sox libsndfile flac libvorbis opusfile \
local -a unwanted_formulas=(llvm gcc postgresql openjdk sox libsndfile flac libvorbis opusfile \
libogg composer php gd freetype fontconfig webp libpng lame libtiff opus kotlin \
sbt libxft libxcb) {
if [[ -d /usr/local/opt/${formula} ]] to_remove+=(${formula})
sbt libxft libxcb [email protected])
local -a remove_formulas=()
for formula (${unwanted_formulas}) {
if [[ -d ${HOMEBREW_PREFIX}/Cellar/${formula} ]] remove_formulas+=(${formula})
}
if (( #to_remove )) brew uninstall --ignore-dependencies ${to_remove}
if (( #remove_formulas )) brew uninstall --ignore-dependencies ${remove_formulas}
local -r date_string=$(date +"%Y-%m-%d")
local -r target='${{ matrix.target }}'
Expand Down Expand Up @@ -190,7 +191,7 @@ jobs:

ffmpeg-package-universal:
name: Build FFmpeg (Universal)
runs-on: macos-14
runs-on: macos-15
needs: [pre-checks, ffmpeg-macos-build]
steps:
- name: Checkout
Expand All @@ -214,7 +215,7 @@ jobs:

macos-build:
name: Build macOS Dependencies
runs-on: macos-14
runs-on: macos-15
needs: pre-checks
strategy:
fail-fast: true
Expand All @@ -238,18 +239,18 @@ jobs:
id: setup
run: |
: Setup Environment
print '::group::Enable Xcode 15.2'
sudo xcode-select --switch /Applications/Xcode_15.2.app/Contents/Developer
print '::group::Enable Xcode 16.1'
sudo xcode-select --switch /Applications/Xcode_16.1.0.app/Contents/Developer
print '::endgroup::'
to_remove=()
local -a unwanted_formulas=(llvm gcc [email protected])
for formula (llvm gcc) {
if [[ -d /usr/local/opt/"${formula}" ]] to_remove+=(${formula})
local -a remove_formulas=()
for formula (${unwanted_formulas}) {
if [[ -d ${HOMEBREW_PREFIX}/Cellar/${formula} ]] remove_formulas+=(${formula})
}
if (( #to_remove )) brew uninstall --ignore-dependencies ${to_remove}
if (( #remove_formulas )) brew uninstall --ignore-dependencies ${remove_formulas}
local -r date_string=$(date +"%Y-%m-%d")
local -r target='${{ matrix.target }}'
Expand Down Expand Up @@ -304,7 +305,7 @@ jobs:

macos-package-universal:
name: Build macOS Dependencies (Universal)
runs-on: macos-14
runs-on: macos-15
needs: [pre-checks, macos-build]
steps:
- name: Checkout
Expand All @@ -328,7 +329,7 @@ jobs:

macos-qt6-build:
name: Build Qt6 (macOS)
runs-on: macos-14
runs-on: macos-15
needs: pre-checks
defaults:
run:
Expand All @@ -341,17 +342,18 @@ jobs:
id: setup
run: |
: Setup Environment
print '::group::Enable Xcode 15.2'
sudo xcode-select --switch /Applications/Xcode_15.2.app/Contents/Developer
print '::group::Enable Xcode 16.1'
sudo xcode-select --switch /Applications/Xcode_16.1.0.app/Contents/Developer
print '::endgroup::'
local -a to_remove=()
local -a unwanted_formulas=(llvm gcc [email protected])
for formula (llvm gcc) {
if [[ -d /usr/local/opt/"${formula}" ]] to_remove+=(${formula})
local -a remove_formulas=()
for formula (${unwanted_formulas}) {
if [[ -d ${HOMEBREW_PREFIX}/Cellar/${formula} ]] remove_formulas+=(${formula})
}
if (( #to_remove )) brew uninstall --ignore-dependencies ${to_remove}
if (( #remove_formulas )) brew uninstall --ignore-dependencies ${remove_formulas}
local -r date_string=$(date +"%Y-%m-%d")
artifact_name="qt6-macos-universal-${{ needs.pre-checks.outputs.shortHash }}"
Expand Down Expand Up @@ -403,7 +405,7 @@ jobs:

macos-qt6-package:
name: Create macOS Qt6 (${{ matrix.target }})
runs-on: macos-14
runs-on: macos-15
strategy:
fail-fast: true
matrix:
Expand Down
49 changes: 26 additions & 23 deletions .github/workflows/scheduled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
ffmpeg-macos-build:
name: Build FFmpeg for macOS
runs-on: macos-14
runs-on: macos-15
needs: cache-cleanup
strategy:
fail-fast: true
Expand All @@ -99,19 +99,20 @@ jobs:
id: setup
run: |
: Setup Environment
print '::group::Enable Xcode 15.2'
sudo xcode-select --switch /Applications/Xcode_15.2.app/Contents/Developer
print '::group::Enable Xcode 16.1'
sudo xcode-select --switch /Applications/Xcode_16.1.0.app/Contents/Developer
print '::endgroup::'
local -a to_remove=()
for formula (llvm gcc postgresql openjdk sox libsndfile flac libvorbis opusfile \
local -a unwanted_formulas=(llvm gcc postgresql openjdk sox libsndfile flac libvorbis opusfile \
libogg composer php gd freetype fontconfig webp libpng lame libtiff opus kotlin \
sbt libxft libxcb) {
if [[ -d /usr/local/opt/${formula} ]] to_remove+=(${formula})
sbt libxft libxcb [email protected])
local -a remove_formulas=()
for formula (${unwanted_formulas}) {
if [[ -d ${HOMEBREW_PREFIX}/Cellar/${formula} ]] remove_formulas+=(${formula})
}
if (( #to_remove )) brew uninstall --ignore-dependencies ${to_remove}
if (( #remove_formulas )) brew uninstall --ignore-dependencies ${remove_formulas}
local -r date_string=$(date +"%Y-%m-%d")
print "ccacheDate=${date_string}" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -160,7 +161,7 @@ jobs:

macos-build:
name: Build macOS Dependencies
runs-on: macos-14
runs-on: macos-15
needs: cache-cleanup
strategy:
fail-fast: true
Expand All @@ -184,17 +185,18 @@ jobs:
id: setup
run: |
: Setup Environment
print '::group::Enable Xcode 15.2'
sudo xcode-select --switch /Applications/Xcode_15.2.app/Contents/Developer
print '::group::Enable Xcode 16.1'
sudo xcode-select --switch /Applications/Xcode_16.1.0.app/Contents/Developer
print '::endgroup::'
to_remove=()
local -a unwanted_formulas=(llvm gcc [email protected])
for formula (llvm gcc) {
if [[ -d /usr/local/opt/"${formula}" ]] to_remove+=(${formula})
local -a remove_formulas=()
for formula (${unwanted_formulas}) {
if [[ -d ${HOMEBREW_PREFIX}/Cellar/${formula} ]] remove_formulas+=(${formula})
}
if (( #to_remove )) brew uninstall --ignore-dependencies ${to_remove}
if (( #remove_formulas )) brew uninstall --ignore-dependencies ${remove_formulas}
local -r date_string=$(date +"%Y-%m-%d")
print "ccacheDate=${date_string}" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -291,7 +293,7 @@ jobs:

macos-qt6-build:
name: Build Qt6 (macOS)
runs-on: macos-14
runs-on: macos-15
needs: cache-cleanup
defaults:
run:
Expand All @@ -304,17 +306,18 @@ jobs:
id: setup
run: |
: Setup Environment
print '::group::Enable Xcode 15.2'
sudo xcode-select --switch /Applications/Xcode_15.2.app/Contents/Developer
print '::group::Enable Xcode 16.1'
sudo xcode-select --switch /Applications/Xcode_16.1.0.app/Contents/Developer
print '::endgroup::'
local -a to_remove=()
local -a unwanted_formulas=(llvm gcc pkg-config)
for formula (llvm gcc) {
if [[ -d /usr/local/opt/"${formula}" ]] to_remove+=(${formula})
local -a remove_formulas=()
for formula (${unwanted_formulas}) {
if [[ -d ${HOMEBREW_PREFIX}/Cellar/${formula} ]] remove_formulas+=(${formula})
}
if (( #to_remove )) brew uninstall --ignore-dependencies ${to_remove}
if (( #remove_formulas )) brew uninstall --ignore-dependencies ${remove_formulas}
local -r date_string=$(date +"%Y-%m-%d")
print "ccacheDate=${date_string}" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 9c1930d

Please sign in to comment.