Skip to content

Commit

Permalink
CI: force macOS to use brew's python at all costs
Browse files Browse the repository at this point in the history
The default actions one is broken in two ways, and additionally
overwrote homebrew's symlinks to begin with.
  • Loading branch information
eli-schwartz committed Nov 15, 2022
1 parent aa84c55 commit 0e5d632
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,15 @@ jobs:
- uses: actions/checkout@v2
# Avoid picking up an older version of LLVM that does not work.
- run: brew update
# github actions overwrites brew's python. Force it to reassert itself, by running in a separate step.
- 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

This comment has been minimized.

Copy link
@dnicolodi

dnicolodi Nov 16, 2022

Member

@eli-schwartz In the tests job for meson-python I got away with only doing

brew install --overwrite python@${{matrix.python}}

where ${{ matrix.python }} select a specific Python version. After fixing a bug in pip that is enough to get a functional (at least as much as exercised by the tests) Python. After that I just push the path with the unversioned symlinks to the fron of the $PATH with

echo /usr/local/opt/python@${{ matrix.python }}/libexec/bin/ >> $GITHUB_PATH

Maybe this would suffice here too.

# use python3 from homebrew because it is a valid framework, unlike the actions one:
# https://github.com/actions/setup-python/issues/58
- run: brew install pkg-config ninja llvm qt@5 boost ldc hdf5 openmpi lapack scalapack sdl2 python3 boost-python3 gtk-doc
- run: brew install pkg-config ninja llvm qt@5 boost ldc hdf5 openmpi lapack scalapack sdl2 boost-python3 gtk-doc
- run: |
python3 -m pip install --upgrade setuptools
python3 -m pip install --upgrade pip
Expand Down

0 comments on commit 0e5d632

Please sign in to comment.