Skip to content

Commit 9f07a86

Browse files
committed
Github workflow: Fix linking error on macOS
Homebrew has multiple versions of python which occasionally step on each other. Add the overwrite flag in the install process to explicity oveverwrite old links. Additionally add a call to brew upgrade to handle issues where new packages require updating already installed ones.
1 parent 62ad21b commit 9f07a86

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

.github/workflows/buildmaster.yml

+22-10
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,27 @@ jobs:
6464
- name: Check cross-compile environment (macOS)
6565
env:
6666
ARCH: ${{ matrix.arch }}
67+
PYTHONVERS: 3.12
6768
run: |
6869
SYSARCH=$(/usr/bin/uname -m)
6970
PKGMGR_CMD='brew'
71+
HB_PREFIX=$(${PKGMGR_CMD} --prefix)
72+
echo "HB_PREFIX=$HB_PREFIX" >> $GITHUB_ENV
7073
if [ "$SYSARCH" = "$ARCH" ]; then
7174
# this is a cross-compile
7275
PKGMGR_CMD="arch -${ARCH} $PKGMGR_CMD"
7376
echo "CONFIGURE_CMD=arch -${ARCH} $CONFIGURE_CMD" >> $GITHUB_ENV
7477
echo "MAKE_CMD=arch -${ARCH} $MAKE_CMD" >> $GITHUB_ENV
7578
fi
7679
echo "PKGMGR_CMD=$PKGMGR_CMD" >> $GITHUB_ENV
80+
81+
# Uninstall alternative python versions
82+
INSTALLED_PYTHONS=$($PKGMGR_CMD list|grep 'python@')
83+
for PYTH in $INSTALLED_PYTHONS; do
84+
if [[ $PYTH != *"3.12"* ]]; then
85+
echo $PYTH uninstall --ignore-dependencies $PYTH
86+
fi
87+
done
7788
if: runner.os == 'macOS'
7889

7990
# N.B. These dependencies are for the master branch. Unlike the ansible
@@ -100,22 +111,23 @@ jobs:
100111
env:
101112
OS_VERS: ${{ matrix.os }}
102113
run: |
103-
brew update
104-
${PKGMGR_CMD} install pkg-config ccache qt5 nasm libsamplerate taglib\
105-
lzo libcec libbluray libass libhdhomerun dav1d x264 x265 libvpx \
106-
openssl sound-touch lame freetype libass libiconv libxml2 libzip \
107-
XviD zlib pyenv-virtualenv python-lxml python-requests \
108-
python-setuptools
109-
${PKGMGR_CMD} link qt5 --force
114+
${PKGMGR_CMD} update
115+
${PKGMGR_CMD} upgrade --force
116+
${PKGMGR_CMD} install pkg-config ccache qt@5 nasm libsamplerate \
117+
taglib lzo libcec libbluray libass libhdhomerun dav1d x264 x265 \
118+
libvpx openssl sound-touch lame freetype libass libiconv libxml2 \
119+
libzip XviD zlib pyenv-virtualenv python-lxml python-requests \
120+
python-setuptools --force --overwrite
121+
${PKGMGR_CMD} link qt@5 --force
122+
${PKGMGR_CMD} link python --force --overwrite
110123
# macos-14 updated the linker and needs to be run in "classic" mode
111124
case $OS_VERS in
112-
macos-14)
125+
macos-14 | macos-13)
113126
LDFLAGS="-Wl,-ld_classic"
114127
;;
115128
esac
116129
# homebrew uses different prefixes on x86_64 and arm64, find the
117130
# correct one and setup the correct build variables
118-
HB_PREFIX=$(${PKGMGR_CMD} --prefix)
119131
C_INCLUDE_PATH=$HB_PREFIX/include:$C_INCLUDE_PATH
120132
echo "C_INCLUDE_PATH=$C_INCLUDE_PATH" >> $GITHUB_ENV
121133
CPLUS_INCLUDE_PATH=$HB_PREFIX/include:$CPLUS_INCLUDE_PATH
@@ -169,7 +181,7 @@ jobs:
169181

170182
- name: Install plugin dependencies (macOS)
171183
run: ${PKGMGR_CMD} install minizip flac libvorbis libcdio python-pycurl
172-
python-oauthlib
184+
python-oauthlib --force --overwrite
173185
if: runner.os == 'macOS'
174186

175187
- name: Configure plugins

0 commit comments

Comments
 (0)