diff --git a/.github/scan-build.sh b/.github/scan-build.sh new file mode 100755 index 00000000..e98f618e --- /dev/null +++ b/.github/scan-build.sh @@ -0,0 +1,6 @@ +#!/bin/sh +scan-build --html-title="PKCS#11 Provider ($GITHUB_SHA)" \ + --keep-cc \ + --status-bugs \ + --keep-going \ + "$@" diff --git a/.github/workflows/address-sanitizer.yml b/.github/workflows/address-sanitizer.yml index 8a00bfbf..7b997574 100644 --- a/.github/workflows/address-sanitizer.yml +++ b/.github/workflows/address-sanitizer.yml @@ -27,8 +27,8 @@ jobs: - name: Install Dependencies run: | if [ -f /etc/fedora-release ]; then - dnf -y install git clang gcc automake libtool pkgconf-pkg-config \ - autoconf-archive openssl-devel openssl diffutils expect \ + dnf -y install git clang gcc pkgconf-pkg-config meson \ + openssl-devel openssl diffutils expect \ softhsm opensc p11-kit-devel p11-kit-server gnutls-utils \ nss-softokn nss-tools nss-softokn-devel \ dnf-command\(debuginfo-install\) libasan @@ -36,8 +36,8 @@ jobs: elif [ -f /etc/debian_version ]; then cat .github/sid.debug.list > /etc/apt/sources.list.d/debug.list apt-get -q update - apt-get -yq install git gcc clang make automake \ - libtool pkg-config autoconf-archive libssl-dev openssl expect \ + apt-get -yq install git gcc clang meson \ + pkg-config libssl-dev openssl expect \ procps libnss3 libnss3-tools libnss3-dev softhsm2 opensc p11-kit \ libp11-kit-dev p11-kit-modules gnutls-bin \ openssl-dbgsym libssl3t64-dbgsym @@ -47,23 +47,23 @@ jobs: # that is not compabitlbe with LD_PRELOAD so we force the absolute path. run: | if [ -f /etc/fedora-release ]; then - autoreconf -fiv CC=gcc \ - ./configure --with-address-sanitizer=/usr/lib64/libasan.so.8.0.0 + meson setup _build -Db_sanitize=address -Dpreload_libasan=/usr/lib64/libasan.so.8.0.0 elif [ -f /etc/debian_version ]; then - autoreconf -fiv CC=gcc \ - ./configure --with-address-sanitizer + meson setup _build -Db_sanitize=address fi - name: Build and Test - run: make check + run: | + meson compile -C _build + meson test --num-processes 1 -C _build - uses: actions/upload-artifact@v3 if: failure() with: name: Address sanitizer logs on ${{ matrix.name }} path: | - tests/*.log - tests/openssl.cnf - tests/tmp.${{ matrix.token }}/p11prov-debug.log - tests/tmp.${{ matrix.token }}/testvars - config.log + _build/meson-logs/ + _build/tests/tmp.${{ matrix.token }}/p11prov-debug.log + _build/tests/tmp.${{ matrix.token }}/testvars + _build/tests/tmp.${{ matrix.token }}/openssl.cnf + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c938b432..3f3cc18b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,9 +28,13 @@ jobs: steps: - name: Install Dependencies run: | + if [ "${{ matrix.name }}" = centos ]; then + dnf_opts="--enablerepo=crb" + fi if [ -f /etc/redhat-release ]; then - dnf -y install git ${{ matrix.compiler }} automake libtool \ - pkgconf-pkg-config autoconf-archive openssl-devel openssl \ + dnf -y install $dnf_opts \ + git ${{ matrix.compiler }} meson \ + pkgconf-pkg-config openssl-devel openssl \ diffutils expect valgrind if [ "${{ matrix.token }}" = "softokn" ]; then dnf -y install nss-softokn nss-tools nss-softokn-devel @@ -40,8 +44,8 @@ jobs: fi elif [ -f /etc/debian_version ]; then apt-get -q update - apt-get -yq install git ${{ matrix.compiler }} make automake \ - libtool pkg-config autoconf-archive libssl-dev openssl expect \ + apt-get -yq install git ${{ matrix.compiler }} meson \ + pkg-config libssl-dev openssl expect \ valgrind procps if [ "${{ matrix.token }}" = "softokn" ]; then apt-get -yq install libnss3 libnss3-tools libnss3-dev @@ -54,10 +58,11 @@ jobs: uses: actions/checkout@v3 - name: Setup run: | - autoreconf -fiv - CC=${{ matrix.compiler }} ./configure + CC=${{ matrix.compiler }} meson setup _build - name: Build and Test - run: make check + run: | + meson compile -C _build + meson test --num-processes 1 -C _build - uses: actions/upload-artifact@v3 if: failure() with: @@ -71,7 +76,7 @@ jobs: - name: Run tests with valgrind run: | if [ "${{ matrix.compiler }}" = "gcc" ]; then - make check-valgrind-memcheck + meson test --num-processes 1 -C _build --setup=valgrind fi - uses: actions/upload-artifact@v3 if: failure() @@ -96,9 +101,7 @@ jobs: run: | brew update brew install \ - autoconf-archive \ - automake \ - libtool \ + meson \ openssl@3 \ pkg-config if [ "${{ matrix.token }}" = "softokn" ]; then @@ -116,21 +119,19 @@ jobs: export PKG_CONFIG_PATH=$(brew --prefix openssl@3)/lib/pkgconfig export PATH=$(brew --prefix openssl@3)/bin:$PATH - autoreconf -fiv - CC=clang ./configure + CC=clang meson setup _build - name: Build and Test run: | export PATH=$(brew --prefix openssl@3)/bin:$PATH - make -j$(sysctl -n hw.ncpu || echo 2) - make check + meson compile -j$(sysctl -n hw.ncpu || echo 2) -C _build + meson test --num-processes 1 -C _build - uses: actions/upload-artifact@v3 if: failure() with: name: Test logs on macOS-12 with ${{ matrix.token }} path: | - tests/*.log - tests/openssl.cnf - tests/tmp.${{ matrix.token }}/p11prov-debug.log - tests/tmp.${{ matrix.token }}/testvars - config.log + _build/meson-logs/* + _build/tests/openssl.cnf + _build/tests/tmp.${{ matrix.token }}/p11prov-debug.log + _build/tests/tmp.${{ matrix.token }}/testvars diff --git a/.github/workflows/coverity-scan.yml b/.github/workflows/coverity-scan.yml index 59f15218..f7de015e 100644 --- a/.github/workflows/coverity-scan.yml +++ b/.github/workflows/coverity-scan.yml @@ -18,15 +18,14 @@ jobs: steps: - name: Install Dependencies run: | - dnf -y install git gcc automake libtool pkgconf-pkg-config \ - autoconf-archive openssl-devel openssl \ + dnf -y install git gcc meson pkgconf-pkg-config \ + openssl-devel openssl \ nss-softokn nss-tools nss-softokn-devel - name: Checkout Repository uses: actions/checkout@v4 - name: Setup run: | - autoreconf -fiv - ./configure + meson setup _build - name: Check for changes run: | echo "RUN_COV=0" >> $GITHUB_ENV; @@ -54,8 +53,8 @@ jobs: steps: - name: Install Dependencies run: | - dnf -y install git gcc automake libtool pkgconf-pkg-config \ - autoconf-archive openssl-devel openssl \ + dnf -y install git gcc meson pkgconf-pkg-config \ + openssl-devel openssl \ nss-softokn nss-tools nss-softokn-devel \ gh - name: Find PR @@ -67,8 +66,7 @@ jobs: ref: ${{steps.get-pr.outputs.merge_commit_sha}} - name: Setup run: | - autoreconf -fiv - ./configure + meson setup _build - name: Coverity Scan uses: vapier/coverity-scan-action@v1 with: diff --git a/.github/workflows/distcheck.yml b/.github/workflows/distcheck.yml index ef12d765..c8121408 100644 --- a/.github/workflows/distcheck.yml +++ b/.github/workflows/distcheck.yml @@ -24,16 +24,20 @@ jobs: steps: - name: Install Dependencies run: | + if [ "${{ matrix.name }}" = centos ]; then + dnf_opts="--enablerepo=crb" + fi if [ -f /etc/redhat-release ]; then - dnf -y install git gcc automake libtool expect \ - pkgconf-pkg-config autoconf-archive openssl-devel openssl xz \ + dnf -y install $dnf_opts \ + git gcc meson expect \ + pkgconf-pkg-config openssl-devel openssl xz \ nss-softokn nss-tools nss-softokn-devel \ softhsm opensc p11-kit-devel p11-kit-server \ rpm-build nss-devel gnutls-utils elif [ -f /etc/debian_version ]; then apt-get -q update - apt-get -yq install git gcc make automake expect \ - libtool pkg-config autoconf-archive libssl-dev openssl \ + apt-get -yq install git gcc meson expect \ + pkg-config libssl-dev openssl \ xz-utils libnss3 libnss3-tools libnss3-dev \ softhsm2 opensc p11-kit libp11-kit-dev p11-kit-modules \ gnutls-bin @@ -42,14 +46,16 @@ jobs: uses: actions/checkout@v3 - name: Setup run: | - autoreconf -fiv - ./configure + git init . + git add -A + git commit -m "Distcheck setup" + meson setup _build - name: Distcheck - run: make distcheck + run: meson dist -C _build - name: RPM Build if: ${{ matrix.name == 'fedora' }} run: | mkdir -p rpmbuild/SOURCES - cp pkcs11-provider*tar.xz rpmbuild/SOURCES/ + cp _build/meson-dist/pkcs11-provider*tar.xz rpmbuild/SOURCES/ rpmbuild --define "_topdir $PWD/rpmbuild" -ba \ packaging/pkcs11-provider.spec diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index fda4a148..05191582 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -22,15 +22,13 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - name: Install Build Requirements - run: | - dnf -y install git autoconf autoconf-archive automake libtool \ - openssl-devel + run: |\ + dnf -y install git meson openssl-devel - name: Setup, Build and Install pkcs11-provider run: | - autoreconf -fiv - ./configure --libdir=/usr/lib64 - make - make install + meson setup -Dlibdir=/usr/lib64 _build + meson compile -C _build + meson install -C _build - name: Test run: | pushd tests/integration diff --git a/.github/workflows/scan-build.yml b/.github/workflows/scan-build.yml index 7d1d8f95..3ccd34fd 100644 --- a/.github/workflows/scan-build.yml +++ b/.github/workflows/scan-build.yml @@ -13,24 +13,19 @@ jobs: steps: - name: Install Dependencies run: | - dnf -y install $COMPILER automake libtool pkgconf-pkg-config \ - autoconf-archive git openssl-devel clang-analyzer + dnf -y install $COMPILER meson pkgconf-pkg-config \ + git openssl-devel clang-analyzer - uses: actions/checkout@v3 name: Checkout Repository - name: Setup run: | - autoreconf -fiv - ./configure + meson setup _build - name: Scan Build run: | - scan-build --html-title="PKCS#11 Provider ($GITHUB_SHA)" \ - --keep-cc \ - --status-bugs \ - --keep-going \ - -o scan-build.reports make + SCANBUILD=$PWD/.github/scan-build.sh ninja -C _build scan-build - uses: actions/upload-artifact@v3 if: failure() with: name: Scan Build logs path: | - scan-build.reports/ + _build/meson-logs/scanbuild/ diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 9e8e793b..11020c99 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -13,14 +13,11 @@ jobs: steps: - name: Install Dependencies run: | - dnf -y install $COMPILER automake libtool pkgconf-pkg-config \ - autoconf-archive git openssl-devel clang-tools-extra \ + dnf -y install $COMPILER meson pkgconf-pkg-config \ + git openssl-devel clang-tools-extra \ python3-pip codespell - name: Checkout Repository uses: actions/checkout@v3 - - name: Install compiledb - run: | - pip install compiledb - name: Setup if: ${{ github.event.pull_request.base.sha }} run: | @@ -29,16 +26,14 @@ jobs: git fetch origin main ${{ github.event.pull_request.base.sha }} - name: Generate Makefile run: | - autoreconf -fiv - ./configure - compiledb make + meson setup _build - name: Run Clang Tidy run: | run-clang-tidy \ -checks=-*,readability-braces-around-statements \ -config "{WarningsAsErrors: '*'}" \ -header-filter "src/pkcs11.h" \ - -quiet + -quiet -p _build - name: Check the Style run: make check-style || (make check-style-show; exit -1) - name: Check spelling