Skip to content

Commit 210f169

Browse files
Merge pull request #41 from airtower-luna/meson-build
Switch the build system to Meson
2 parents a6dab36 + 82cecb9 commit 210f169

File tree

100 files changed

+873
-2986
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+873
-2986
lines changed

.dir-locals.el

Lines changed: 0 additions & 7 deletions
This file was deleted.

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
charset = utf-8
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
9+
[*.{c,h,h.in}]
10+
indent_style = space
11+
indent_size = 4
12+
13+
[*.py]
14+
indent_style = space
15+
indent_size = 4
16+
17+
[*.yaml]
18+
indent_style = space
19+
indent_size = 2

.github/build-action/action.yaml

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ inputs:
88
required: no
99
default: 'gcc'
1010
configure-options:
11-
description: 'Additional options to pass to ./configure'
11+
description: 'Additional options to pass to meson setup'
1212
required: no
1313
default: ''
1414
artifact-prefix:
@@ -19,37 +19,35 @@ runs:
1919
using: composite
2020
steps:
2121
- name: network overview
22-
shell: bash
22+
shell: sh
2323
run: |
2424
ip addr show
2525
cat /etc/hosts
2626
- name: find usable IPs for tests
27-
shell: bash
27+
shell: sh
2828
run: |
2929
echo "test_ips=$(python3 test/check_test_ips.py -H localhost)" >> ${GITHUB_ENV}
30-
- name: autoreconf
31-
shell: bash
32-
run: autoreconf -fiv
33-
- name: configure
34-
shell: bash
35-
run: CC="${{ inputs.cc }}" TEST_IP="${test_ips}" APACHE_MUTEX=pthread ./configure ${{ inputs.configure-options }}
36-
- name: store config.log
37-
uses: actions/upload-artifact@v4
38-
if: failure()
39-
with:
40-
name: ${{ inputs.artifact-prefix }}-config-log
41-
path: config.log
42-
- name: make
43-
shell: bash
44-
run: make -j4
45-
- name: make check
46-
shell: bash
47-
run: VERBOSE=1 make -j4 check
30+
- name: 'workaround for Meson versions < 1.1'
31+
shell: sh
32+
run: ln -s meson.options meson_options.txt
33+
- name: meson setup
34+
shell: sh
35+
run: meson setup -Dtest-ips="${TEST_IPS}" ${{ inputs.configure-options }} build
36+
env:
37+
CC: "${{ inputs.cc }}"
38+
TEST_IPS: "${{ env.test_ips }}"
39+
- name: meson compile
40+
shell: sh
41+
run: meson compile -C build/
42+
- name: meson test
43+
shell: sh
44+
run: meson test -C build/ --verbose
4845
- name: store test logs
4946
uses: actions/upload-artifact@v4
5047
if: failure() || cancelled()
5148
with:
5249
name: ${{ inputs.artifact-prefix }}-test-logs
5350
path: |
54-
test/test-*.log
55-
test/logs/
51+
build/meson-logs/
52+
build/test/*.log
53+
build/test/logs/

.github/workflows/analysis.yaml

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -20,67 +20,70 @@ permissions:
2020
jobs:
2121

2222
clang:
23-
runs-on: ubuntu-22.04
23+
runs-on: ubuntu-24.04
2424
container: debian:bookworm
2525
name: clang-analyzer
2626
steps:
2727
- name: install dependencies
2828
run: |
2929
export DEBIAN_FRONTEND=noninteractive
3030
apt-get update
31-
apt-get -y install git python3-yaml apache2-bin apache2-dev gnutls-bin libapr1-dev libgnutls28-dev pkgconf procps clang clang-tools
31+
apt-get -y install meson make git python3-yaml apache2-bin apache2-dev gnutls-bin libapr1-dev libgnutls28-dev pkgconf procps clang clang-tools
3232
- uses: actions/checkout@v4
33-
- name: find usable IPs for tests
34-
run: |
35-
echo "test_ips=$(python3 test/check_test_ips.py -H localhost)" >> ${GITHUB_ENV}
36-
- name: autoreconf
37-
run: autoreconf -fiv
38-
- name: configure
39-
run: scan-build --use-cc=clang ./configure TEST_IP="${test_ips}" APACHE_MUTEX=pthread CFLAGS=-Wno-error=null-pointer-subtraction
40-
- name: store config.log
41-
uses: actions/upload-artifact@v4
42-
if: failure()
43-
with:
44-
name: scan-build-config-log
45-
path: config.log
46-
- name: make
47-
run: scan-build -sarif -o sarif-output --use-cc=clang make
48-
- name: find output directory
49-
run: |
50-
echo "SARIF_DIR=$(ls -d sarif-output/*)" >> ${GITHUB_ENV}
33+
- name: 'workaround for Meson versions < 1.1'
34+
run: ln -s meson.options meson_options.txt
5135
- name: define CONTAINER_WORKSPACE
5236
run: |
5337
echo "CONTAINER_WORKSPACE=${PWD}" >> ${GITHUB_ENV}
54-
- name: upload SARIF results
55-
uses: github/codeql-action/upload-sarif@v3
38+
- name: meson setup
39+
run: |
40+
meson setup -Dpdf-doc=false build
41+
- name: ninja scan-build
42+
env:
43+
SCANBUILD: '${{ env.CONTAINER_WORKSPACE }}/support/scan-build-wrapper.sh'
44+
run: |
45+
ninja -C build/ scan-build
46+
- name: find output file
47+
id: html-output
48+
run: |
49+
scan_index="$(find build/meson-logs/scanbuild/ -name index.html)"
50+
if [ -n "$scan_index" ]; then
51+
echo ::warning::clang-analyzer detected errors
52+
echo "dir=$(dirname "$scan_index")" >> ${GITHUB_OUTPUT}
53+
else
54+
echo "dir=" >> ${GITHUB_OUTPUT}
55+
fi
56+
- name: upload HTML report
57+
uses: actions/upload-artifact@v4
58+
# If clang-analyzer didn't detect any issues, there's no
59+
# report to upload.
60+
if: steps.html-output.outputs.dir
5661
with:
57-
sarif_file: ${{ env.SARIF_DIR }}
58-
checkout_path: ${{ env.CONTAINER_WORKSPACE }}
62+
name: clang-analyzer-report
63+
path: ${{ steps.html-output.outputs.dir }}
5964

6065
cppcheck:
61-
runs-on: ubuntu-22.04
66+
runs-on: ubuntu-24.04
6267
container: debian:bookworm
6368
name: cppcheck
6469
steps:
6570
- name: install dependencies
6671
run: |
6772
export DEBIAN_FRONTEND=noninteractive
6873
apt-get update
69-
apt-get -y install git python3-yaml apache2-bin apache2-dev gnutls-bin libapr1-dev libgnutls28-dev pkgconf procps bear cppcheck
74+
apt-get -y install meson make git python3-yaml apache2-bin apache2-dev gnutls-bin libapr1-dev libgnutls28-dev pkgconf procps cppcheck
7075
- uses: actions/checkout@v4
71-
- name: autoreconf
72-
run: autoreconf -fiv
73-
- name: configure
74-
run: ./configure APACHE_MUTEX=pthread
75-
- name: make and create compile_commands.json
76-
run: bear -- make -j4
76+
- name: 'workaround for Meson versions < 1.1'
77+
run: ln -s meson.options meson_options.txt
78+
- name: meson setup
79+
run: meson setup -Dpdf-doc=false build
7780
- name: cppcheck
7881
run: |
79-
cppcheck --project=compile_commands.json -DAF_UNIX=1 --enable=warning,style,unusedFunction --xml 2>cppcheck.xml
82+
ninja -C build/ cppcheck-xml
8083
- uses: airtower-luna/[email protected]
8184
with:
8285
tool: 'CppCheck'
83-
input_file: 'cppcheck.xml'
86+
input_file: 'build/cppcheck.xml'
8487
sarif_file: 'cppcheck.sarif'
8588
- name: define CONTAINER_WORKSPACE
8689
run: |
@@ -92,23 +95,21 @@ jobs:
9295
checkout_path: ${{ env.CONTAINER_WORKSPACE }}
9396

9497
codeql:
95-
runs-on: ubuntu-22.04
98+
runs-on: ubuntu-24.04
9699
name: CodeQL
97100
steps:
98101
- uses: actions/checkout@v4
99102
- name: install dependencies
100103
run: |
101104
sudo apt-get update
102-
sudo apt-get -y install python3-yaml apache2-bin apache2-dev gnutls-bin libapr1-dev libgnutls28-dev pkgconf procps
105+
sudo apt-get -y install meson make python3-yaml apache2-bin apache2-dev gnutls-bin libapr1-dev libgnutls28-dev pkgconf procps
103106
- name: Initialize CodeQL
104107
uses: github/codeql-action/init@v3
105108
with:
106109
languages: cpp
107-
- name: autoreconf
108-
run: autoreconf -fiv
109-
- name: configure
110-
run: ./configure --disable-pdf-doc
111-
- name: make
112-
run: make -j4
110+
- name: meson setup
111+
run: meson setup -Dpdf-doc=false build
112+
- name: meson compile
113+
run: meson compile -C build/
113114
- name: Perform CodeQL Analysis
114115
uses: github/codeql-action/analyze@v3

.github/workflows/build.yaml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
container:
2121
- 'debian:bookworm'
2222
- 'debian:sid'
23-
- 'fedora:39'
23+
- 'fedora:40'
2424
- 'alpine:latest'
2525
runs-on: ubuntu-latest
2626
container: ${{ matrix.container }}
@@ -32,15 +32,15 @@ jobs:
3232
run: |
3333
export DEBIAN_FRONTEND=noninteractive
3434
apt-get update
35-
apt-get -y install python3-yaml apache2-bin apache2-dev curl gnutls-bin libapr1-dev libgnutls28-dev openssl pandoc pkgconf procps iproute2 softhsm2
35+
apt-get -y install python3-yaml apache2-bin apache2-dev curl gnutls-bin libapr1-dev libgnutls28-dev make meson openssl pandoc pkgconf procps iproute2 softhsm2
3636
- name: install dependencies (Fedora)
3737
if: startsWith(matrix.container, 'fedora')
3838
run: |
39-
dnf -y install bzip2 curl gcc gnutls-devel gnutls-utils httpd-devel iproute libtool make pkgconf python3-pyyaml redhat-rpm-config softhsm
39+
dnf -y install bzip2 curl gcc gnutls-devel gnutls-utils httpd-devel iproute make meson pkgconf python3-pyyaml redhat-rpm-config softhsm
4040
- name: install dependencies (Alpine)
4141
if: startsWith(matrix.container, 'alpine')
4242
run: |
43-
apk add apache2 apache2-dev apache2-proxy autoconf automake bash build-base gnutls-dev gnutls-utils libtool pkgconf python3 py3-yaml
43+
apk add apache2 apache2-dev apache2-proxy build-base gnutls-dev gnutls-utils make meson musl-dev pkgconf python3 py3-yaml
4444
- name: set prefix for container-specific artifacts
4545
# this is because upload-artifact doesn't like ":" in file names
4646
env:
@@ -51,35 +51,28 @@ jobs:
5151
uses: ./.github/build-action/
5252
with:
5353
artifact-prefix: ${{ env.artifact_prefix }}
54-
- name: make distcheck
55-
run: VERBOSE=1 make -j4 distcheck
5654

5755
coverage:
5856
runs-on: ubuntu-latest
59-
container: debian:bookworm
57+
container: debian:trixie
6058
name: coverage
6159
steps:
6260
- uses: actions/checkout@v4
6361
- name: install dependencies
6462
run: |
6563
export DEBIAN_FRONTEND=noninteractive
6664
apt-get update
67-
apt-get -y install python3-yaml apache2-bin apache2-dev curl gnutls-bin libapr1-dev libgnutls28-dev openssl pkgconf procps iproute2 softhsm2 clang llvm
65+
apt-get -y install python3-yaml apache2-bin apache2-dev curl gnutls-bin libapr1-dev libgnutls28-dev openssl make meson pkgconf procps iproute2 softhsm2 clang llvm gcovr
6866
- name: build mod_gnutls with coverage support
6967
uses: ./.github/build-action/
7068
with:
7169
cc: clang
72-
configure-options: >-
73-
--enable-clang-coverage
74-
CFLAGS="-Wno-null-pointer-subtraction"
70+
configure-options: -Db_coverage=true
7571
artifact-prefix: coverage
7672
- name: generate coverage report
77-
working-directory: ./test
78-
run: make -j4 coverage
73+
run: ninja -C build/ coverage-html
7974
- name: store coverage report
8075
uses: actions/upload-artifact@v4
8176
with:
8277
name: coverage-report
83-
path: test/coverage/
84-
- name: coverage summary
85-
run: llvm-cov report src/.libs/mod_gnutls.so -instr-profile=test/outputs/coverage.profdata src/*.c src/*.h include/*.h
78+
path: build/meson-logs/coveragereport/

.github/workflows/valgrind.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ jobs:
2626
run: |
2727
export DEBIAN_FRONTEND=noninteractive
2828
apt-get update
29-
apt-get -y install python3-yaml apache2-bin apache2-dev curl gnutls-bin libapr1-dev libgnutls28-dev openssl pkgconf procps iproute2 softhsm2 valgrind
29+
apt-get -y install meson make python3-yaml apache2-bin apache2-dev curl gnutls-bin libapr1-dev libgnutls28-dev openssl pkgconf procps iproute2 softhsm2 valgrind
3030
- name: build mod_gnutls and run tests with Valgrind
3131
uses: ./.github/build-action/
3232
with:
33-
configure-options: --enable-valgrind-test
33+
configure-options: -Dvalgrind-test=true -Dpdf-doc=false
3434
artifact-prefix: valgrind

.gitignore

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,4 @@
11
*~
2-
*.o
3-
*.lo
4-
*.la
5-
Makefile
6-
Makefile.in
7-
config
8-
autom4te.cache
9-
configure
10-
config.*
11-
libtool
12-
src/.deps
13-
src/.libs
14-
include/mod_gnutls.h
15-
include/mod_gnutls_config.h
16-
include/stamp-h1
17-
aclocal.m4
18-
m4/libtool.m4
19-
m4/ltoptions.m4
20-
m4/ltsugar.m4
21-
m4/ltversion.m4
22-
m4/lt~obsolete.m4
232
# clangd cache and compile config
243
/.cache
254
/compile_commands.json

.gitpod.Dockerfile

Lines changed: 0 additions & 20 deletions
This file was deleted.

.gitpod.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.theia/settings.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)