Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to fix some issues with slowness in the MacOS build. #4280

Merged
merged 4 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.4.0
4 changes: 2 additions & 2 deletions .github/workflows/ci-bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: sudo apt-get update && sudo apt-get install bison flex libfl-dev

- name: Build p4c
run: bazel build //... --verbose_failures --distinct_host_configuration=false
run: bazel build //... --verbose_failures

build_indirect: # Build 3rd party Bazel project depending on p4c as a subproject.
runs-on: ubuntu-latest
Expand Down Expand Up @@ -74,4 +74,4 @@ jobs:
run: sudo apt-get update && sudo apt-get install bison flex libfl-dev

- name: Build bazel/example
run: cd ./bazel/example && bazel build //... --verbose_failures --distinct_host_configuration=false
run: cd ./bazel/example && bazel build //... --verbose_failures
7 changes: 4 additions & 3 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ jobs:
run: sudo -E ctest --output-on-failure --schedule-random
working-directory: ./build

# Build and test p4c on MacOS 11
# Build and test p4c on MacOS 12
test-mac-os:
strategy:
fail-fast: false
runs-on: macos-11
runs-on: macos-12
env:
CTEST_PARALLEL_LEVEL: 4
steps:
Expand All @@ -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
1 change: 1 addition & 0 deletions bazel/example/.bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.4.0
2 changes: 1 addition & 1 deletion lib/ordered_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ordered_set {
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;

private:
struct mapcmp : std::binary_function<const T *, const T *, bool> {
struct mapcmp {
COMP comp;
bool operator()(const T *a, const T *b) const { return comp(*a, *b); }
};
Expand Down
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
22 changes: 15 additions & 7 deletions tools/install_mac_deps.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
#! /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="[email protected]"

$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 ccache cmake \
libtool openssl pkg-config python coreutils

# We need to link boost.
$BREW install ${BOOST_LIB}
$BREW link ${BOOST_LIB}
# 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
Loading