From 81fbf194470cbed7fae7fbdcbfdd7df98daf76ba Mon Sep 17 00:00:00 2001 From: fruffy Date: Fri, 6 Jan 2023 12:22:13 +0100 Subject: [PATCH] Cosmetic edits. --- .github/workflows/ci-test.yml | 10 +++++----- .github/workflows/ci-validation.yml | 12 ++++++++++-- CMakeLists.txt | 2 +- Dockerfile | 2 +- test/CMakeLists.txt | 4 ++-- tools/ci-build.sh | 4 ++-- tools/debian-build/packaging.conf | 2 +- 7 files changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 9c297a87d6e..df088f2faca 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -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: @@ -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) @@ -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: diff --git a/.github/workflows/ci-validation.yml b/.github/workflows/ci-validation.yml index 09098853f4c..939f9c4f502 100644 --- a/.github/workflows/ci-validation.yml +++ b/.github/workflows/ci-validation.yml @@ -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 @@ -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." diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b1c37520c6..4d5ac881ebd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 () diff --git a/Dockerfile b/Dockerfile index 78da118e3a3..651681475f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a57c27d7e42..b2ec649e326 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -69,7 +69,7 @@ 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} @@ -77,7 +77,7 @@ set (GTEST_BASE_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 diff --git a/tools/ci-build.sh b/tools/ci-build.sh index 0be69e1b1bc..6285588293c 100755 --- a/tools/ci-build.sh +++ b/tools/ci-build.sh @@ -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}" @@ -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} " diff --git a/tools/debian-build/packaging.conf b/tools/debian-build/packaging.conf index 848568876ed..9da877b5e79 100644 --- a/tools/debian-build/packaging.conf +++ b/tools/debian-build/packaging.conf @@ -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 "