Dockerfile
----------
This dockerfile was used to emulate GitHub actions.
<details><summary>Dockerfile source (click to expand)</summary>
```dockerfile
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN set -ex; \
apt-get update; \
apt-get install -y build-essential meson appstream clang clang-format clang-tools libdbus-1-dev libinih-dev libsystemd-dev git
RUN set -ex; \
yes | adduser ci-user
USER ci-user
```
</details>
Commands to reproduce
---------------------
I simulated GitHub actions with a local docker environment.
docker build -t ci .
I ran the following commands to reproduce the issue so that I could bugfix the static analyzer script.
```bash
docker run -e CI=true --rm -v "$PWD:$PWD" -w "$PWD" --init ci ./scripts/static-analyser-check.sh
docker run -e CI=true --rm -v "$PWD:$PWD" -w "$PWD" --init ci ./bootstrap.sh -Dwith-examples=true
docker run --rm -v "$PWD:$PWD" -w "$PWD" --init ci meson test -C builddir
docker run --rm -v "$PWD:$PWD" -w "$PWD" --init ci dbus-run-session -- gamemode-simulate-game
docker run --rm -v "$PWD:$PWD" -w "$PWD" --init ci ./scripts/static-analyser-check.sh
```
All commands reuse the same workspace which is how it works in GH actions.
Legitimate bugs
---------------
Now the error displayed in build failure appears to be a legitimate bug. Four were found related to null pointer dereference. I'm not fixing the bug but the check should work properly for those who do.
If you following my docker setup in this description you can view the bug report by starting the report server.
```bash
docker run -p 127.0.0.1:8181:8181 -it --rm -v "$PWD:$PWD" -w "$PWD" --init ci scan-view --host 0.0.0.0 --allow-all-hosts builddir/meson-logs/scanbuild/*
```
After the report server is started you can visit `http://127.0.0.1:8181/` to view the bugs.
Screenshot of report
--------------------

If the internet connection is down, the default timeout of wget is
unreasonably long. If formatcheck is used as a pre-commit hook, this
blocks usage of git for a long time although we probably have
git-clang-format available.
Signed-off-by: Kai Krakow <kai@kaishome.de>
This adds support for a switch `--pre-commit` to work in
pre-commit-mode. It downloads the file and runs the real pre-commit-hook
then.
Signed-off-by: Kai Krakow <kai@kaishome.de>
This commit silences the standard output of wget to generate less noise
when using `format-check.sh` as a pre-commit hook.
It also doesn't redownload the file over and over again but only when
changes were detected. Previous behavior was wget creating numbered
versions by multiple downloads, thus it always used the first version
which was download. That is obviously wrong.
It errors out nicely now when the download failed.
Signed-off-by: Kai Krakow <kai@kaishome.de>
Only code formatting implemented at the moment.
Travis is currently Ubuntu 14.04, which is missing multiple library versions needed. Bootstrapping in Python 3.5, Meson and Ninja is possible, but can take a while, but also bootstrapping in libsystemd is one step too many for now as it takes a significant amount of time.
To facilitate a proper release process we now have scripts to create
complete tarballs in the fasion of autotools, which will also include
the archived `inih` project. The net result is a completel tarball which
build systems can use in a reproducable fashion without requiring network
access to complete, thus improving security and ensuring consistency in
results between various distributions should subprojects update.
Signed-off-by: Ikey Doherty <ikey@solus-project.com>