Skip to content

Commit

Permalink
ci: Fix macos brew install
Browse files Browse the repository at this point in the history
The macos build's "brew install" command has developed a
build failure without us being involved at all:

    Error: The `brew link` step did not complete successfully
    The formula built, but is not symlinked into /opt/homebrew
    Could not symlink bin/pkg-config
    Target /opt/homebrew/bin/pkg-config
    is a symlink belonging to [email protected]. You can unlink it:
      brew unlink [email protected]

This makes the macos build work again and implements the suggestions
brew prints when installing bison and flex, regarding PATH, LDFLAGS,
and CPPFLAGS.
  • Loading branch information
ndim committed Nov 22, 2024
1 parent 79e091b commit 5657eb9
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,12 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Original PATH and build tools
run: |
echo "PATH=$PATH"
for b in bison flex pkg-config; do type "$b"; done
- name: Install prerequisites
run: >-
# brew update
brew install
cmake
flex
Expand All @@ -233,12 +235,18 @@ jobs:
libftdi
readline
libserialport
pkg-config
- name: Configure environment to use brew kegs for flex and bison
run: |
echo "PATH=/opt/homebrew/opt/flex/bin:/opt/homebrew/opt/bison/bin:$PATH" >> $GITHUB_ENV
- name: post-brew PATH and build tools
run: |
echo "PATH=$PATH"
for b in bison flex pkg-config; do type "$b"; done
- name: Configure
run: >-
cmake
-D CMAKE_C_FLAGS=-I/opt/homebrew/include
-D CMAKE_EXE_LINKER_FLAGS=-L/opt/homebrew/Cellar
-D CMAKE_C_FLAGS="-I/opt/homebrew/include -I/opt/homebrew/opt/flex/include"
-D CMAKE_EXE_LINKER_FLAGS="-L/opt/homebrew/Cellar -L/opt/homebew/opt/flex/lib"
-D DEBUG_CMAKE=1
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-B build
Expand Down Expand Up @@ -269,10 +277,12 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Original PATH and build tools
run: |
echo "PATH=$PATH"
for b in bison flex pkg-config; do type "$b"; done
- name: Install prerequisites
run: >-
# brew update
brew install
automake
autoconf
Expand All @@ -286,15 +296,21 @@ jobs:
libftdi
readline
libserialport
pkg-config
- name: Configure environment to use brew kegs for flex and bison
run: |
echo "PATH=/opt/homebrew/opt/flex/bin:/opt/homebrew/opt/bison/bin:$PATH" >> $GITHUB_ENV
- name: post-brew PATH and build tools
run: |
echo "PATH=$PATH"
for b in bison flex pkg-config; do type "$b"; done
- name: Configure
run: >-
./src/bootstrap
mkdir _ambuild && cd _ambuild
CFLAGS="-I/opt/homebrew/include"
LDFLAGS="-L/opt/homebrew/lib"
CFLAGS="-I/opt/homebrew/include -I/opt/homebrew/opt/flex/include"
LDFLAGS="-L/opt/homebrew/lib -L/opt/homebrew/opt/bison/lib"
../src/configure
- name: Build
Expand Down

0 comments on commit 5657eb9

Please sign in to comment.