Skip to content

Commit

Permalink
Try to fix some issues with slowness in the MacOS build.
Browse files Browse the repository at this point in the history
  • Loading branch information
fruffy committed Dec 8, 2023
1 parent 25b5957 commit 0410e07
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,16 @@ jobs:
- name: Install dependencies (MacOS)
run: |
tools/install_mac_deps.sh
echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH
- name: Build (MacOS)
run: |
source ~/.bash_profile
./bootstrap.sh -DENABLE_GC=ON -DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_UNITY_BUILD=ON
make -Cbuild -j2
- name: Run tests (MacOS)
run: |
source ~/.bash_profile
ctest --output-on-failure --schedule-random -LE "bpf|ubpf"
working-directory: ./build
2 changes: 1 addition & 1 deletion tools/ci-build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Script for building in a Docker container on Travis.
# Script for building P4C for continuous integration builds.

set -e # Exit on error.
set -x # Make command execution verbose
Expand Down
19 changes: 12 additions & 7 deletions tools/install_mac_deps.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
#! /bin/bash

# Script for building P4C on MacOS.

set -e # Exit on error.
set -x # Make command execution verbose

# Install some custom requirements on OS X using brew
BREW=/usr/local/bin/brew
if [[ ! -x $BREW ]]; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi

BOOST_LIB="boost@1.76"

$BREW update
$BREW install autoconf automake bdw-gc bison ${BOOST_LIB} ccache cmake \
libtool openssl pkg-config python coreutils grep
$BREW install autoconf automake bdw-gc ${BOOST_LIB} ccache cmake \
libtool openssl pkg-config python coreutils

# Prefer Homebrew's bison and grep over the macOS-provided version
$BREW link --force bison grep ${BOOST_LIB}
$BREW install bison
echo 'export PATH="/usr/local/opt/bison/bin:$PATH"' >> ~/.bash_profile
$BREW install grep
echo 'export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"' >> ~/.bash_profile
export PATH="/usr/local/opt/bison/bin:$PATH"
export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"
source ~/.bash_profile


# install pip and required pip packages
# curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
Expand Down

0 comments on commit 0410e07

Please sign in to comment.