Merge pull request #2123 from profanity-im/ci
ci: Cleanup and improve CI jobs
This commit is contained in:
@@ -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
|
|
||||||
10
.gitattributes
vendored
Normal file
10
.gitattributes
vendored
Normal file
@@ -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
|
||||||
1
.github/workflows/cygwin-build.yml
vendored
1
.github/workflows/cygwin-build.yml
vendored
@@ -8,6 +8,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cygwin-build:
|
cygwin-build:
|
||||||
|
name: build only
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
env:
|
env:
|
||||||
CYGWIN: winsymlinks:nativestrict
|
CYGWIN: winsymlinks:nativestrict
|
||||||
|
|||||||
91
.github/workflows/main.yml
vendored
91
.github/workflows/main.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: CI
|
name: Linux
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -11,67 +11,46 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
linux:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
flavor: [debian, fedora, ubuntu]
|
include:
|
||||||
|
- flavor: debian
|
||||||
|
buildsystem: autotools
|
||||||
|
tests: unit
|
||||||
|
omemo: signal
|
||||||
|
script: ./ci/ci-build.sh
|
||||||
|
- flavor: fedora
|
||||||
|
buildsystem: autotools
|
||||||
|
tests: unit
|
||||||
|
omemo: signal
|
||||||
|
script: ./ci/ci-build.sh
|
||||||
|
- flavor: ubuntu
|
||||||
|
buildsystem: autotools
|
||||||
|
tests: unit
|
||||||
|
omemo: signal
|
||||||
|
script: ./ci/ci-build.sh
|
||||||
|
- flavor: debian
|
||||||
|
buildsystem: meson
|
||||||
|
tests: unit
|
||||||
|
omemo: signal
|
||||||
|
script: ./ci/ci-meson-build.sh
|
||||||
|
omemo_env: libsignal
|
||||||
|
- flavor: debian
|
||||||
|
buildsystem: meson
|
||||||
|
tests: unit
|
||||||
|
omemo: libomemo
|
||||||
|
script: ./ci/ci-meson-build.sh
|
||||||
|
omemo_env: libomemo-c
|
||||||
|
|
||||||
name: Linux
|
name: ${{ matrix.flavor }} | ${{ matrix.buildsystem }} | ${{ matrix.tests }} | ${{ matrix.omemo }}
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Run tests
|
|
||||||
run: |
|
|
||||||
docker build -f Dockerfile.${{ matrix.flavor }} -t profanity .
|
|
||||||
docker run profanity ./ci-build.sh
|
|
||||||
|
|
||||||
linux-meson:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
flavor: [debian]
|
|
||||||
|
|
||||||
name: Linux-meson
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
env:
|
env:
|
||||||
OMEMO_BACKEND: libomemo-c
|
OMEMO_BACKEND: ${{ matrix.omemo_env }}
|
||||||
run: |
|
run: |
|
||||||
docker build -f Dockerfile.${{ matrix.flavor }} -t profanity .
|
docker build -f ci/Dockerfile.${{ matrix.flavor }} -t profanity .
|
||||||
docker run -e OMEMO_BACKEND profanity ./ci-meson-build.sh
|
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
|
|
||||||
|
|||||||
45
.github/workflows/style.yml
vendored
Normal file
45
.github/workflows/style.yml
vendored
Normal file
@@ -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
|
||||||
22
Brewfile
22
Brewfile
@@ -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'
|
|
||||||
@@ -48,7 +48,7 @@ meson setup build_run -Domemo=enabled -Domemo-backend=libomemo-c
|
|||||||
3. Run: `./build_run/profanity`
|
3. Run: `./build_run/profanity`
|
||||||
|
|
||||||
We also have a [build section](https://profanity-im.github.io/guide/latest/build.html) in our user guide.
|
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
|
## Submitting patches
|
||||||
We recommend for people to always work on a dedicated git branch for each fix or feature.
|
We recommend for people to always work on a dedicated git branch for each fix or feature.
|
||||||
@@ -114,6 +114,18 @@ See-also: https://xmpp.org/extensions/xep-0384.html
|
|||||||
Co-authored-by: Another Dev <dev@example.com>
|
Co-authored-by: Another Dev <dev@example.com>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 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 <your.email@example.com>` line to the end of your commit message.
|
||||||
|
|
||||||
### GitHub
|
### GitHub
|
||||||
We would like to encourage people to use GitHub to create pull requests.
|
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,
|
It makes it easy for us to review the patches, track WIP branches, organize branches with labels and milestones,
|
||||||
@@ -180,7 +192,7 @@ snippet to `.git/hooks/pre-push`:
|
|||||||
```shell
|
```shell
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
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.
|
This will run the same tests that the CI runs and refuse the push if it fails.
|
||||||
@@ -202,7 +214,7 @@ In cases where you want to disable automatic formatting for a specific block of
|
|||||||
## Verification & Testing
|
## Verification & Testing
|
||||||
|
|
||||||
### Running unit tests
|
### 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
|
### Writing unit tests
|
||||||
We use the [cmocka](https://cmocka.org/) testing framework for unit tests.
|
We use the [cmocka](https://cmocka.org/) testing framework for unit tests.
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ RUN pacman -Syu --noconfirm && pacman -S --needed --noconfirm \
|
|||||||
gpgme \
|
gpgme \
|
||||||
gtk2 \
|
gtk2 \
|
||||||
libgcrypt \
|
libgcrypt \
|
||||||
libmicrohttpd \
|
|
||||||
libnotify \
|
libnotify \
|
||||||
libsignal-protocol-c \
|
libsignal-protocol-c \
|
||||||
libomemo-c \
|
libomemo-c \
|
||||||
@@ -34,7 +33,7 @@ RUN pacman -Syu --noconfirm && pacman -S --needed --noconfirm \
|
|||||||
gdk-pixbuf2 \
|
gdk-pixbuf2 \
|
||||||
qrencode
|
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
|
RUN useradd -mb /usr/src --shell=/bin/false aur && usermod -L aur
|
||||||
USER aur
|
USER aur
|
||||||
@@ -54,14 +53,5 @@ USER root
|
|||||||
|
|
||||||
RUN pacman -U --noconfirm libstrophe-git/libstrophe-git-*.pkg.tar.zst
|
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
|
WORKDIR /usr/src/profanity
|
||||||
COPY . /usr/src/profanity
|
COPY . /usr/src/profanity
|
||||||
@@ -39,14 +39,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
RUN mkdir -p /usr/src/{stabber,libstrophe,profanity}
|
RUN mkdir -p /usr/src/{stabber,libstrophe,profanity}
|
||||||
WORKDIR /usr/src
|
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
|
RUN git clone -c http.sslverify=false https://github.com/strophe/libstrophe
|
||||||
|
|
||||||
#WORKDIR /usr/src/stabber
|
WORKDIR /usr/src/stabber
|
||||||
#RUN ./bootstrap.sh
|
RUN ./bootstrap.sh
|
||||||
#RUN ./configure --prefix=/usr --disable-dependency-tracking
|
RUN ./configure --prefix=/usr --disable-dependency-tracking
|
||||||
#RUN make
|
RUN make
|
||||||
#RUN make install
|
RUN make install
|
||||||
|
|
||||||
WORKDIR /usr/src/libstrophe
|
WORKDIR /usr/src/libstrophe
|
||||||
RUN ./bootstrap.sh
|
RUN ./bootstrap.sh
|
||||||
@@ -1,15 +1,12 @@
|
|||||||
# Build the latest Fedora image
|
# Build the latest Fedora image
|
||||||
FROM fedora:latest
|
FROM fedora:latest
|
||||||
|
|
||||||
# expect - for functional tests
|
|
||||||
# libmicrohttpd - for stabber
|
|
||||||
# glibc-locale - to have en_US locale
|
# glibc-locale - to have en_US locale
|
||||||
RUN dnf install -y \
|
RUN dnf install -y \
|
||||||
autoconf \
|
autoconf \
|
||||||
autoconf-archive \
|
autoconf-archive \
|
||||||
automake \
|
automake \
|
||||||
awk \
|
awk \
|
||||||
expect-devel \
|
|
||||||
gcc \
|
gcc \
|
||||||
git \
|
git \
|
||||||
glib2-devel \
|
glib2-devel \
|
||||||
@@ -21,7 +18,6 @@ RUN dnf install -y \
|
|||||||
expat-devel \
|
expat-devel \
|
||||||
libgcrypt-devel \
|
libgcrypt-devel \
|
||||||
gpgme-devel \
|
gpgme-devel \
|
||||||
libmicrohttpd-devel \
|
|
||||||
libnotify-devel \
|
libnotify-devel \
|
||||||
libotr-devel \
|
libotr-devel \
|
||||||
libsignal-protocol-c-devel \
|
libsignal-protocol-c-devel \
|
||||||
@@ -47,15 +43,6 @@ ENV LC_ALL en_US.UTF-8
|
|||||||
RUN mkdir -p /usr/src
|
RUN mkdir -p /usr/src
|
||||||
WORKDIR /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 mkdir -p /usr/src/libstrophe
|
||||||
RUN git clone -c http.sslverify=false https://github.com/strophe/libstrophe
|
RUN git clone -c http.sslverify=false https://github.com/strophe/libstrophe
|
||||||
WORKDIR /usr/src/libstrophe
|
WORKDIR /usr/src/libstrophe
|
||||||
@@ -1,14 +1,11 @@
|
|||||||
# Build the latest openSUSE Tumbleweed image
|
# Build the latest openSUSE Tumbleweed image
|
||||||
FROM opensuse/tumbleweed
|
FROM opensuse/tumbleweed
|
||||||
|
|
||||||
# expect - for functional tests
|
|
||||||
# libmicrohttpd - for stabber
|
|
||||||
# glibc-locale - to have en_US locale
|
# glibc-locale - to have en_US locale
|
||||||
RUN zypper --non-interactive in --no-recommends \
|
RUN zypper --non-interactive in --no-recommends \
|
||||||
autoconf \
|
autoconf \
|
||||||
autoconf-archive \
|
autoconf-archive \
|
||||||
automake \
|
automake \
|
||||||
expect-devel \
|
|
||||||
gcc \
|
gcc \
|
||||||
git \
|
git \
|
||||||
glib2-devel \
|
glib2-devel \
|
||||||
@@ -21,7 +18,6 @@ RUN zypper --non-interactive in --no-recommends \
|
|||||||
libgcrypt-devel \
|
libgcrypt-devel \
|
||||||
libgpgme-devel \
|
libgpgme-devel \
|
||||||
libstrophe-devel \
|
libstrophe-devel \
|
||||||
libmicrohttpd-devel \
|
|
||||||
libnotify-devel \
|
libnotify-devel \
|
||||||
libotr-devel \
|
libotr-devel \
|
||||||
libsignal-protocol-c-devel \
|
libsignal-protocol-c-devel \
|
||||||
@@ -46,14 +42,6 @@ ENV LC_ALL en_US.UTF-8
|
|||||||
RUN mkdir -p /usr/src
|
RUN mkdir -p /usr/src
|
||||||
WORKDIR /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
|
RUN mkdir -p /usr/src/profanity
|
||||||
WORKDIR /usr/src/profanity
|
WORKDIR /usr/src/profanity
|
||||||
COPY . /usr/src/profanity
|
COPY . /usr/src/profanity
|
||||||
@@ -6,7 +6,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
autoconf \
|
autoconf \
|
||||||
autoconf-archive \
|
autoconf-archive \
|
||||||
automake \
|
automake \
|
||||||
expect \
|
|
||||||
gcc \
|
gcc \
|
||||||
git \
|
git \
|
||||||
libcmocka-dev \
|
libcmocka-dev \
|
||||||
@@ -15,7 +14,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
libglib2.0-dev \
|
libglib2.0-dev \
|
||||||
libgpgme11-dev \
|
libgpgme11-dev \
|
||||||
libgtk2.0-dev \
|
libgtk2.0-dev \
|
||||||
libmicrohttpd-dev \
|
|
||||||
libncursesw5-dev \
|
libncursesw5-dev \
|
||||||
libnotify-dev \
|
libnotify-dev \
|
||||||
libotr5-dev \
|
libotr5-dev \
|
||||||
@@ -34,19 +32,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
libgdk-pixbuf-2.0-dev \
|
libgdk-pixbuf-2.0-dev \
|
||||||
libqrencode-dev
|
libqrencode-dev
|
||||||
|
|
||||||
RUN mkdir -p /usr/src/{stabber,libstrophe,profanity}
|
RUN mkdir -p /usr/src/{libstrophe,profanity}
|
||||||
WORKDIR /usr/src
|
WORKDIR /usr/src
|
||||||
|
|
||||||
#RUN git clone https://github.com/boothj5/stabber
|
|
||||||
RUN git clone -c http.sslverify=false https://github.com/strophe/libstrophe
|
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
|
WORKDIR /usr/src/libstrophe
|
||||||
RUN ./bootstrap.sh
|
RUN ./bootstrap.sh
|
||||||
RUN ./configure --prefix=/usr
|
RUN ./configure --prefix=/usr
|
||||||
@@ -3,8 +3,12 @@
|
|||||||
log_content()
|
log_content()
|
||||||
{
|
{
|
||||||
echo
|
echo
|
||||||
echo "Content of $1:"
|
if [ -f "$1" ]; then
|
||||||
cat "$1"
|
echo "Content of $1:"
|
||||||
|
cat "$1"
|
||||||
|
else
|
||||||
|
echo "Log file $1 not found."
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
error_handler()
|
error_handler()
|
||||||
@@ -121,18 +125,14 @@ esac
|
|||||||
case "$ARCH" in
|
case "$ARCH" in
|
||||||
linux*)
|
linux*)
|
||||||
echo
|
echo
|
||||||
echo "--> Building with ./configure ${tests[0]} --enable-valgrind $*"
|
echo "--> Building with ./configure ${tests[0]} --enable-valgrind --disable-functional-tests $*"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
./configure ${tests[0]} --enable-valgrind $*
|
./configure ${tests[0]} --enable-valgrind --disable-functional-tests $*
|
||||||
|
|
||||||
$MAKE CC="${CC}"
|
$MAKE CC="${CC}"
|
||||||
if grep '^ID=' /etc/os-release | grep -q -e debian; then
|
$MAKE check-valgrind
|
||||||
$MAKE check-valgrind
|
|
||||||
else
|
|
||||||
$MAKE check-valgrind || log_content ./test-suite-memcheck.log
|
|
||||||
fi
|
|
||||||
$MAKE distclean
|
$MAKE distclean
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -140,14 +140,14 @@ esac
|
|||||||
for features in "${tests[@]}"
|
for features in "${tests[@]}"
|
||||||
do
|
do
|
||||||
echo
|
echo
|
||||||
echo "--> Building with ./configure ${features} $*"
|
echo "--> Building with ./configure ${features} --disable-functional-tests $*"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
./configure $features $*
|
./configure $features --disable-functional-tests $*
|
||||||
|
|
||||||
$MAKE CC="${CC}"
|
$MAKE CC="${CC}"
|
||||||
$MAKE check
|
$MAKE check-unit
|
||||||
|
|
||||||
./profanity -v
|
./profanity -v
|
||||||
$MAKE clean
|
$MAKE clean
|
||||||
@@ -9,10 +9,12 @@ error_handler()
|
|||||||
echo
|
echo
|
||||||
echo "Error ${ERR_CODE} with command '${BASH_COMMAND}' on line ${BASH_LINENO[0]}. Exiting."
|
echo "Error ${ERR_CODE} with command '${BASH_COMMAND}' on line ${BASH_LINENO[0]}. Exiting."
|
||||||
# Meson logs are stored in the build directory
|
# Meson logs are stored in the build directory
|
||||||
if [ -f "build/meson-logs/testlog.txt" ]; then
|
for log in build_run/meson-logs/testlog.txt build_valgrind/meson-logs/testlog.txt; do
|
||||||
echo "--- Meson Test Log ---"
|
if [ -f "$log" ]; then
|
||||||
cat build/meson-logs/testlog.txt
|
echo "--- Meson Test Log ($log) ---"
|
||||||
fi
|
cat "$log"
|
||||||
|
fi
|
||||||
|
done
|
||||||
exit ${ERR_CODE}
|
exit ${ERR_CODE}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,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 setup build_valgrind ${tests[0]} ${BACKEND_OPT} -Dtests=true -Db_sanitize=address,undefined
|
||||||
meson compile -C build_valgrind
|
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
|
rm -rf build_valgrind
|
||||||
fi
|
fi
|
||||||
@@ -64,7 +66,7 @@ do
|
|||||||
meson setup build_run ${features} ${BACKEND_OPT} -Dtests=true
|
meson setup build_run ${features} ${BACKEND_OPT} -Dtests=true
|
||||||
meson compile -C build_run
|
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
|
./build_run/profanity -v
|
||||||
done
|
done
|
||||||
17
configure.ac
17
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])])
|
[AS_HELP_STRING([--enable-gdk-pixbuf], [enable GDK Pixbuf support to scale avatars before uploading])])
|
||||||
AC_ARG_ENABLE([omemo-qrcode],
|
AC_ARG_ENABLE([omemo-qrcode],
|
||||||
[AS_HELP_STRING([--enable-omemo-qrcode], [enable ability to display omemo qr code])])
|
[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])
|
m4_include([m4/ax_valgrind_check.m4])
|
||||||
AX_VALGRIND_DFLT([drd], [off])
|
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])])
|
[AC_MSG_NOTICE([cmocka is not found, will not be able to run tests])])
|
||||||
|
|
||||||
AM_CONDITIONAL([HAVE_STABBER], [false])
|
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])
|
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
|
## Default parameters
|
||||||
AM_CFLAGS="$AM_CFLAGS -Wall -Wno-deprecated-declarations -std=gnu99 -ggdb3"
|
AM_CFLAGS="$AM_CFLAGS -Wall -Wno-deprecated-declarations -std=gnu99 -ggdb3"
|
||||||
|
|||||||
@@ -2652,3 +2652,12 @@
|
|||||||
fun:calloc
|
fun:calloc
|
||||||
fun:_dl_allocate_tls
|
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
|
||||||
|
}
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ _pendingPresence_free(ProfPendingPresence* presence)
|
|||||||
if (presence->last_activity)
|
if (presence->last_activity)
|
||||||
g_date_time_unref(presence->last_activity);
|
g_date_time_unref(presence->last_activity);
|
||||||
free(presence->barejid);
|
free(presence->barejid);
|
||||||
|
resource_destroy(presence->resource);
|
||||||
free(presence);
|
free(presence);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -685,6 +686,7 @@ roster_process_pending_presence(void)
|
|||||||
for (iter = roster_pending_presence; iter != NULL; iter = iter->next) {
|
for (iter = roster_pending_presence; iter != NULL; iter = iter->next) {
|
||||||
ProfPendingPresence* presence = iter->data;
|
ProfPendingPresence* presence = iter->data;
|
||||||
roster_update_presence(presence->barejid, presence->resource, presence->last_activity);
|
roster_update_presence(presence->barejid, presence->resource, presence->last_activity);
|
||||||
|
presence->resource = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_slist_free_full(roster_pending_presence, (GDestroyNotify)_pendingPresence_free);
|
g_slist_free_full(roster_pending_presence, (GDestroyNotify)_pendingPresence_free);
|
||||||
|
|||||||
Reference in New Issue
Block a user