From b53ec237787080b9b8995440cb7e7cb1ef17ce6e Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 20 Mar 2026 08:21:52 +0100 Subject: [PATCH 01/13] ci: Remove Brewfile a4cbf3e4 removed macOS from the CI. We couldn't get it to build and no community member stepped up. So let's remove this file now as well. --- Brewfile | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 Brewfile diff --git a/Brewfile b/Brewfile deleted file mode 100644 index d73a973c..00000000 --- a/Brewfile +++ /dev/null @@ -1,22 +0,0 @@ -brew 'autoconf' -brew 'autoconf-archive' -brew 'automake' -brew 'check' -brew 'cmocka' -brew 'curl' -brew 'expat' -brew 'glib' -brew 'gnutls' -brew 'gpgme' -brew 'gtk+' -brew 'libffi' -brew 'libotr' -brew 'libsignal-protocol-c' -brew 'libstrophe' -brew 'libtool' -brew 'ncurses' -brew 'openssl' -brew 'ossp-uuid' -brew 'pkg-config' -brew 'readline' -brew 'sqlite' From 180ee651a53b8c84e7ec46998c4aef14f1c747e4 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 20 Mar 2026 08:23:06 +0100 Subject: [PATCH 02/13] ci: Remove OpenBSD There once was OpenBSD CI from sr.ht sponsored by wstrm. It's not available since a log time. So let's drop it. --- .builds/openbsd.yml | 49 --------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 .builds/openbsd.yml diff --git a/.builds/openbsd.yml b/.builds/openbsd.yml deleted file mode 100644 index 326bdb5f..00000000 --- a/.builds/openbsd.yml +++ /dev/null @@ -1,49 +0,0 @@ -image: openbsd/7.0 - -packages: - - gcc-11.2.0p0 - - cmake - - gmake - - cmocka - - libtool - - automake-1.16.3 - - pkgconf - - readline - - python-3.8.12 - - autoconf-2.69p3 - - autoconf-archive - - curl - - gpgme - - glib2 - - gtk+2 - - libotr - - libassuan - - libgpg-error - - libgcrypt - - libsignal-protocol-c - - sqlite3 - -sources: - - https://github.com/strophe/libstrophe.git#0.11.0 - - https://github.com/profanity-im/profanity - -environment: - LANG: en_US.UTF-8 - -tasks: - - symlink: | - doas ln -sf /usr/local/bin/python3 /usr/local/bin/python - doas ln -sf /usr/local/bin/python3-config /usr/local/bin/python-config - doas ln -sf /usr/local/bin/pydoc3 /usr/local/bin/pydoc - - build: | - export AUTOCONF_VERSION=2.69 - export AUTOMAKE_VERSION=1.16 - - cd ~/libstrophe - ./bootstrap.sh - ./configure - make - doas make install - - cd ~/profanity - ./ci-build.sh From 8548dfca96868471f300f130e814c26ddae61b48 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 20 Mar 2026 08:36:17 +0100 Subject: [PATCH 03/13] ci: Move CI related files into own directory --- .github/workflows/main.yml | 8 ++++---- CONTRIBUTING.md | 6 +++--- Dockerfile.arch => ci/Dockerfile.arch | 0 Dockerfile.debian => ci/Dockerfile.debian | 0 Dockerfile.fedora => ci/Dockerfile.fedora | 0 Dockerfile.tumbleweed => ci/Dockerfile.tumbleweed | 0 Dockerfile.ubuntu => ci/Dockerfile.ubuntu | 0 ci-build.sh => ci/ci-build.sh | 0 ci-meson-build.sh => ci/ci-meson-build.sh | 0 9 files changed, 7 insertions(+), 7 deletions(-) rename Dockerfile.arch => ci/Dockerfile.arch (100%) rename Dockerfile.debian => ci/Dockerfile.debian (100%) rename Dockerfile.fedora => ci/Dockerfile.fedora (100%) rename Dockerfile.tumbleweed => ci/Dockerfile.tumbleweed (100%) rename Dockerfile.ubuntu => ci/Dockerfile.ubuntu (100%) rename ci-build.sh => ci/ci-build.sh (100%) rename ci-meson-build.sh => ci/ci-meson-build.sh (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b088b517..7b6ad396 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,8 +23,8 @@ jobs: - uses: actions/checkout@v2 - name: Run tests run: | - docker build -f Dockerfile.${{ matrix.flavor }} -t profanity . - docker run profanity ./ci-build.sh + docker build -f ci/Dockerfile.${{ matrix.flavor }} -t profanity . + docker run profanity ./ci/ci-build.sh linux-meson: runs-on: ubuntu-latest @@ -40,8 +40,8 @@ jobs: env: OMEMO_BACKEND: libomemo-c run: | - docker build -f Dockerfile.${{ matrix.flavor }} -t profanity . - docker run -e OMEMO_BACKEND profanity ./ci-meson-build.sh + docker build -f ci/Dockerfile.${{ matrix.flavor }} -t profanity . + docker run -e OMEMO_BACKEND profanity ./ci/ci-meson-build.sh code-style: runs-on: ubuntu-22.04 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aab8f83e..e7a860ac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,7 +48,7 @@ meson setup build_run -Domemo=enabled -Domemo-backend=libomemo-c 3. Run: `./build_run/profanity` We also have a [build section](https://profanity-im.github.io/guide/latest/build.html) in our user guide. -You might also take a look at the `Dockerfile.*` in the root directory. +You might also take a look at the `Dockerfile.*` in the `ci` directory. ## Submitting patches We recommend for people to always work on a dedicated git branch for each fix or feature. @@ -180,7 +180,7 @@ snippet to `.git/hooks/pre-push`: ```shell #!/bin/sh set -e -./ci-build.sh +./ci/ci-build.sh ``` This will run the same tests that the CI runs and refuse the push if it fails. @@ -202,7 +202,7 @@ In cases where you want to disable automatic formatting for a specific block of ## Verification & Testing ### Running unit tests -Run `make check` to run the unit tests with your current configuration or `./ci-build.sh` to check with different switches passed to configure. +Run `make check` to run the unit tests with your current configuration or `./ci/ci-build.sh` to check with different switches passed to configure. ### Writing unit tests We use the [cmocka](https://cmocka.org/) testing framework for unit tests. diff --git a/Dockerfile.arch b/ci/Dockerfile.arch similarity index 100% rename from Dockerfile.arch rename to ci/Dockerfile.arch diff --git a/Dockerfile.debian b/ci/Dockerfile.debian similarity index 100% rename from Dockerfile.debian rename to ci/Dockerfile.debian diff --git a/Dockerfile.fedora b/ci/Dockerfile.fedora similarity index 100% rename from Dockerfile.fedora rename to ci/Dockerfile.fedora diff --git a/Dockerfile.tumbleweed b/ci/Dockerfile.tumbleweed similarity index 100% rename from Dockerfile.tumbleweed rename to ci/Dockerfile.tumbleweed diff --git a/Dockerfile.ubuntu b/ci/Dockerfile.ubuntu similarity index 100% rename from Dockerfile.ubuntu rename to ci/Dockerfile.ubuntu diff --git a/ci-build.sh b/ci/ci-build.sh similarity index 100% rename from ci-build.sh rename to ci/ci-build.sh diff --git a/ci-meson-build.sh b/ci/ci-meson-build.sh similarity index 100% rename from ci-meson-build.sh rename to ci/ci-meson-build.sh From 45ddbe94e890228b0db82aa2ba6fc88d1043956b Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 20 Mar 2026 08:49:42 +0100 Subject: [PATCH 04/13] ci: Make CI more informative Have a better overview, we are interested in which tests are run, which distro, which build system and which omemo backend. debian | Autotools | unit+func | signal debian | Meson | unit+func | signal debian | Meson | unit+func | libomemo fedora | Autotools | unit+func | signal ubuntu | Autotools | unit+func | signal --- .github/workflows/main.yml | 54 +++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7b6ad396..e39245c3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,37 +11,49 @@ concurrency: cancel-in-progress: true jobs: - linux: + tests: runs-on: ubuntu-latest - strategy: + fail-fast: false matrix: - flavor: [debian, fedora, ubuntu] + include: + - flavor: debian + buildsystem: Autotools + tests: unit+func + omemo: signal + script: ./ci/ci-build.sh + - flavor: fedora + buildsystem: Autotools + tests: unit+func + omemo: signal + script: ./ci/ci-build.sh + - flavor: ubuntu + buildsystem: Autotools + tests: unit+func + omemo: signal + script: ./ci/ci-build.sh + - flavor: debian + buildsystem: Meson + tests: unit+func + omemo: signal + script: ./ci/ci-meson-build.sh + omemo_env: libsignal + - flavor: debian + buildsystem: Meson + tests: unit+func + omemo: libomemo + script: ./ci/ci-meson-build.sh + omemo_env: libomemo-c - name: Linux - steps: - - uses: actions/checkout@v2 - - name: Run tests - run: | - docker build -f ci/Dockerfile.${{ matrix.flavor }} -t profanity . - docker run profanity ./ci/ci-build.sh - - linux-meson: - runs-on: ubuntu-latest - - strategy: - matrix: - flavor: [debian] - - name: Linux-meson + name: ${{ matrix.flavor }} | ${{ matrix.buildsystem }} | ${{ matrix.tests }} | ${{ matrix.omemo }} steps: - uses: actions/checkout@v2 - name: Run tests env: - OMEMO_BACKEND: libomemo-c + OMEMO_BACKEND: ${{ matrix.omemo_env }} run: | docker build -f ci/Dockerfile.${{ matrix.flavor }} -t profanity . - docker run -e OMEMO_BACKEND profanity ./ci/ci-meson-build.sh + docker run ${OMEMO_BACKEND:+ -e OMEMO_BACKEND} profanity ${{ matrix.script }} code-style: runs-on: ubuntu-22.04 From f778e3e0936789d369bcc7cef529f1d8cd3b5489 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 20 Mar 2026 09:32:10 +0100 Subject: [PATCH 05/13] build(autotools): Add --enable-functional-tests switch --- configure.ac | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 713de0de..3fc71fe3 100644 --- a/configure.ac +++ b/configure.ac @@ -73,6 +73,8 @@ AC_ARG_ENABLE([gdk-pixbuf], [AS_HELP_STRING([--enable-gdk-pixbuf], [enable GDK Pixbuf support to scale avatars before uploading])]) AC_ARG_ENABLE([omemo-qrcode], [AS_HELP_STRING([--enable-omemo-qrcode], [enable ability to display omemo qr code])]) +AC_ARG_ENABLE([functional-tests], + [AS_HELP_STRING([--enable-functional-tests], [enable functional tests (default auto)])]) m4_include([m4/ax_valgrind_check.m4]) AX_VALGRIND_DFLT([drd], [off]) @@ -389,11 +391,18 @@ PKG_CHECK_MODULES([cmocka], [cmocka], [], [AC_MSG_NOTICE([cmocka is not found, will not be able to run tests])]) AM_CONDITIONAL([HAVE_STABBER], [false]) -AC_CHECK_LIB([stabber], [stbbr_start], [AM_CONDITIONAL([HAVE_STABBER], [true])], - [AC_MSG_NOTICE([libstabber not found, will not be able to run functional tests])]) AM_CONDITIONAL([HAVE_UTIL], [false]) -AC_CHECK_LIB([util], [forkpty], [AM_CONDITIONAL([HAVE_UTIL], [true])], - [AC_MSG_NOTICE([libutil not found, will not be able to run functional tests])]) + +if test "x$enable_functional_tests" != xno; then + AC_CHECK_LIB([stabber], [stbbr_start], [AM_CONDITIONAL([HAVE_STABBER], [true])], + [AS_IF([test "x$enable_functional_tests" = xyes], + [AC_MSG_ERROR([libstabber not found, but functional tests were explicitly enabled])], + [AC_MSG_NOTICE([libstabber not found, will not be able to run functional tests])])]) + AC_CHECK_LIB([util], [forkpty], [AM_CONDITIONAL([HAVE_UTIL], [true])], + [AS_IF([test "x$enable_functional_tests" = xyes], + [AC_MSG_ERROR([libutil not found, but functional tests were explicitly enabled])], + [AC_MSG_NOTICE([libutil not found, will not be able to run functional tests])])]) +fi ## Default parameters AM_CFLAGS="$AM_CFLAGS -Wall -Wno-deprecated-declarations -std=gnu99 -ggdb3" From 3596e4c263147863480911a6116a21196fc2ba30 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 20 Mar 2026 08:44:50 +0100 Subject: [PATCH 06/13] ci: Run functional tests only in the case of meson Remove stabber from Dockerfiles were we only build with autotools. --- .github/workflows/main.yml | 6 +++--- ci/Dockerfile.arch | 12 +----------- ci/Dockerfile.debian | 12 ++++++------ ci/Dockerfile.fedora | 13 ------------- ci/Dockerfile.tumbleweed | 12 ------------ ci/Dockerfile.ubuntu | 12 +----------- ci/ci-build.sh | 16 ++++++---------- 7 files changed, 17 insertions(+), 66 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e39245c3..fef47c2b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,17 +19,17 @@ jobs: include: - flavor: debian buildsystem: Autotools - tests: unit+func + tests: unit omemo: signal script: ./ci/ci-build.sh - flavor: fedora buildsystem: Autotools - tests: unit+func + tests: unit omemo: signal script: ./ci/ci-build.sh - flavor: ubuntu buildsystem: Autotools - tests: unit+func + tests: unit omemo: signal script: ./ci/ci-build.sh - flavor: debian diff --git a/ci/Dockerfile.arch b/ci/Dockerfile.arch index a2d71bb5..6f11acf0 100644 --- a/ci/Dockerfile.arch +++ b/ci/Dockerfile.arch @@ -17,7 +17,6 @@ RUN pacman -Syu --noconfirm && pacman -S --needed --noconfirm \ gpgme \ gtk2 \ libgcrypt \ - libmicrohttpd \ libnotify \ libsignal-protocol-c \ libomemo-c \ @@ -34,7 +33,7 @@ RUN pacman -Syu --noconfirm && pacman -S --needed --noconfirm \ gdk-pixbuf2 \ qrencode -RUN mkdir -p /usr/src/{stabber,profanity} +RUN mkdir -p /usr/src/profanity RUN useradd -mb /usr/src --shell=/bin/false aur && usermod -L aur USER aur @@ -54,14 +53,5 @@ USER root RUN pacman -U --noconfirm libstrophe-git/libstrophe-git-*.pkg.tar.zst -WORKDIR /usr/src -#RUN git clone https://github.com/boothj5/stabber - -#WORKDIR /usr/src/stabber -#RUN ./bootstrap.sh -#RUN ./configure --prefix=/usr --disable-dependency-tracking -#RUN make -#RUN make install - WORKDIR /usr/src/profanity COPY . /usr/src/profanity diff --git a/ci/Dockerfile.debian b/ci/Dockerfile.debian index 2f800965..d17b5eab 100644 --- a/ci/Dockerfile.debian +++ b/ci/Dockerfile.debian @@ -39,14 +39,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ RUN mkdir -p /usr/src/{stabber,libstrophe,profanity} WORKDIR /usr/src -#RUN git clone https://github.com/boothj5/stabber +RUN git clone -c http.sslverify=false https://github.com/profanity-im/stabber RUN git clone -c http.sslverify=false https://github.com/strophe/libstrophe -#WORKDIR /usr/src/stabber -#RUN ./bootstrap.sh -#RUN ./configure --prefix=/usr --disable-dependency-tracking -#RUN make -#RUN make install +WORKDIR /usr/src/stabber +RUN ./bootstrap.sh +RUN ./configure --prefix=/usr --disable-dependency-tracking +RUN make +RUN make install WORKDIR /usr/src/libstrophe RUN ./bootstrap.sh diff --git a/ci/Dockerfile.fedora b/ci/Dockerfile.fedora index a369a35d..3f3ee09b 100644 --- a/ci/Dockerfile.fedora +++ b/ci/Dockerfile.fedora @@ -1,15 +1,12 @@ # Build the latest Fedora image FROM fedora:latest -# expect - for functional tests -# libmicrohttpd - for stabber # glibc-locale - to have en_US locale RUN dnf install -y \ autoconf \ autoconf-archive \ automake \ awk \ - expect-devel \ gcc \ git \ glib2-devel \ @@ -21,7 +18,6 @@ RUN dnf install -y \ expat-devel \ libgcrypt-devel \ gpgme-devel \ - libmicrohttpd-devel \ libnotify-devel \ libotr-devel \ libsignal-protocol-c-devel \ @@ -47,15 +43,6 @@ ENV LC_ALL en_US.UTF-8 RUN mkdir -p /usr/src WORKDIR /usr/src -#RUN mkdir -p /usr/src/stabber -#RUN git clone https://github.com/boothj5/stabber -#WORKDIR /usr/src/stabber -#RUN ./bootstrap.sh -#RUN ./configure --prefix=/usr --disable-dependency-tracking -#RUN make -#RUN make install - -WORKDIR /usr/src RUN mkdir -p /usr/src/libstrophe RUN git clone -c http.sslverify=false https://github.com/strophe/libstrophe WORKDIR /usr/src/libstrophe diff --git a/ci/Dockerfile.tumbleweed b/ci/Dockerfile.tumbleweed index 516c9722..f4864552 100644 --- a/ci/Dockerfile.tumbleweed +++ b/ci/Dockerfile.tumbleweed @@ -1,14 +1,11 @@ # Build the latest openSUSE Tumbleweed image FROM opensuse/tumbleweed -# expect - for functional tests -# libmicrohttpd - for stabber # glibc-locale - to have en_US locale RUN zypper --non-interactive in --no-recommends \ autoconf \ autoconf-archive \ automake \ - expect-devel \ gcc \ git \ glib2-devel \ @@ -21,7 +18,6 @@ RUN zypper --non-interactive in --no-recommends \ libgcrypt-devel \ libgpgme-devel \ libstrophe-devel \ - libmicrohttpd-devel \ libnotify-devel \ libotr-devel \ libsignal-protocol-c-devel \ @@ -46,14 +42,6 @@ ENV LC_ALL en_US.UTF-8 RUN mkdir -p /usr/src WORKDIR /usr/src -#RUN mkdir -p /usr/src/stabber -#RUN git clone git://github.com/boothj5/stabber.git -#WORKDIR /usr/src/stabber -#RUN ./bootstrap.sh -#RUN ./configure --prefix=/usr --disable-dependency-tracking -#RUN make -#RUN make install - RUN mkdir -p /usr/src/profanity WORKDIR /usr/src/profanity COPY . /usr/src/profanity diff --git a/ci/Dockerfile.ubuntu b/ci/Dockerfile.ubuntu index d5ec731f..2ee5a86e 100644 --- a/ci/Dockerfile.ubuntu +++ b/ci/Dockerfile.ubuntu @@ -6,7 +6,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ autoconf \ autoconf-archive \ automake \ - expect \ gcc \ git \ libcmocka-dev \ @@ -15,7 +14,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libglib2.0-dev \ libgpgme11-dev \ libgtk2.0-dev \ - libmicrohttpd-dev \ libncursesw5-dev \ libnotify-dev \ libotr5-dev \ @@ -34,19 +32,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libgdk-pixbuf-2.0-dev \ libqrencode-dev -RUN mkdir -p /usr/src/{stabber,libstrophe,profanity} +RUN mkdir -p /usr/src/{libstrophe,profanity} WORKDIR /usr/src -#RUN git clone https://github.com/boothj5/stabber RUN git clone -c http.sslverify=false https://github.com/strophe/libstrophe -# TODO: Re-enable once libmicrohttpd-dev has been updated. -#WORKDIR /usr/src/stabber -#RUN ./bootstrap.sh -#RUN ./configure --prefix=/usr --disable-dependency-tracking -#RUN make -#RUN make install - WORKDIR /usr/src/libstrophe RUN ./bootstrap.sh RUN ./configure --prefix=/usr diff --git a/ci/ci-build.sh b/ci/ci-build.sh index 82ff76ff..662201ea 100755 --- a/ci/ci-build.sh +++ b/ci/ci-build.sh @@ -121,18 +121,14 @@ esac case "$ARCH" in linux*) echo - echo "--> Building with ./configure ${tests[0]} --enable-valgrind $*" + echo "--> Building with ./configure ${tests[0]} --enable-valgrind --disable-functional-tests $*" echo # shellcheck disable=SC2086 - ./configure ${tests[0]} --enable-valgrind $* + ./configure ${tests[0]} --enable-valgrind --disable-functional-tests $* $MAKE CC="${CC}" - if grep '^ID=' /etc/os-release | grep -q -e debian; then - $MAKE check-valgrind - else - $MAKE check-valgrind || log_content ./test-suite-memcheck.log - fi + $MAKE check-valgrind $MAKE distclean ;; esac @@ -140,14 +136,14 @@ esac for features in "${tests[@]}" do echo - echo "--> Building with ./configure ${features} $*" + echo "--> Building with ./configure ${features} --disable-functional-tests $*" echo # shellcheck disable=SC2086 - ./configure $features $* + ./configure $features --disable-functional-tests $* $MAKE CC="${CC}" - $MAKE check + $MAKE check-unit ./profanity -v $MAKE clean From 4417ec453a36ddf0069e1a39fd9fa23095ddb177 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 20 Mar 2026 12:42:35 +0100 Subject: [PATCH 07/13] chore: Update valgrind suppression file Locally valgrind is quiet. But on CI valgrind complains. This is due to an older valgrind version which doesn't handle AVX2-optimized strings properly. So we need to add it to the suppression file. --- prof.supp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/prof.supp b/prof.supp index 36f9ef71..8f513c5e 100644 --- a/prof.supp +++ b/prof.supp @@ -2652,3 +2652,12 @@ fun:calloc fun:_dl_allocate_tls } + +# glibc/avx2 false positives +{ + g_utf8_collate_key_invalid_read_avx2 + Memcheck:Addr32 + fun:__wcpncpy_avx2 + fun:wcsxfrm_l + fun:g_utf8_collate_key +} From 2d7426fb2fcae8e72a1b86218356eccaa5645d56 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 20 Mar 2026 12:43:58 +0100 Subject: [PATCH 08/13] fix: Fix rare memleak Triggered by unit tests. In Profanity itself the situation is probably rarely happening. We would have to disconnect/exit after receiving presence but before the roster arrives. --- src/xmpp/roster_list.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/xmpp/roster_list.c b/src/xmpp/roster_list.c index 633edbae..7a72326e 100644 --- a/src/xmpp/roster_list.c +++ b/src/xmpp/roster_list.c @@ -86,6 +86,7 @@ _pendingPresence_free(ProfPendingPresence* presence) if (presence->last_activity) g_date_time_unref(presence->last_activity); free(presence->barejid); + resource_destroy(presence->resource); free(presence); } @@ -685,6 +686,7 @@ roster_process_pending_presence(void) for (iter = roster_pending_presence; iter != NULL; iter = iter->next) { ProfPendingPresence* presence = iter->data; roster_update_presence(presence->barejid, presence->resource, presence->last_activity); + presence->resource = NULL; } g_slist_free_full(roster_pending_presence, (GDestroyNotify)_pendingPresence_free); From 551aea683ae9f780b026122c2fc87cd21543795c Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 20 Mar 2026 10:59:13 +0100 Subject: [PATCH 09/13] ci: Only print log file if we find it --- ci/ci-build.sh | 8 ++++++-- ci/ci-meson-build.sh | 10 ++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ci/ci-build.sh b/ci/ci-build.sh index 662201ea..606732bf 100755 --- a/ci/ci-build.sh +++ b/ci/ci-build.sh @@ -3,8 +3,12 @@ log_content() { echo - echo "Content of $1:" - cat "$1" + if [ -f "$1" ]; then + echo "Content of $1:" + cat "$1" + else + echo "Log file $1 not found." + fi } error_handler() diff --git a/ci/ci-meson-build.sh b/ci/ci-meson-build.sh index 1e86f86c..1d8bfd77 100755 --- a/ci/ci-meson-build.sh +++ b/ci/ci-meson-build.sh @@ -9,10 +9,12 @@ error_handler() echo echo "Error ${ERR_CODE} with command '${BASH_COMMAND}' on line ${BASH_LINENO[0]}. Exiting." # Meson logs are stored in the build directory - if [ -f "build/meson-logs/testlog.txt" ]; then - echo "--- Meson Test Log ---" - cat build/meson-logs/testlog.txt - fi + for log in build_run/meson-logs/testlog.txt build_valgrind/meson-logs/testlog.txt; do + if [ -f "$log" ]; then + echo "--- Meson Test Log ($log) ---" + cat "$log" + fi + done exit ${ERR_CODE} } From 24335c657c95a79965c1fdfb54e589116d6884af Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 20 Mar 2026 13:10:47 +0100 Subject: [PATCH 10/13] ci: Sort jobs and names in a better way Instead of: ``` CI / Check coding style CI / Check spelling CI / debian | Autotools | unit | signal CI / debian | Meson | unit+func | libomemo CI / debian | Meson | unit+func | signal CI / fedora | Autotools | unit | signal CI / ubuntu | Autotools | unit | signal Cygwin / cygwin-build ``` We will sort them into "Style", "Linux" and "Cygwin". --- .github/workflows/cygwin-build.yml | 1 + .github/workflows/main.yml | 45 ++++-------------------------- .github/workflows/style.yml | 45 ++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/style.yml diff --git a/.github/workflows/cygwin-build.yml b/.github/workflows/cygwin-build.yml index 63030772..e9c6616f 100644 --- a/.github/workflows/cygwin-build.yml +++ b/.github/workflows/cygwin-build.yml @@ -8,6 +8,7 @@ on: jobs: cygwin-build: + name: build only runs-on: windows-latest env: CYGWIN: winsymlinks:nativestrict diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fef47c2b..8d955c10 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: CI +name: Linux on: push: @@ -18,28 +18,28 @@ jobs: matrix: include: - flavor: debian - buildsystem: Autotools + buildsystem: autotools tests: unit omemo: signal script: ./ci/ci-build.sh - flavor: fedora - buildsystem: Autotools + buildsystem: autotools tests: unit omemo: signal script: ./ci/ci-build.sh - flavor: ubuntu - buildsystem: Autotools + buildsystem: autotools tests: unit omemo: signal script: ./ci/ci-build.sh - flavor: debian - buildsystem: Meson + buildsystem: meson tests: unit+func omemo: signal script: ./ci/ci-meson-build.sh omemo_env: libsignal - flavor: debian - buildsystem: Meson + buildsystem: meson tests: unit+func omemo: libomemo script: ./ci/ci-meson-build.sh @@ -54,36 +54,3 @@ jobs: run: | docker build -f ci/Dockerfile.${{ matrix.flavor }} -t profanity . docker run ${OMEMO_BACKEND:+ -e OMEMO_BACKEND} profanity ${{ matrix.script }} - - code-style: - runs-on: ubuntu-22.04 - name: Check coding style - continue-on-error: true - steps: - - uses: actions/checkout@v2 - # if this check fails, you have to update the number of auto types known and the list of auto types in the check below - - name: Check auto types are up-to-date - run: | - [[ "$(find src -type f -name '*.[ch]' -exec awk '/^#define auto_[\W]*/ {print $2}' '{}' \; | sort -u | wc -l)" == "9" ]] || exit -1 - - name: Check auto types are initialized - run: | - grep -P 'auto_(char|gchar|gcharv|gerror|guchar|jid|sqlite|gfd|FILE)[\w *]*;$' -r src && exit -1 || true - - name: Run clang-format - uses: jidicula/clang-format-action@v4.16.0 - with: - clang-format-version: '21' - check-path: 'src' - - spell-check: - runs-on: ubuntu-22.04 - name: Check spelling - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: install dependencies - run: | - sudo apt update - sudo apt install -y --no-install-recommends codespell - - name: Check spelling - run: | - codespell diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml new file mode 100644 index 00000000..fb12e81c --- /dev/null +++ b/.github/workflows/style.yml @@ -0,0 +1,45 @@ +name: Style + +on: + push: + branches: [master] + pull_request: + branches: [master] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + code-style: + runs-on: ubuntu-22.04 + name: coding style + continue-on-error: true + steps: + - uses: actions/checkout@v2 + # if this check fails, you have to update the number of auto types known and the list of auto types in the check below + - name: Check auto types are up-to-date + run: | + [[ "$(find src -type f -name '*.[ch]' -exec awk '/^#define auto_[\W]*/ {print $2}' '{}' \; | sort -u | wc -l)" == "9" ]] || exit -1 + - name: Check auto types are initialized + run: | + grep -P 'auto_(char|gchar|gcharv|gerror|guchar|jid|sqlite|gfd|FILE)[\w *]*;$' -r src && exit -1 || true + - name: Run clang-format + uses: jidicula/clang-format-action@v4.16.0 + with: + clang-format-version: '21' + check-path: 'src' + + spell-check: + runs-on: ubuntu-22.04 + name: spellcheck + continue-on-error: true + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: | + sudo apt update + sudo apt install -y --no-install-recommends codespell + - name: Check spelling + run: | + codespell From 3b988f6790760d486d5bea2175c48cb5ca0ccc45 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 20 Mar 2026 14:03:52 +0100 Subject: [PATCH 11/13] build: add .gitattributes to exclude development files from exports This will result in smaller and cleaner tarballs for distributions to use. Additionally it is a logical step towards moving fully to the Meson build system. While the last release provided two tarballs (one generated with Autotools and one with Meson), the next release will only provide a Meson-generated tarball. These attributes are respected by `git archive` and `meson dist` which means they will take effect for the Meson generated tarballs and the GitHub autogenerated tarballs as well. As a consequence of switching to `meson dist`, pre-generated files like `configure` will no longer be included in the tarballs. Users and distributions that still wish to use the Autotools build system from these tarballs will now need to run `./bootstrap.sh` or `autoreconf -fi` themselves, which requires automake, autoconf, and libtool to be installed. Since many distributions are slowly dropping the usage of vendor generated tarballs and are moving to checking out git tags this should not be a problem. Arch Linux is for example doing `source=("git+https://github.com/user/project.git#tag=v1.2.3")` and Debian has the `git-buildpackage` too. So both of them require require autoreconf already. Autotools support might be removed entirely in a future release since I find them much easier to edit and maintain. --- .gitattributes | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..e70cd0c0 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,10 @@ +# Pattern Attribute +.clang-format export-ignore +.codespellrc export-ignore +.git-blame-ignore-revs export-ignore +.github/* export-ignore +CONTRIBUTING.md export-ignore +RELEASE_GUIDE.md export-ignore +ci/* export-ignore +prof.supp export-ignore +scripts/* export-ignore From c7834e022bf8628cd7ba7dd29ec7eb0fd7ffd0a9 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 20 Mar 2026 14:16:46 +0100 Subject: [PATCH 12/13] chore: Require DCO from now on Explain the how and why in CONTRIBUTING.md Signed-off-by: Michael Vetter --- CONTRIBUTING.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e7a860ac..d402d35c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -114,6 +114,18 @@ See-also: https://xmpp.org/extensions/xep-0384.html Co-authored-by: Another Dev ``` +### Developer Certificate of Origin (DCO) +To ensure that all contributions are legally cleared for inclusion in the project, **all commits must be signed-off**. + +By signing off your commits, you certify that you have the right to submit the code under the project's license (GPL-3.0-or-later). This is a standard industry practice to protect both the project and its contributors. + +#### How to Sign-Off Your Commits +Simply add the `-s` flag when committing: +```bash +git commit -s -m "Message" +``` +This will append a `Signed-off-by: Your Name ` line to the end of your commit message. + ### GitHub We would like to encourage people to use GitHub to create pull requests. It makes it easy for us to review the patches, track WIP branches, organize branches with labels and milestones, From 540d9e686c03d7a16a32f9861ae6080a912e1cf8 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 20 Mar 2026 14:22:26 +0100 Subject: [PATCH 13/13] ci: Don't run functional tests in CI yet Disable the functional tests in the case of meson as well. They don't seem to work in the CI or take too long. This needs further investigation. For now let's run them locally and before each release. Signed-off-by: Michael Vetter --- .github/workflows/main.yml | 4 ++-- ci/ci-meson-build.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8d955c10..d7442f5f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,13 +34,13 @@ jobs: script: ./ci/ci-build.sh - flavor: debian buildsystem: meson - tests: unit+func + tests: unit omemo: signal script: ./ci/ci-meson-build.sh omemo_env: libsignal - flavor: debian buildsystem: meson - tests: unit+func + tests: unit omemo: libomemo script: ./ci/ci-meson-build.sh omemo_env: libomemo-c diff --git a/ci/ci-meson-build.sh b/ci/ci-meson-build.sh index 1d8bfd77..873b8c44 100755 --- a/ci/ci-meson-build.sh +++ b/ci/ci-meson-build.sh @@ -49,7 +49,7 @@ if [[ "$(uname | tr '[:upper:]' '[:lower:]')" == linux* ]]; then meson setup build_valgrind ${tests[0]} ${BACKEND_OPT} -Dtests=true -Db_sanitize=address,undefined meson compile -C build_valgrind - meson test -C build_valgrind --print-errorlogs --wrap=valgrind || echo "Valgrind issues detected" + meson test -C build_valgrind "unit tests" --print-errorlogs --wrap=valgrind || echo "Valgrind issues detected" rm -rf build_valgrind fi @@ -66,7 +66,7 @@ do meson setup build_run ${features} ${BACKEND_OPT} -Dtests=true meson compile -C build_run - meson test -C build_run --print-errorlogs + meson test -C build_run "unit tests" --print-errorlogs ./build_run/profanity -v done