Skip to content

Commit

Permalink
Cosmetic edits.
Browse files Browse the repository at this point in the history
  • Loading branch information
fruffy committed Feb 16, 2023
1 parent f02f789 commit 81fbf19
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 14 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ jobs:

# Build with gcc and test p4c on Ubuntu 20.04.
test-ubuntu20:
name: test-ubuntu20 (Unified ${{ matrix.unified }})
name: test-ubuntu20 (Unity ${{ matrix.unity }})
strategy:
fail-fast: false
matrix:
unified: [ON, OFF]
unity: [ON, OFF]
runs-on: ubuntu-20.04
env:
CTEST_PARALLEL_LEVEL: 4
IMAGE_TYPE: test
CMAKE_UNITY_BUILD: ${{ matrix.unified }}
CMAKE_UNITY_BUILD: ${{ matrix.unity }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -62,7 +62,7 @@ jobs:
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: test-${{ matrix.unified }}-${{ runner.os }}-gcc
key: test-${{ matrix.unity }}-${{ runner.os }}-gcc
max-size: 1000M

- name: Build (Ubuntu 20.04, GCC)
Expand All @@ -73,7 +73,7 @@ jobs:
# Need to use sudo for the eBPF kernel tests.
run: sudo -E ctest --output-on-failure --schedule-random
working-directory: ./build
if: matrix.unified == 'ON'
if: matrix.unity == 'ON'

# Build with clang and test p4c on Ubuntu 20.04.
test-ubuntu20-clang-sanitizers:
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/ci-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
CTEST_PARALLEL_LEVEL: 4
IMAGE_TYPE: test
VALIDATION: ON
BUILD_SUCCESS: true
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
Expand All @@ -34,8 +35,15 @@ jobs:

- name: Build (Ubuntu 20.04)
run: |
tools/ci-build.sh
tools/ci-build.sh || echo "BUILD_SUCCESS=false" >> $GITHUB_ENV
- name: Validate
run: ctest -R toz3-validate-p4c --output-on-failure --schedule-random
if: env.BUILD_SUCCESS == 'true'
run: |
ctest -R toz3-validate-p4c --output-on-failure --schedule-random
working-directory: ./build

- name: Build Failed
if: env.BUILD_SUCCESS == 'false'
run: |
echo "Building Gauntlet failed."
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ if(ENABLE_UNIFIED_COMPILATION)
set(CMAKE_UNITY_BUILD ON)
endif()

# If unity builds are enable, choose an aggressive batch size.
# If unity builds are enabled, choose an aggressive batch size.
if (CMAKE_UNITY_BUILD)
set(CMAKE_UNITY_BUILD_BATCH_SIZE 16 CACHE UNINITIALIZED "Set the unity build batch size.")
endif ()
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ARG IN_DOCKER=TRUE
# testing; in this case, the source code and build-only dependencies will not be
# removed from the image.
ARG IMAGE_TYPE=build
# Whether to do a unified build.
# Whether to do a unity build.
ARG CMAKE_UNITY_BUILD=ON
# Whether to enable translation validation
ARG VALIDATION=OFF
Expand Down
4 changes: 2 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ set (GTEST_UNITTEST_HEADERS
)

# Combine the executable and the non-backend-specific unit tests into a single
# unified compilation group.
# unity compilation group.
set (GTEST_BASE_SOURCES
gtest/gtestp4c.cpp
${GTEST_UNITTEST_SOURCES}
)

# Merge the base sources with the tests added to GTEST_SOURCES by specific
# backends or by extensions. We can't assume that one extension's GTests can be
# unified with another's, so we can't handle unified compilation transparently
# unity with another's, so we can't handle unity compilation transparently
# for all GTests.
# XXX(seth): The current approach is an awkward fit for cmake anyway. We should
# restructure backend-specific GTests to live in their own libraries, and just
Expand Down
4 changes: 2 additions & 2 deletions tools/ci-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ P4C_DIR=$(readlink -f ${THIS_DIR}/..)
# testing; in this case, the source code and build-only dependencies will not be
# removed from the image.
: "${IMAGE_TYPE:=build}"
# Whether to do a unified build.
# Whether to do a unity build.
: "${CMAKE_UNITY_BUILD:=ON}"
# Whether to enable translation validation
: "${VALIDATION:=OFF}"
Expand Down Expand Up @@ -237,7 +237,7 @@ fi

# Strong optimization.
export CXXFLAGS="${CXXFLAGS} -O3"
# Toggle unified compilation.
# Toggle unity compilation.
CMAKE_FLAGS+="-DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD} "
# Toggle static builds.
CMAKE_FLAGS+="-DBUILD_STATIC_RELEASE=${BUILD_STATIC_RELEASE} "
Expand Down
2 changes: 1 addition & 1 deletion tools/debian-build/packaging.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DEBIAN_DIR="${P4C_DIR}/debian"
CONFOPT=""
# Strong optimization.
export CXXFLAGS="${CXXFLAGS} -O3"
# Enable unified compilation.
# Enable unity compilation.
CONFOPT+="-DCMAKE_UNITY_BUILD=ON "
# RELEASE should be default, but we want to make sure.
CONFOPT+="-DCMAKE_BUILD_TYPE=RELEASE "
Expand Down

0 comments on commit 81fbf19

Please sign in to comment.