From 11a83cc9cdc1eb09faa597799f7b1b40608b0770 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sat, 2 Dec 2023 22:23:28 -0500 Subject: [PATCH] CI: fix macOS disaster with Github Actions-based python yet again We need this in the unittests job as well, which manifested the same issue as the project tests. Something in homebrew depends on python, which yanks that in, which means we have the same issue we fixed in commit 0e5d632a62ef79b29df98a437c02d02419eaf8e4. I have not seen the Qt4macos test fail in the same way, and it only uses pkgconfig, ninja, and gcc. Hopefully this usage of homebrew is light enough we won't have an issue. This may be foolishly optimistic of me, but time will tell. I'd rather not spend the extra CI time if it's not actually required. --- .github/workflows/macos.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 6d6b43af7e42..38a1fecd7d29 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -28,12 +28,18 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: '3.x' + - run: brew update + # github actions overwrites brew's python. Force it to reassert itself, by running in a separate step. + # Any brew package can arbitrarily depend on python, even if we don't explicitly install or test a + # framework or brew-based python package, which means we cannot rely on the broken Actions mess. + - name: unbreak python in github actions + run: | + find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete + sudo rm -rf /Library/Frameworks/Python.framework/ + brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3 - run: | - python -m pip install --upgrade pip - python -m pip install pytest pytest-xdist pytest-subtests jsonschema coverage + python3 -m pip install --upgrade pip + python3 -m pip install pytest pytest-xdist pytest-subtests jsonschema coverage - run: brew install pkg-config ninja llvm qt@5 - env: CPPFLAGS: "-I/usr/local/include"