Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch build system to Meson #304

Merged
merged 10 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/scan-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
scan-build --html-title="PKCS#11 Provider ($GITHUB_SHA)" \
--keep-cc \
--status-bugs \
--keep-going \
"$@"
28 changes: 14 additions & 14 deletions .github/workflows/address-sanitizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ 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 \
simo5 marked this conversation as resolved.
Show resolved Hide resolved
softhsm opensc p11-kit-devel p11-kit-server gnutls-utils \
nss-softokn nss-tools nss-softokn-devel \
dnf-command\(debuginfo-install\) libasan
dnf -y debuginfo-install openssl
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
Expand All @@ -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 builddir -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 builddir -Db_sanitize=address -Dpreload_libasan=/usr/lib/x86_64-linux-gnu/libasan.so.8.0.0
fi
- name: Build and Test
run: make check
run: |
meson compile -C builddir
meson test --num-processes 1 -C builddir
- 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
builddir/meson-logs/
builddir/tests/tmp.${{ matrix.token }}/p11prov-debug.log
builddir/tests/tmp.${{ matrix.token }}/testvars
builddir/tests/tmp.${{ matrix.token }}/openssl.cnf

60 changes: 30 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -54,35 +58,34 @@ jobs:
uses: actions/checkout@v4
- name: Setup
run: |
autoreconf -fiv
CC=${{ matrix.compiler }} ./configure
CC=${{ matrix.compiler }} meson setup builddir
- name: Build and Test
run: make check
run: |
meson compile -C builddir
meson test --num-processes 1 -C builddir
- uses: actions/upload-artifact@v3
if: failure()
with:
name: Test logs ${{ matrix.name }}, ${{ matrix.compiler }}, ${{ matrix.token }}
path: |
tests/*.log
tests/openssl.cnf
tests/tmp.${{ matrix.token }}/p11prov-debug.log
tests/tmp.${{ matrix.token }}/testvars
config.log
builddir/meson-logs/
builddir/tests/tmp.${{ matrix.token }}/p11prov-debug.log
builddir/tests/tmp.${{ matrix.token }}/testvars
builddir/tests/tmp.${{ matrix.token }}/openssl.cnf
- name: Run tests with valgrind
run: |
if [ "${{ matrix.compiler }}" = "gcc" ]; then
make check-valgrind-memcheck
meson test --num-processes 1 -C builddir --setup=valgrind
fi
- uses: actions/upload-artifact@v3
if: failure()
with:
name: Test valgrind logs ${{ matrix.name }}, ${{ matrix.compiler }}, ${{ matrix.token }}
path: |
tests/*.log
tests/openssl.cnf
tests/tmp.${{ matrix.token }}/p11prov-debug.log
tests/tmp.${{ matrix.token }}/testvars
config.log
builddir/meson-logs/
builddir/tests/tmp.${{ matrix.token }}/p11prov-debug.log
builddir/tests/tmp.${{ matrix.token }}/testvars
builddir/tests/tmp.${{ matrix.token }}/openssl.cnf
build-macos:
name: CI with software token
runs-on: ${{ matrix.os }}
Expand All @@ -96,9 +99,7 @@ jobs:
run: |
brew update
brew install \
autoconf-archive \
automake \
libtool \
meson \
openssl@3 \
pkg-config
if [ "${{ matrix.token }}" = "softokn" ]; then
Expand All @@ -116,21 +117,20 @@ 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 builddir
- 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 builddir
meson test --num-processes 1 -C builddir
- 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
builddir/meson-logs/*
builddir/tests/tmp.${{ matrix.token }}/p11prov-debug.log
builddir/tests/tmp.${{ matrix.token }}/testvars
builddir/tests/tmp.${{ matrix.token }}/openssl.cnf

18 changes: 10 additions & 8 deletions .github/workflows/coverity-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ 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 builddir
env:
CC: gcc
- name: Check for changes
run: |
echo "RUN_COV=0" >> $GITHUB_ENV;
Expand Down Expand Up @@ -54,8 +55,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
Expand All @@ -67,8 +68,9 @@ jobs:
ref: ${{steps.get-pr.outputs.merge_commit_sha}}
- name: Setup
run: |
autoreconf -fiv
./configure
meson setup builddir
env:
CC: gcc
- name: Coverity Scan
uses: vapier/coverity-scan-action@v1
with:
Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/distcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -42,14 +46,17 @@ jobs:
uses: actions/checkout@v4
- name: Setup
run: |
autoreconf -fiv
./configure
meson setup builddir
- name: Distcheck
run: make distcheck
run: |
git config --global --add safe.directory \
/__w/pkcs11-provider/pkcs11-provider
git ls-files meson.build
meson dist --no-tests -C builddir
- name: RPM Build
if: ${{ matrix.name == 'fedora' }}
run: |
mkdir -p rpmbuild/SOURCES
cp pkcs11-provider*tar.xz rpmbuild/SOURCES/
cp builddir/meson-dist/pkcs11-provider*tar.xz rpmbuild/SOURCES/
rpmbuild --define "_topdir $PWD/rpmbuild" -ba \
packaging/pkcs11-provider.spec
11 changes: 4 additions & 7 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ 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 gcc 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 builddir
meson compile -C builddir
meson install -C builddir
ueno marked this conversation as resolved.
Show resolved Hide resolved
- name: Test
run: |
pushd tests/integration
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/scan-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds like this $COMPILER variable is some spurious remnant, probably froma a copy of an old build.yml that was used to jump-start the scan-build action.
I think we can drop it, and/or, if needed, replace it with clang, but I guess clang-analyzer in the next line already pulls in all the required deps.

git openssl-devel clang-analyzer
- uses: actions/checkout@v4
name: Checkout Repository
- name: Setup
run: |
autoreconf -fiv
./configure
meson setup builddir
- 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 builddir scan-build
- uses: actions/upload-artifact@v3
if: failure()
with:
name: Scan Build logs
path: |
scan-build.reports/
builddir/meson-logs/scanbuild/
13 changes: 4 additions & 9 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 gcc meson pkgconf-pkg-config \
git openssl-devel clang-tools-extra \
ueno marked this conversation as resolved.
Show resolved Hide resolved
python3-pip codespell
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install compiledb
run: |
pip install compiledb
- name: Setup
if: ${{ github.event.pull_request.base.sha }}
run: |
Expand All @@ -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 builddir
- name: Run Clang Tidy
run: |
run-clang-tidy \
-checks=-*,readability-braces-around-statements \
-config "{WarningsAsErrors: '*'}" \
-header-filter "src/pkcs11.h" \
-quiet
-quiet -p builddir
- name: Check the Style
run: make check-style || (make check-style-show; exit -1)
- name: Check spelling
Expand Down
30 changes: 0 additions & 30 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,6 @@ tests/tcmpkeys
/pkcs11-provider-?.?.tar.?z

# generic ignore patterns (c, autotools, etc)
INSTALL
Makefile
Makefile.in
aclocal.m4
ar-lib
autom4te.cache/
compile
compile_commands.json
config.guess
config.log
config.status
config.sub
configure
depcomp
install-sh
libtool
ltmain.sh
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
missing
src/config.h
src/config.h.in
src/stamp-h1
.deps/
.libs/
*.la
*.lo
*.o
*~
test-driver
Expand Down
Loading
Loading