From 30e7185e6f4fc3facf85c6f3ac4513ae900dce7d Mon Sep 17 00:00:00 2001 From: Robert Marklund Date: Thu, 9 Jan 2025 14:19:48 +0100 Subject: [PATCH] fix workflows and remove soon to be EOL release update workflows to give better feedback in logs remove ubuntu 20.04 that will be EOL 25.04 add ubuntu 24.04 update mac workflow so it works in latest macos update 32bit build so it works with xxhash update github action versions Signed-off-by: Robert Marklund --- .github/workflows/cppcheck.yml | 4 +- .github/workflows/deterministic.yml | 4 +- .github/workflows/gcc12.yml | 2 +- .github/workflows/gcc13.yml | 2 +- .github/workflows/{gcc11.yml => gcc14.yml} | 12 ++-- .github/workflows/mac.yml | 8 +-- .github/workflows/quality.yml | 4 +- .github/workflows/ubuntu-default.yml | 2 +- do_quality_checks.sh | 71 ++++++++++++++++++---- 9 files changed, 79 insertions(+), 30 deletions(-) rename .github/workflows/{gcc11.yml => gcc14.yml} (73%) diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml index 60de240..521f4bb 100644 --- a/.github/workflows/cppcheck.yml +++ b/.github/workflows/cppcheck.yml @@ -6,7 +6,7 @@ on: [push, pull_request] jobs: build: name: Runs cppcheck - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: checkout @@ -17,7 +17,7 @@ jobs: run: cppcheck/run_cppcheck.sh - name: store the cppcheck output as an artifact if: ${{ always() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: 'cppcheck/out/*' diff --git a/.github/workflows/deterministic.yml b/.github/workflows/deterministic.yml index ccac4ad..047def8 100644 --- a/.github/workflows/deterministic.yml +++ b/.github/workflows/deterministic.yml @@ -6,7 +6,7 @@ on: [push, pull_request] jobs: build: name: Runs the deterministic operation test - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: checkout @@ -23,7 +23,7 @@ jobs: run: testcases/verify_deterministic_operation.sh - name: store logs as artifacts if: ${{ always() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: '**/*.log' diff --git a/.github/workflows/gcc12.yml b/.github/workflows/gcc12.yml index 5aac4c5..5cf6502 100644 --- a/.github/workflows/gcc12.yml +++ b/.github/workflows/gcc12.yml @@ -23,7 +23,7 @@ jobs: run: make check - name: store the logs as an artifact if: ${{ always() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: '**/*.log' diff --git a/.github/workflows/gcc13.yml b/.github/workflows/gcc13.yml index 562a507..376c9d1 100644 --- a/.github/workflows/gcc13.yml +++ b/.github/workflows/gcc13.yml @@ -27,7 +27,7 @@ jobs: run: make check - name: store the logs as an artifact if: ${{ always() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: '**/*.log' diff --git a/.github/workflows/gcc11.yml b/.github/workflows/gcc14.yml similarity index 73% rename from .github/workflows/gcc11.yml rename to .github/workflows/gcc14.yml index 8ce1da7..1a488f1 100644 --- a/.github/workflows/gcc11.yml +++ b/.github/workflows/gcc14.yml @@ -1,29 +1,29 @@ -name: gcc 11 +name: gcc 14 on: [push, pull_request] jobs: build: - name: Compiles with gcc 11 - runs-on: ubuntu-20.04 + name: Compiles with gcc 14 + runs-on: ubuntu-24.04 steps: - name: checkout uses: actions/checkout@v3 - name: install packages - run: sudo apt install build-essential nettle-dev libxxhash-dev time gcc-11 g++-11 + run: sudo apt install build-essential nettle-dev libxxhash-dev time gcc-14 g++-14 - name: bootstrap run: ./bootstrap.sh - name: configure - run: ./configure CXX=g++-11 + run: ./configure CXX=g++-14 - name: build run: make - name: check run: make check - name: store the logs as an artifact if: ${{ always() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: '**/*.log' diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 19698ce..be74adb 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -14,20 +14,20 @@ jobs: - name: checkout uses: actions/checkout@v3 - name: install packages - run: brew install libnettle automake autoconf + run: brew install nettle xxhash automake autoconf - name: bootstrap run: ./bootstrap.sh - name: configure - run: ./configure --enable-warnings CXXFLAGS=-std=c++11 + run: ./configure --enable-warnings CXXFLAGS="-std=c++11 -I$(brew --prefix nettle)/include -I$(brew --prefix xxhash)/include -L$(brew --prefix nettle)/lib -L$(brew --prefix xxhash)/lib" - name: make run: make -# tests fail because readlink does not understand -f on mac +# tests fail because readlink does not understand -f on mac # - name: make check # run: make check # - name: make distcheck # run: make distcheck CXXFLAGS=-std=c++11 - name: Upload a Build Artifact if: ${{ always() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: '**/*.log' diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index c3c6815..8d40347 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -6,7 +6,7 @@ on: [push, pull_request] jobs: build: name: Runs the quality script - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: checkout @@ -17,7 +17,7 @@ jobs: run: ./do_quality_checks.sh - name: store logs as artifacts if: ${{ always() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: '**/*.log' diff --git a/.github/workflows/ubuntu-default.yml b/.github/workflows/ubuntu-default.yml index 0af7a72..9fa3ba9 100644 --- a/.github/workflows/ubuntu-default.yml +++ b/.github/workflows/ubuntu-default.yml @@ -8,7 +8,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, ubuntu-22.04] + os: [ubuntu-22.04, ubuntu-24.04] steps: - name: checkout diff --git a/do_quality_checks.sh b/do_quality_checks.sh index dab53fa..a97848d 100755 --- a/do_quality_checks.sh +++ b/do_quality_checks.sh @@ -76,6 +76,7 @@ compile_and_test_standard() { fi if ! /usr/bin/time --format=%e --output=time.log make >make.log 2>&1; then echo $me: failed make + tail -n 50 make.log exit 1 fi if [ ! -z $MEASURE_COMPILE_TIME ] ; then @@ -91,6 +92,7 @@ compile_and_test_standard() { #run the tests if ! make check >makecheck.log 2>&1 ; then echo $me: failed make check - see makecheck.log + tail -n 50 makecheck.log exit 1 fi } @@ -133,8 +135,8 @@ get_latest_clang() { for ver in $(seq 30 -1 10); do candidate=clang++-$ver if which $candidate >/dev/null 2>&1; then - latestclang=$candidate - return + latestclang=$candidate + return fi done if which clang++ >/dev/null 2>&1; then @@ -269,37 +271,84 @@ build_32bit() { echo $me: "trying to compile in 32 bit mode with -m32..." configureflags="--build=i686-pc-linux-gnu CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32" here=$(pwd) + nettleversion=3.7.3 nettleinstall=$here/nettle32bit - if [ -d "$nettleinstall" ] ; then + if [ -f "$nettleinstall/include/nettle/sha.h" ] ; then echo $me: "local nettle already seems to be installed" else - mkdir "$nettleinstall" + mkdir -p "$nettleinstall" cd "$nettleinstall" - nettleversion=3.7.3 echo "$me: downloading nettle from gnu.org..." wget --quiet https://ftp.gnu.org/gnu/nettle/nettle-$nettleversion.tar.gz echo "661f5eb03f048a3b924c3a8ad2515d4068e40f67e774e8a26827658007e3bcf0 nettle-$nettleversion.tar.gz" >checksum + echo "$me: verify checksum..." sha256sum --strict --quiet -c checksum tar xzf nettle-$nettleversion.tar.gz cd nettle-$nettleversion echo $me: trying to configure nettle ./configure $configureflags --prefix="$nettleinstall" >$here/nettle.configure.log 2>&1 make install >$here/nettle.install.log 2>&1 - echo $me: "local nettle install went ok" + echo $me: local nettle install went ok cd $here fi - ./bootstrap.sh >bootstrap.log 2>&1 + + xxhashversion=0.8.3 + xxhashinstall=$here/xxhash32bit + if [ -f "$xxhashinstall/include/xxhash.h" ] ; then + echo $me: "local xxhash already seems to be installed" + else + mkdir -p "$xxhashinstall" + cd "$xxhashinstall" + echo "$me: downloading xxhash..." + wget -v https://github.com/Cyan4973/xxHash/archive/refs/tags/v$xxhashversion.tar.gz -O xxHash-$xxhashversion.tar.gz + echo "aae608dfe8213dfd05d909a57718ef82f30722c392344583d3f39050c7f29a80 xxHash-$xxhashversion.tar.gz" >checksum + echo "$me: verify checksum..." + sha256sum --strict --quiet -c checksum + tar xzf xxHash-$xxhashversion.tar.gz + cd xxHash-$xxhashversion + echo $me: trying to make xxhash + # ./configure $configureflags --prefix="$xxhashinstall" >$here/xxhash.configure.log 2>&1 + if ! make install PREFIX="$xxhashinstall" CFLAGS="-m32 -shared" LDFLAGS="-m32" >$here/xxhash.install.log 2>&1; then + RET="$?" + echo "$me: make failed" + tail -n 50 $here/xxhash.install.log + exit $RET + fi + echo $me: local xxhash install went ok + cd $here + fi + echo $me: running bootstrap + if ! ./bootstrap.sh >bootstrap.log 2>&1; then + RET="$?" + echo "$me: bootstrap failed" + tail -n 50 bootstrap.log + return $RET + fi echo "$me: attempting configure with 32 bit flags... (see configure.log if it fails)" - ./configure --build=i686-pc-linux-gnu CFLAGS=-m32 CXXFLAGS="-m32 -I$nettleinstall/include" LDFLAGS="-m32 -L$nettleinstall/lib" >configure.log 2>&1 + if ! ./configure --build=i686-pc-linux-gnu CFLAGS=-m32 CXXFLAGS="-m32 -I$nettleinstall/include -I$xxhashinstall/include" LDFLAGS="-m32 -L$nettleinstall/lib -L$xxhashinstall/lib" >configure.log 2>&1; then + RET="$?" + echo "$me: configure failed" + tail -n 50 configure.log + exit $RET + fi echo "$me: building with 32 bit flags... (check make.log if it fails)" - make >make.log 2>&1 + if ! make >make.log 2>&1; then + RET="$?" + echo "$me: building failed" + tail -n 50 make.log + exit $RET + fi echo "$me: make check with 32 bit flags... (check make-check.log if it fails)" - LD_LIBRARY_PATH=$nettleinstall/lib make check >make-check.log 2>&1 + if ! LD_LIBRARY_PATH=$nettleinstall/lib:$xxhashinstall/lib make check >make-check.log 2>&1; then + RET="$?" + echo "$me: make check failed" + tail -n 50 make-check.log + exit $RET + fi echo "$me: 32 bit tests went fine!" } ############################################################################### - #this is pretty quick so start with it. verify_self_contained_headers