Simon McVittie [Fri, 24 Jun 2022 14:20:12 +0000 (15:20 +0100)]
test: Make environment variables consistent with Autotools
DBUS_SESSION_BUS_LISTEN_ADDRESS is the same as in non-test files:
the test data distinguishes between DBUS_SESSION_BUS_LISTEN_ADDRESS,
the real session bus configuration, and TEST_LISTEN, the test-only
configuration.
DBUS_TEST_HOMEDIR and HOME should be in the build directory, not
the source directory.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Fri, 24 Jun 2022 12:17:26 +0000 (13:17 +0100)]
build: Implement a runtime_dir option
If the prefix is /usr, then this defaults to /run, similar to the
special cases for /var and /etc built into Meson. This is correct for
typical modern Linux distributions implementing FHS 3.0. This is
intentionally not consistent with Autotools and CMake: if distributions
are transitioning to a different way to build dbus, then that's a good
time to re-evaluate their build options.
Otherwise, this defaults to LOCALSTATEDIR/run, consistent with Autotools
and CMake.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Fri, 24 Jun 2022 12:01:54 +0000 (13:01 +0100)]
test: Correct generation of .test metadata
If a helper executable is not, in itself, a test-case, then we should
not generate metadata that tells ginsttest-runner to run it as a
test-case.
Meanwhile, we were previously generating foo_with_config.test metadata
for tests that don't get installed; stop doing that.
We also need to distinguish between the abstract name of the test
(which usually does not start with test-), the name of the .test file
(which does start with test- for compiled executables), and the name
of the executable (which may include .exe as well). To make validation
against the Autotools build system as straightforward as possible,
generate exactly the same names as in Autotools. We can consider removing
the test- prefix later, if we remove the Autotools build system.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Fri, 24 Jun 2022 11:59:40 +0000 (12:59 +0100)]
test: Don't run integration tests at build-time
Some items listed in the tests array are helper executables rather
than actually being tests, and should not be run as a test at any time.
Those have {"test": false}. Expand this special case to the scripts
array for completeness (although currently, no scripts need this).
Meanwhile, some items listed in the scripts array are "as-installed"
integration tests which cannot safely be run at build-time, because
they make assertions about the state of the installed system.
Introduce {"build_time_test": false} for these, and expand this special
case to the tests array for completeness (although currently, no
compiled executables need this).
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Fri, 24 Jun 2022 11:47:25 +0000 (12:47 +0100)]
build: Resolve localstatedir, sysconfdir relative to prefix
If the prefix is something like /opt/dbus, then --localstatedir=var
should result in using /opt/dbus/var, and so on. However, if configured
with --localstatedir=/var, then the prefix is ignored.
Meson special-cases these to default to /var and /etc (respectively),
as absolute paths, if the prefix is /usr; so distribution builds will
typically still end up using /var and /etc.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 27 Jun 2022 11:42:42 +0000 (12:42 +0100)]
.gitignore: Ignore __pycache__ directories anywhere in the tree
The Meson build system adds several Python scripts, some of which import
code from other Python scripts, which will result in __pycache__
directories appearing in the source tree.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Wed, 13 Jul 2022 14:52:39 +0000 (15:52 +0100)]
spec: Document a recommendation for IDNs in reversed domain names
D-Bus names are in an ASCII subset, so IDNs have to be in their ACE
encoding (Punycode). ACE-encoded labels contain hyphen/minus characters,
and like any other label containing a hyphen/minus, we recommend
replacing those with underscores, to improve interoperability with
contexts that allow underscores but not hyphen/minus, such as
D-Bus object paths and Flatpak app-IDs.
Prompted by <https://github.com/flatpak/flatpak/issues/4974>.
Signed-off-by: Simon McVittie <smcv@collabora.com>
GCC 10.2.0 complains on opensuse mingw builds, ex:
disable-crash-handling.c: error: STABS debugging information is obsolete and not supported anymore [-Werror]
According to
https://gitlab.freedesktop.org/dbus/dbus/-/issues/133#note_129599,
-gdwarf-2 is the second best option.
Ralf Habacker [Wed, 17 Nov 2021 09:51:39 +0000 (10:51 +0100)]
Add a test application for autostart on Windows implementation
The test application performs several individual tests to detect possible
problems with the autostart support under Windows. Connections are tested
with the standard scope, a 'custom' scope, the 'install path' scope and
the 'user' scope.
Ralf Habacker [Mon, 20 Dec 2021 11:34:14 +0000 (12:34 +0100)]
sysdeps-win: Use the `connection readiness` event when starting dbus-daemon
In _dbus_get_autolaunch_address() instead of polling at intervals to see
if the shared memory segment is present, the named signal is now used to
reliably get the state of dbus-daemon.
In _dbus_get_autolaunch_shm() the unnecessary initialization of `address`
has been removed, error handling has been improved and the `wait` parameter
has been added to select waiting.
Simon McVittie [Wed, 18 May 2022 13:01:25 +0000 (14:01 +0100)]
COPYING: Move full license text into LICENSES/
Having the full text of the AFL-2.1 and GPL in this file makes it harder
to find the unique information, which is the summary. Move their full
text into LICENSES/ (consistent with how REUSE handles this), leaving
a short summary of the licensing situation in COPYING.
Loosely based on work from Ralf Habacker in dbus!304.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Alex Richardson [Wed, 25 May 2022 22:05:03 +0000 (22:05 +0000)]
configure: Avoid exit() when checking for __sync_sub_and_fetch()
Use of exit() requires a stdlib.h include. This check was failing for me
since the compiler defaulted to -Werror=implicit-function-declaration, so
__sync_sub_and_fetch() support was not dectected.
Alex Richardson [Sun, 22 May 2022 22:08:32 +0000 (22:08 +0000)]
dbus-mempool.c: Ensure element_size is at least sizeof(void *)
I am trying to use DBus on an Arm Morello system where sizeof(void *) is
16 and not 8, so the assertion in the line below can fail unless we ensure
that element_size is at least sizeof(void *).
Simon McVittie [Wed, 18 May 2022 11:46:09 +0000 (12:46 +0100)]
.editorconfig: Automatically configure multiple text editors
See editorconfig.org for details of the format. This is a first attempt
at describing our coding style in editorconfig syntax; please add new
file types here as they become relevant.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Some pages are missing AUTHOR section, xmlto complains about it, ex:
Warn: meta author : no refentry/info/author dbus-update-activation-environment
Note: meta author : see http://www.docbook.org/tdg5/en/html/autho dbus-update-activation-environment
Warn: meta author : no author data, so inserted a fixme dbus-update-activation-environment
Alex Richardson [Tue, 17 May 2022 09:26:58 +0000 (09:26 +0000)]
Add a clang-format configuration file
This ensures that IDEs such as CLion automatically use the correct
indentation, and running `git-clang-format` results in patches that are
actually quite close to the current style. It doesn't handle alignment
of parameters in function declarations, but otherwise it seems accurate.
Ralf Habacker [Thu, 3 Mar 2022 16:15:44 +0000 (17:15 +0100)]
On Windows in autolaunch related function use rmutex related functions to support thread locking
The previously used additional and incomplete functions have been merged
into the current rmutex functions to fix the reported bug and reduce the
maintenance effort.
Alex Richardson [Sun, 15 May 2022 10:12:41 +0000 (11:12 +0100)]
dbus-string.c: use memcpy() in _dbus_string_insert_{2,4,8}_aligned
This fixes a -Wcast-align warning from Clang, and I believe this could
be a genuine issue on some architectures since the octets argument is
an unsigned char pointer that only has alignment 1. Using memcpy() instead
will generate the same code on architectures that support unaligned loads
and stores (i.e. almost all current ones) and individual stores on those
that don't (e.g. old MIPS).
Clang performs the -Wcast-align analysis before code generation and
optimizations, so the compiler cannot see that the alignment is actually
guaranteed to be sufficient for these casts. Silence the warning by adding
casts to void* and/or changing the types of some variables.
Alex Richardson [Sun, 20 Mar 2022 00:40:22 +0000 (00:40 +0000)]
tools/ci-build.sh: Add a ci_cmake_junit_output argument
CMake 3.21 can emit JUnit XML test results which can be visualized by
GitLab. This also updates the gitlab CI config file to make use of this
feature whenever possible.
Alex Richardson [Sun, 15 May 2022 10:28:51 +0000 (11:28 +0100)]
cmake: Fix definition of DBUS_USE_SYNC
dbus-sysdeps-unix.c checks for DBUS_USE_SYNC using 0/1 checks not defined
checks, so we should be using #cmakedefine01. This fixes lots of -Wundef
warnings when compiling for FreeBSD and ensures that we actually use
atomics instead of the pthread fallback there.
Alex Richardson [Mon, 18 Apr 2022 22:18:41 +0000 (22:18 +0000)]
Use freedesktop/ci-templates for the GitLab CI
The CI templates include infrastructure to create docker images with all
packages specified in tools/ci-install.sh. Using those docker images
speeds up the CI since we don't have to install all the dependencies in
every pipeline. We could extend this to also create containers that have
mingw pre-installed but for now we only create an image with the
dependencies that are required for every job.