This is an automated email from the ASF dual-hosted git repository.

bneradt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/trafficserver-ci.git


The following commit(s) were added to refs/heads/main by this push:
     new 9a9fa33  Some cmake updates. (#224)
9a9fa33 is described below

commit 9a9fa33b918e0459e5f744a612b3bfdbcda96618
Author: Brian Neradt <[email protected]>
AuthorDate: Sat Oct 14 12:56:00 2023 -0500

    Some cmake updates. (#224)
    
    Hopefully this fixes docs at least. It also makes the cmake detection
    more reliable than just looking at the branch and making sure it's not
    9.x
---
 jenkins/github/autest.pipeline       | 18 ++++++++----------
 jenkins/github/centos.pipeline       | 20 +++++++++-----------
 jenkins/github/clang-format.pipeline | 22 +++++++++++++---------
 jenkins/github/cmake.pipeline        |  7 ++-----
 jenkins/github/debian.pipeline       | 23 ++++++++++-------------
 jenkins/github/docs.pipeline         | 20 ++++++++------------
 jenkins/github/fedora.pipeline       | 25 ++++++++++++-------------
 jenkins/github/freebsd.pipeline      | 12 +++++-------
 jenkins/github/osx.pipeline          | 14 ++++++--------
 jenkins/github/rat.pipeline          | 21 +++++++++++++++------
 jenkins/github/rocky.pipeline        | 25 +++++++++++--------------
 jenkins/github/ubuntu.pipeline       | 33 ++++++++++++++++-----------------
 12 files changed, 115 insertions(+), 125 deletions(-)

diff --git a/jenkins/github/autest.pipeline b/jenkins/github/autest.pipeline
index e728b0c..2e8a841 100644
--- a/jenkins/github/autest.pipeline
+++ b/jenkins/github/autest.pipeline
@@ -75,12 +75,15 @@ pipeline {
                                                # The HTTP/3 AuTests depend 
upon this, so update the PATH accordingly.
                                                export PATH=/opt/bin:${PATH}
 
-                                               # We do not support CMake 
builds for the 9.x branch.
-                                               if [ 
"${GITHUB_PR_TARGET_BRANCH}" == "9.0.x" -o \
-                                                    
"${GITHUB_PR_TARGET_BRANCH}" == "9.1.x" -o \
-                                                    
"${GITHUB_PR_TARGET_BRANCH}" == "9.2.x" ]
+                                               if [ -d cmake ]
                                                then
-                                                       echo "CMake builds are 
not supported for the 9.x branch."
+                                                       echo "Building with 
CMake."
+                                                       cmake -B build --preset 
ci-fedora-autest
+                                                       cmake --build build -v
+                                                       cmake --install build
+                                               else
+                                                        # Pre 10 branches only 
supported autotools.
+                                                       echo "CMake builds are 
not supported for this branch."
                                                        echo "Building with 
autotools instead."
 
                                                        # Change permissions so 
that all files are readable
@@ -90,11 +93,6 @@ pipeline {
                                                        ./configure 
--with-openssl=/opt/openssl-quic --enable-experimental-plugins 
--enable-example-plugins --prefix=/tmp/ats --enable-werror --enable-debug 
--enable-wccp --enable-ccache
                                                        make -j4
                                                        make install
-                                               else
-                                                       echo "Building with 
CMake."
-                                                       cmake -B build --preset 
ci-fedora-autest
-                                                       cmake --build build -v
-                                                       cmake --install build
                                                fi
                                                '''
                                }
diff --git a/jenkins/github/centos.pipeline b/jenkins/github/centos.pipeline
index 5dc9a62..3bf69d6 100644
--- a/jenkins/github/centos.pipeline
+++ b/jenkins/github/centos.pipeline
@@ -50,18 +50,8 @@ pipeline {
 
                         source /opt/rh/devtoolset-8/enable
 
-                        # We do not support CMake builds for the 9.x branch.
-                        if [ "${GITHUB_PR_TARGET_BRANCH}" == "9.0.x" -o \
-                             "${GITHUB_PR_TARGET_BRANCH}" == "9.1.x" -o \
-                             "${GITHUB_PR_TARGET_BRANCH}" == "9.2.x" ]
+                        if [ -d cmake ]
                         then
-                            autoreconf -fiv
-                            ./configure --with-openssl=/opt/openssl-quic 
--enable-experimental-plugins --enable-example-plugins --prefix=/tmp/ats/ 
--enable-werror --enable-debug --enable-ccache
-                            make -j4 V=1 Q=
-                            make -j 2 check VERBOSE=Y V=1
-                            make install
-                            /tmp/ats/bin/traffic_server -K -k -R 1
-                        else
                             cmake -B cmake-build-release --preset ci -G "Unix 
Makefiles" -DOPENSSL_ROOT_DIR=/opt/openssl-quic
                             cmake --build cmake-build-release -v
                             cmake --install cmake-build-release
@@ -69,6 +59,14 @@ pipeline {
                             ctest -j4 --output-on-failure --no-compress-output 
-T Test
                             /tmp/ats/bin/traffic_server -K -k -R 1
                             popd
+                        else
+                            # Pre 10 branches only supported autotools.
+                            autoreconf -fiv
+                            ./configure --with-openssl=/opt/openssl-quic 
--enable-experimental-plugins --enable-example-plugins --prefix=/tmp/ats/ 
--enable-werror --enable-debug --enable-ccache
+                            make -j4 V=1 Q=
+                            make -j 2 check VERBOSE=Y V=1
+                            make install
+                            /tmp/ats/bin/traffic_server -K -k -R 1
                         fi
                         '''
                 }
diff --git a/jenkins/github/clang-format.pipeline 
b/jenkins/github/clang-format.pipeline
index d3f5e60..5b66585 100644
--- a/jenkins/github/clang-format.pipeline
+++ b/jenkins/github/clang-format.pipeline
@@ -59,18 +59,22 @@ pipeline {
 
                             set -x
 
-                            autoreconf -if && ./configure && make clang-format
-                            [ "0" != "$?" ] && exit 1
+                            if [ -d cmake ]
+                            then
+                                cmake -B build
+                                cmake --build build --target format || exit 1
+                            else
+                                # Pre 10.x branches only supported autotools.
+                                autoreconf -if && ./configure && make 
clang-format || exit 1
 
-                            # Only enforce autopep8 on branches where the 
pre-commit hook was updated to
-                            # check it. Otherwise, none of the PRs for older 
branches will pass this check.
-                            if grep -q autopep8 tools/git/pre-commit; then
-                                make autopep8
-                                [ "0" != "$?" ] && exit 1
+                                # Only enforce autopep8 on branches where the 
pre-commit hook was updated to
+                                # check it. Otherwise, none of the PRs for 
older branches will pass this check.
+                                if grep -q autopep8 tools/git/pre-commit; then
+                                    make autopep8 || exit 1
+                                fi
                             fi
 
-                            git diff --exit-code
-                            [ "0" != "$?" ] && exit 1
+                            git diff --exit-code || exit 1
 
                             # Normal exit
                             exit 0
diff --git a/jenkins/github/cmake.pipeline b/jenkins/github/cmake.pipeline
index 97b00ff..98fb2ef 100644
--- a/jenkins/github/cmake.pipeline
+++ b/jenkins/github/cmake.pipeline
@@ -48,12 +48,9 @@ pipeline {
                         set -x
                         set -e
 
-                        # We do not support CMake builds for the 9.x branch.
-                        if [ "${GITHUB_PR_TARGET_BRANCH}" == "9.0.x" -o \
-                             "${GITHUB_PR_TARGET_BRANCH}" == "9.1.x" -o \
-                             "${GITHUB_PR_TARGET_BRANCH}" == "9.2.x" ]
+                        if [ ! -d cmake ]
                         then
-                            echo "CMake builds are not supported for the 9.x 
branch."
+                            echo "CMake builds are not supported for this 
branch."
                             echo "No need to test it to show that it fails."
                             exit 0
                         fi
diff --git a/jenkins/github/debian.pipeline b/jenkins/github/debian.pipeline
index ec6a644..2b55b12 100644
--- a/jenkins/github/debian.pipeline
+++ b/jenkins/github/debian.pipeline
@@ -47,20 +47,9 @@ pipeline {
                     sh '''#!/bin/bash
                         set -x
                         set -e
-                        # We do not support CMake builds for the 9.x branch.
-                        # Always run autotools until -DENABLE_HARDENING=ON is 
implemented.
-                        if [ true -o \
-                            "${GITHUB_PR_TARGET_BRANCH}" == "9.0.x" -o \
-                             "${GITHUB_PR_TARGET_BRANCH}" == "9.1.x" -o \
-                             "${GITHUB_PR_TARGET_BRANCH}" == "9.2.x" ]
+                        # `false -a`: Always run autotools until 
-DENABLE_HARDENING=ON is implemented.
+                        if [ false -a -d cmake ]
                         then
-                            autoreconf -fiv
-                            ./configure --enable-experimental-plugins 
--enable-example-plugins --prefix=/tmp/ats/ --enable-debug --enable-werror 
--enable-ccache --enable-hardening
-                            make -j4 V=1 Q=
-                            make -j 2 check VERBOSE=Y V=1
-                            make install
-                            /tmp/ats/bin/traffic_server -K -k -R 1
-                        else
                             cmake -B cmake-build-release --preset ci -G "Unix 
Makefiles" -DOPENSSL_ROOT_DIR=/opt/openssl-quic -DENABLE_HARDENING=ON
                             cmake --build cmake-build-release -v
                             cmake --install cmake-build-release
@@ -68,6 +57,14 @@ pipeline {
                             ctest -j4 --output-on-failure --no-compress-output 
-T Test
                             /tmp/ats/bin/traffic_server -K -k -R 1
                             popd
+                        else
+                            # Pre 10.x branches only supported autotools.
+                            autoreconf -fiv
+                            ./configure --enable-experimental-plugins 
--enable-example-plugins --prefix=/tmp/ats/ --enable-debug --enable-werror 
--enable-ccache --enable-hardening
+                            make -j4 V=1 Q=
+                            make -j 2 check VERBOSE=Y V=1
+                            make install
+                            /tmp/ats/bin/traffic_server -K -k -R 1
                         fi
                     '''
                 }
diff --git a/jenkins/github/docs.pipeline b/jenkins/github/docs.pipeline
index f509caf..b7d42fd 100644
--- a/jenkins/github/docs.pipeline
+++ b/jenkins/github/docs.pipeline
@@ -43,7 +43,6 @@ pipeline {
                 dir('src') {
                     sh '''#!/bin/bash
                     set -x
-                    set -e
                     # Skip if nothing in doc has changed
                     INCLUDE_FILES=$(for i in $(git grep literalinclude doc/ | 
awk '{print $3}'); do basename $i; done | sort -u | paste -sd\\|)
                     echo $INCLUDE_FILES
@@ -57,11 +56,15 @@ pipeline {
 
                     sudo chmod -R 777 . || exit 1
 
-                    # We do not support CMake builds for the 9.x branch.
-                    if [ "${GITHUB_PR_TARGET_BRANCH}" == "9.0.x" -o \
-                         "${GITHUB_PR_TARGET_BRANCH}" == "9.1.x" -o \
-                         "${GITHUB_PR_TARGET_BRANCH}" == "9.2.x" ]
+                    if [ -d cmake ]
                     then
+                        cmake -B docs-build -DENABLE_DOCS=ON
+                        cmake --build docs-build --target generate_docs -v || 
exit 1
+                    else
+                        # Pre 10.x branches only supported autotools.
+
+                        # The rest of the script expects to be just above the 
html output directory.
+                        cd docs-build/doc
                         cd doc
                         pipenv install || exit 1
 
@@ -88,13 +91,6 @@ _END_OF_DOC_
                         pipenv run ${tmpfile} || exit 1
                         rm ${tmpfile}
 
-                    else
-                        # cmake. Much easier.
-                        cmake -B docs-build -DENABLE_DOCS=ON
-                        cmake --build docs-build --target generate_docs -v
-
-                        # The rest of the script expects to be just above the 
html output directory.
-                        cd docs-build/doc
                     fi
 
                     # If we made it here, the doc build ran and succeeded. 
Let's copy out the
diff --git a/jenkins/github/fedora.pipeline b/jenkins/github/fedora.pipeline
index 5e4dc82..34b8ed6 100644
--- a/jenkins/github/fedora.pipeline
+++ b/jenkins/github/fedora.pipeline
@@ -48,11 +48,19 @@ pipeline {
                         set -x
                         set -e
 
-                        # We do not support CMake builds for the 9.x branch.
-                        if [ "${GITHUB_PR_TARGET_BRANCH}" == "9.0.x" -o \
-                             "${GITHUB_PR_TARGET_BRANCH}" == "9.1.x" -o \
-                             "${GITHUB_PR_TARGET_BRANCH}" == "9.2.x" ]
+                        if [ -d cmake ]
                         then
+                            sed -i 's/CMAKE_CXX_STANDARD 17/CMAKE_CXX_STANDARD 
20/g' CMakeLists.txt
+                            cmake -B build --preset ci
+                            cmake --build build -v
+                            cmake --install build
+                            pushd build
+                            ctest -j4 --output-on-failure --no-compress-output 
-T Test
+                            /tmp/ats/bin/traffic_server -K -k -R 1
+                            popd
+                        else
+                            # Pre 10.x branches only support autotools.
+
                             # We don't use c++20 features yet, but we want to 
make
                             # sure we can build with the flag set.
                             export CXXSTD=20
@@ -63,15 +71,6 @@ pipeline {
                             make -j4 check VERBOSE=Y V=1
                             make install
                             /tmp/ats/bin/traffic_server -K -k -R 1
-                        else
-                            sed -i 's/CMAKE_CXX_STANDARD 17/CMAKE_CXX_STANDARD 
20/g' CMakeLists.txt
-                            cmake -B build --preset ci
-                            cmake --build build -v
-                            cmake --install build
-                            pushd build
-                            ctest -j4 --output-on-failure --no-compress-output 
-T Test
-                            /tmp/ats/bin/traffic_server -K -k -R 1
-                            popd
                         fi
                     '''
                 }
diff --git a/jenkins/github/freebsd.pipeline b/jenkins/github/freebsd.pipeline
index 767f15a..32102c6 100644
--- a/jenkins/github/freebsd.pipeline
+++ b/jenkins/github/freebsd.pipeline
@@ -25,17 +25,15 @@ pipeline {
                         set -x
                         set -e
 
-                        # We do not support CMake builds for the 9.x branch.
-                        if [ "${GITHUB_PR_TARGET_BRANCH}" == "9.0.x" -o \
-                             "${GITHUB_PR_TARGET_BRANCH}" == "9.1.x" -o \
-                             "${GITHUB_PR_TARGET_BRANCH}" == "9.2.x" ]
+                        if [ -d cmake ]
                         then
+                            cmake -B cmake-build-release 
-DBUILD_EXPERIMENTAL_PLUGINS=ON -DCMAKE_INSTALL_PREFIX=/tmp/ats
+                            cmake --build cmake-build-release -v
+                        else
+                            # Pre 10.x branches only support autotools.
                             autoreconf -fiv
                             ./configure --enable-experimental-plugins
                             gmake -j3
-                        else
-                            cmake -B cmake-build-release 
-DBUILD_EXPERIMENTAL_PLUGINS=ON -DCMAKE_INSTALL_PREFIX=/tmp/ats
-                            cmake --build cmake-build-release -v
                         fi
                         '''
                 }
diff --git a/jenkins/github/osx.pipeline b/jenkins/github/osx.pipeline
index 2a681f0..c229479 100644
--- a/jenkins/github/osx.pipeline
+++ b/jenkins/github/osx.pipeline
@@ -24,19 +24,17 @@ pipeline {
                         set -x
                         set -e
 
-                        # We do not support CMake builds for the 9.x branch.
-                        if [ "${GITHUB_PR_TARGET_BRANCH}" == "9.0.x" -o \
-                             "${GITHUB_PR_TARGET_BRANCH}" == "9.1.x" -o \
-                             "${GITHUB_PR_TARGET_BRANCH}" == "9.2.x" ]
+                        if [ -d cmake ]
                         then
-                            autoreconf -fiv
-                            CC="clang" CXX="clang++" 
CXXFLAGS="-Qunused-arguments" WITH_LIBCPLUSPLUS="yes" ./configure 
--enable-experimental-plugins --with-openssl=/usr/local/opt/openssl 
--enable-werror
-                            make -j3
-                        else
                             export CC="clang"
                             export CXX="clang++"
                             cmake -B build --preset ci -G "Unix Makefiles" 
-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl
                             cmake --build build -j3 -v
+                        else
+                            # Pre 10.x branches only support autotools.
+                            autoreconf -fiv
+                            CC="clang" CXX="clang++" 
CXXFLAGS="-Qunused-arguments" WITH_LIBCPLUSPLUS="yes" ./configure 
--enable-experimental-plugins --with-openssl=/usr/local/opt/openssl 
--enable-werror
+                            make -j3
                         fi
                     '''
                 }
diff --git a/jenkins/github/rat.pipeline b/jenkins/github/rat.pipeline
index 4db09e1..7f44c63 100644
--- a/jenkins/github/rat.pipeline
+++ b/jenkins/github/rat.pipeline
@@ -44,14 +44,23 @@ pipeline {
                     sh '''#!/bin/bash
                         set -x
                         set -e
-                        autoreconf -if && ./configure
-                        rm -f lib/ts/stamp-h1
 
-                        # Run RAT
-                        make rat | tee RAT.txt
+                        # `false -a` because we currently don't support RAT in 
cmake.
+                        if [ false a -d cmake ]
+                        then
+                            cmake -B build
+                            cmake --build build --target rat
+                        else
+                            # Pre 10.x branches only support autotools.
+                            autoreconf -if && ./configure
+                            rm -f lib/ts/stamp-h1
 
-                        # Mark as failed if there are any unknown licenses
-                        grep '^0 Unknown Licenses' RAT.txt > /dev/null || exit 
-1
+                            # Run RAT
+                            make rat | tee RAT.txt
+
+                            # Mark as failed if there are any unknown licenses
+                            grep '^0 Unknown Licenses' RAT.txt > /dev/null || 
exit -1
+                        fi
                         exit 0
                     '''
                 }
diff --git a/jenkins/github/rocky.pipeline b/jenkins/github/rocky.pipeline
index fc53b70..929f091 100644
--- a/jenkins/github/rocky.pipeline
+++ b/jenkins/github/rocky.pipeline
@@ -49,13 +49,18 @@ pipeline {
                         set -e
                         source /opt/rh/gcc-toolset-11/enable
 
-                        # We do not support CMake builds for the 9.x branch.
-                        if [ "${GITHUB_PR_TARGET_BRANCH}" == "9.0.x" -o \
-                             "${GITHUB_PR_TARGET_BRANCH}" == "9.1.x" -o \
-                             "${GITHUB_PR_TARGET_BRANCH}" == "9.2.x" ]
+                        if [ -d cmake ]
                         then
-                            echo "CMake builds are not supported for the 9.x 
branch."
-                            echo "Falling back to automake."
+                            cmake -B build --preset ci-rocky
+                            cmake --build build -v
+                            cmake --install build
+                            pushd build
+                            ctest -j4 --output-on-failure --no-compress-output 
-T Test
+                            /tmp/ats_quiche/bin/traffic_server -K -k -R 1
+                            popd
+                        else
+                            echo "CMake builds are not supported for the this 
branch."
+                            echo "Falling back to autotools."
                             autoreconf -fiv
                             ./configure \
                                 --with-quiche=/opt/quiche \
@@ -70,14 +75,6 @@ pipeline {
                             make -j 2 check VERBOSE=Y V=1
                             make install
                             /tmp/ats/bin/traffic_server -K -k -R 1
-                        else
-                            cmake -B build --preset ci-rocky
-                            cmake --build build -v
-                            cmake --install build
-                            pushd build
-                            ctest -j4 --output-on-failure --no-compress-output 
-T Test
-                            /tmp/ats_quiche/bin/traffic_server -K -k -R 1
-                            popd
                         fi
                         '''
                 }
diff --git a/jenkins/github/ubuntu.pipeline b/jenkins/github/ubuntu.pipeline
index e2c8a29..7ec7a38 100644
--- a/jenkins/github/ubuntu.pipeline
+++ b/jenkins/github/ubuntu.pipeline
@@ -49,24 +49,8 @@ pipeline {
                         set -x
                         set -e
 
-                        # We do not support CMake builds for the 9.x branch.
-                        if [ "${GITHUB_PR_TARGET_BRANCH}" == "9.0.x" -o \
-                             "${GITHUB_PR_TARGET_BRANCH}" == "9.1.x" -o \
-                             "${GITHUB_PR_TARGET_BRANCH}" == "9.2.x" ]
+                        if [ -d cmake ]
                         then
-                            # We don't use c++20 features yet, but we want to 
make
-                            # sure we can build with the flag set.
-                            export CXXSTD=20
-
-                            autoreconf -fiv
-                            mkdir out_of_source_build_dir
-                            cd out_of_source_build_dir
-                            CC="clang" CXX="clang++" ../configure 
--enable-experimental-plugins --enable-example-plugins --enable-expensive-tests 
--prefix=/tmp/ats/ --enable-werror --enable-ccache
-                            make -j4 V=1 Q=
-                            make -j4 check VERBOSE=Y V=1
-                            make install
-                            /tmp/ats/bin/traffic_server -K -k -R 1
-                        else
                             export CC="clang"
                             export CXX="clang++"
 
@@ -81,6 +65,21 @@ pipeline {
                             ctest -j4 --output-on-failure --no-compress-output 
-T Test
                             /tmp/ats/bin/traffic_server -K -k -R 1
                             popd
+                        else
+                            # Pre 10.x branches only support autotools.
+
+                            # We don't use c++20 features yet, but we want to 
make
+                            # sure we can build with the flag set.
+                            export CXXSTD=20
+
+                            autoreconf -fiv
+                            mkdir out_of_source_build_dir
+                            cd out_of_source_build_dir
+                            CC="clang" CXX="clang++" ../configure 
--enable-experimental-plugins --enable-example-plugins --enable-expensive-tests 
--prefix=/tmp/ats/ --enable-werror --enable-ccache
+                            make -j4 V=1 Q=
+                            make -j4 check VERBOSE=Y V=1
+                            make install
+                            /tmp/ats/bin/traffic_server -K -k -R 1
                         fi
                     '''
                 }

Reply via email to