]> git.ipfire.org Git - thirdparty/dbus.git/log
thirdparty/dbus.git
3 years agodoc: Build Ducktype documentation even if doxygen is not found
Simon McVittie [Fri, 24 Jun 2022 11:16:28 +0000 (12:16 +0100)] 
doc: Build Ducktype documentation even if doxygen is not found

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agocmake: Generate the same DBus1Config with Meson as with Autotools
Simon McVittie [Fri, 24 Jun 2022 10:12:12 +0000 (11:12 +0100)] 
cmake: Generate the same DBus1Config with Meson as with Autotools

DBus1Config.cmake.in relies on DBus1Targets.cmake, which is generated
by CMake. DBus1Config.pkgconfig.in uses pkg-config and is independent
of CMake.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest/data: Generate a separate installable set of data files
Simon McVittie [Thu, 23 Jun 2022 19:26:55 +0000 (20:26 +0100)] 
test/data: Generate a separate installable set of data files

Some of the strings we need to substitute into these files are not
the same for as-installed testing as for build-time testing.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobuild-timestamp.py: Respect SOURCE_DATE_EPOCH
Simon McVittie [Thu, 23 Jun 2022 19:08:21 +0000 (20:08 +0100)] 
build-timestamp.py: Respect SOURCE_DATE_EPOCH

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobuild: Make modular_tests an auto feature
Simon McVittie [Thu, 23 Jun 2022 19:03:47 +0000 (20:03 +0100)] 
build: Make modular_tests an auto feature

These don't alter the contents of the non-test executables, so we can
safely enable them whenever GLib is available.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest: Avoid arbitrary Python injection if compiled in a path with quotes
Simon McVittie [Thu, 23 Jun 2022 18:27:24 +0000 (19:27 +0100)] 
test: Avoid arbitrary Python injection if compiled in a path with quotes

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest: Disable sanitizers for test-segfault
Simon McVittie [Thu, 23 Jun 2022 18:27:05 +0000 (19:27 +0100)] 
test: Disable sanitizers for test-segfault

This resolves the TODO comment.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest: Expect TAP output for tests in name-test
Simon McVittie [Thu, 23 Jun 2022 18:05:58 +0000 (19:05 +0100)] 
test: Expect TAP output for tests in name-test

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest: Don't run test-autolaunch directly
Simon McVittie [Thu, 23 Jun 2022 18:05:33 +0000 (19:05 +0100)] 
test: Don't run test-autolaunch directly

It's intended to be run from run-test.sh.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest: Sort test executables
Simon McVittie [Thu, 23 Jun 2022 18:02:43 +0000 (19:02 +0100)] 
test: Sort test executables

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotools: Ship disable-uac.rc instead of generating it at build time
Simon McVittie [Thu, 23 Jun 2022 17:55:08 +0000 (18:55 +0100)] 
tools: Ship disable-uac.rc instead of generating it at build time

The Meson build system ships it anyway.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years ago.gitignore: Ignore __pycache__ directories anywhere in the tree
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>
3 years agoREADME: update for meson build-sys
Marc-André Lureau [Wed, 25 May 2022 09:29:40 +0000 (11:29 +0200)] 
README: update for meson build-sys

3 years agoAdd Meson build system
Félix Piédallu [Thu, 23 Jan 2020 12:12:15 +0000 (13:12 +0100)] 
Add Meson build system

Signed-off-by: Félix Piédallu <felix@piedallu.me>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agoMerge branch 'spec-underscore-idn' into 'master'
Simon McVittie [Wed, 13 Jul 2022 17:32:45 +0000 (17:32 +0000)] 
Merge branch 'spec-underscore-idn' into 'master'

spec: Document a recommendation for IDNs in reversed domain names

See merge request dbus/dbus!324

3 years agospec: Document a recommendation for IDNs in reversed domain names
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>
3 years agoMerge branch 'fixup' into 'master'
Simon McVittie [Mon, 11 Jul 2022 11:17:53 +0000 (11:17 +0000)] 
Merge branch 'fixup' into 'master'

CI fixes

See merge request dbus/dbus!323

3 years agocmake: use -gdwarf-2
Marc-André Lureau [Wed, 6 Jul 2022 11:58:37 +0000 (15:58 +0400)] 
cmake: use -gdwarf-2

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.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agotools/ci: remove --{enable,disable}-containers
Marc-André Lureau [Wed, 6 Jul 2022 11:43:38 +0000 (15:43 +0400)] 
tools/ci: remove --{enable,disable}-containers

Fixes: 9d60676a ("Disable the Containers interface")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agoMerge branch 'test-autolaunch-win' into 'master'
Simon McVittie [Mon, 27 Jun 2022 18:18:53 +0000 (18:18 +0000)] 
Merge branch 'test-autolaunch-win' into 'master'

Add autolaunch test on Windows

Closes #235

See merge request dbus/dbus!95

3 years agoAdd a test application for autostart on Windows implementation
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.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agosysdeps-win: display process id of started dbus-daemon
Ralf Habacker [Tue, 21 Dec 2021 07:50:00 +0000 (08:50 +0100)] 
sysdeps-win: display process id of started dbus-daemon

When verbose mode is enabled, this information is useful for debugging.

3 years agosysdeps-win: Use the `connection readiness` event when starting dbus-daemon
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.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agosysdeps-win: Let tests access autostarted dbus-daemon's handle
Ralf Habacker [Mon, 20 Dec 2021 13:41:06 +0000 (14:41 +0100)] 
sysdeps-win: Let tests access autostarted dbus-daemon's handle

This will allow automated tests to kill the autostarted dbus-daemon
before continuing to the next test-case, which wasn't previously
possible.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agosysdeps-win: Add support to give auto launched dbus daemon custom parameter
Ralf Habacker [Mon, 20 Dec 2021 13:40:38 +0000 (14:40 +0100)] 
sysdeps-win: Add support to give auto launched dbus daemon custom parameter

For that purpose the function _dbus_test_win_set_autolaunch_command_line_parameter()
has been added.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agoFix indentation of functions that are later changed
Ralf Habacker [Thu, 16 Dec 2021 13:42:27 +0000 (14:42 +0100)] 
Fix indentation of functions that are later changed

3 years agobuild: Include license files in releases
Simon McVittie [Fri, 24 Jun 2022 13:44:08 +0000 (14:44 +0100)] 
build: Include license files in releases

Fixes: 272928b "COPYING: Move full license text into LICENSES/"
Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobuild-sys: drop DBUS_CMAKE
Marc-André Lureau [Tue, 24 May 2022 20:12:18 +0000 (22:12 +0200)] 
build-sys: drop DBUS_CMAKE

TEST_LISTEN is defined by the cmake/autotools (or meson) build systems.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agoCOPYING: Document what we mean by SPDX markers
Simon McVittie [Wed, 18 May 2022 13:05:20 +0000 (14:05 +0100)] 
COPYING: Document what we mean by SPDX markers

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCOPYING, CONTRIBUTING.md: Specifically mention the MIT license
Simon McVittie [Wed, 18 May 2022 13:04:58 +0000 (14:04 +0100)] 
COPYING, CONTRIBUTING.md: Specifically mention the MIT license

This is the license we encourage contributors to use for new code, so
we should certainly have a reference copy of it.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCOPYING: Move full license text into LICENSES/
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>
3 years agoCOPYING: The project is called dbus, not D-Bus
Simon McVittie [Wed, 18 May 2022 12:59:17 +0000 (13:59 +0100)] 
COPYING: The project is called dbus, not D-Bus

We are trying to be consistent about saying this codebase is dbus
(a piece of software), which is the reference implementation of D-Bus
(a protocol).

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoMerge branch 'implicit-func-def-configure' into 'master'
Simon McVittie [Thu, 26 May 2022 11:41:02 +0000 (11:41 +0000)] 
Merge branch 'implicit-func-def-configure' into 'master'

configure: Avoid exit() when checking for __sync_sub_and_fetch()

See merge request dbus/dbus!320

3 years agoconfigure: Avoid exit() when checking for __sync_sub_and_fetch()
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.

3 years agoMerge branch 'getresuid' into 'master'
Simon McVittie [Thu, 26 May 2022 11:26:13 +0000 (11:26 +0000)] 
Merge branch 'getresuid' into 'master'

cmake: Check for setresuid and getresuid

See merge request dbus/dbus!319

3 years agocmake: Check for setresuid and getresuid
Alex Richardson [Wed, 25 May 2022 22:00:08 +0000 (22:00 +0000)] 
cmake: Check for setresuid and getresuid

This was not being checked, so the codepaths using the define were
never included.

3 years agoMerge branch 'wip/jtojnar/nodist-catalog' into 'master'
Simon McVittie [Tue, 24 May 2022 11:38:52 +0000 (11:38 +0000)] 
Merge branch 'wip/jtojnar/nodist-catalog' into 'master'

build: Do not dist built XML catalog

See merge request dbus/dbus!317

3 years agobuild: Do not dist built XML catalog
Jan Tojnar [Sun, 22 May 2022 19:45:27 +0000 (21:45 +0200)] 
build: Do not dist built XML catalog

It will have whatever paths the person who built the dist tarball hardcoded.

3 years agoUpdate NEWS
Simon McVittie [Mon, 23 May 2022 12:41:34 +0000 (13:41 +0100)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoMerge branch 'dev_add_variant_type_to_dbus_send' into 'master'
Simon McVittie [Mon, 23 May 2022 12:32:06 +0000 (12:32 +0000)] 
Merge branch 'dev_add_variant_type_to_dbus_send' into 'master'

dbus-send: Support for variants inside containers

See merge request dbus/dbus!206

3 years agodbus-send: Add support for variants to arrays and dictionaries
Frederik Van Bogaert [Sat, 17 Apr 2021 22:02:45 +0000 (00:02 +0200)] 
dbus-send: Add support for variants to arrays and dictionaries

Adds support for:
* Arrays of variants
* Dictionaries with variants as keys

Manually tested and confirmed working using dbus-monitor.
Example usage:
```
$ dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus \
    com.example.SomeExample dict:string:variant:one,int16:1
```
In dbus-monitor:
```
method call time=1652796044.991509 sender=:1.84 -> destination=org.freedesktop.DBus
    serial=2 path=/org/freedesktop/DBus; interface=com.example; member=SomeExample
   array [
      dict entry(
         string "one"
         variant             int16 1
      )
   ]
```

Signed-off-by: Frederik Van Bogaert <frederik.vanbogaert@mind.be>
3 years agoMerge branch 'element-size-morello' into 'master'
Simon McVittie [Mon, 23 May 2022 12:13:26 +0000 (12:13 +0000)] 
Merge branch 'element-size-morello' into 'master'

dbus-mempool.c: Ensure element_size is at least sizeof(void *)

See merge request dbus/dbus!318

3 years agodbus-mempool.c: Ensure element_size is at least sizeof(void *)
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 *).

3 years agoMerge branch 'drop-auth-dir' into 'master'
Simon McVittie [Fri, 20 May 2022 13:53:36 +0000 (13:53 +0000)] 
Merge branch 'drop-auth-dir' into 'master'

build-sys: console-auth-dir leftovers

See merge request dbus/dbus!316

3 years agobuild-sys: console-auth-dir leftovers
Marc-André Lureau [Fri, 20 May 2022 13:24:53 +0000 (15:24 +0200)] 
build-sys: console-auth-dir leftovers

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agoUpdate NEWS
Simon McVittie [Fri, 20 May 2022 13:21:55 +0000 (14:21 +0100)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoMerge branch 'editorconfig' into 'master'
Simon McVittie [Fri, 20 May 2022 12:31:25 +0000 (12:31 +0000)] 
Merge branch 'editorconfig' into 'master'

.editorconfig: Automatically configure multiple text editors

See merge request dbus/dbus!310

3 years ago.editorconfig: Automatically configure multiple text editors
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>
3 years agoMerge branch 'drop-auth-dir' into 'master'
Simon McVittie [Fri, 20 May 2022 12:08:30 +0000 (12:08 +0000)] 
Merge branch 'drop-auth-dir' into 'master'

Remove DBUS_CONSOLE_AUTH_DIR

See merge request dbus/dbus!314

3 years agoNEWS: add note about DBUS_CONSOLE_AUTH_DIR removal
Marc-André Lureau [Thu, 19 May 2022 15:30:22 +0000 (17:30 +0200)] 
NEWS: add note about DBUS_CONSOLE_AUTH_DIR removal

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agocmake: drop -DDBUS_CONSOLE_AUTH_DIR=
Marc-André Lureau [Thu, 19 May 2022 15:29:51 +0000 (17:29 +0200)] 
cmake: drop -DDBUS_CONSOLE_AUTH_DIR=

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agoautotools: drop --with-console-auth-dir=
Marc-André Lureau [Thu, 19 May 2022 15:29:29 +0000 (17:29 +0200)] 
autotools: drop --with-console-auth-dir=

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agodbus: remove pam_console/pam_foreground support
Marc-André Lureau [Thu, 19 May 2022 15:28:08 +0000 (17:28 +0200)] 
dbus: remove pam_console/pam_foreground support

DBUS_CONSOLE_AUTH_DIR is deprecated since 1.11.18, and was intended to
have been removed in 1.13. Let's drop the related code now.

Fixes: https://gitlab.freedesktop.org/dbus/dbus/-/issues/181
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=101629
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agoMerge branch 'warnings' into 'master'
Simon McVittie [Thu, 19 May 2022 18:15:58 +0000 (18:15 +0000)] 
Merge branch 'warnings' into 'master'

Fix unused warnings

See merge request dbus/dbus!315

3 years agotest: fix unused variable warnings
Marc-André Lureau [Thu, 19 May 2022 15:56:59 +0000 (17:56 +0200)] 
test: fix unused variable warnings

../../test/internals/assertions.c: In function ‘test_assert_error_is_set’:
../../test/internals/assertions.c:82:14: warning: unused variable ‘ep’ [-Wunused-variable]
   82 |   DBusError *ep = NULL;
      |              ^~
../../test/internals/assertions.c:81:13: warning: unused variable ‘e’ [-Wunused-variable]
   81 |   DBusError e = DBUS_ERROR_INIT;

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agodbus: fix unused warning
Marc-André Lureau [Thu, 19 May 2022 15:51:14 +0000 (17:51 +0200)] 
dbus: fix unused warning

../../dbus/dbus-message.c:5462:17: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]
 5462 |   unsigned char len;

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agoMerge branch 'doc-https' into 'master'
Simon McVittie [Wed, 18 May 2022 16:21:49 +0000 (16:21 +0000)] 
Merge branch 'doc-https' into 'master'

doc: Use https URLs for home page and AUTHORS

See merge request dbus/dbus!313

3 years agodoc: Use https URLs for home page and AUTHORS
Simon McVittie [Wed, 18 May 2022 15:50:50 +0000 (16:50 +0100)] 
doc: Use https URLs for home page and AUTHORS

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoMerge branch 'meson-prep' into 'master'
Simon McVittie [Wed, 18 May 2022 15:56:23 +0000 (15:56 +0000)] 
Merge branch 'meson-prep' into 'master'

Preparation for Meson build system

See merge request dbus/dbus!312

3 years agodbus: fix warning: label 'oom' defined but not used
Marc-André Lureau [Thu, 3 Feb 2022 07:13:35 +0000 (11:13 +0400)] 
dbus: fix warning: label 'oom' defined but not used

When DBUS_ENABLE_VERBOSE_MODE is not set, the compiler warns.

Let's remove the label.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agodoc: silence some xmlto man pages warnings
Marc-André Lureau [Tue, 8 Feb 2022 18:31:14 +0000 (22:31 +0400)] 
doc: silence some xmlto man pages warnings

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

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agoDoxyfile: browse for build-dir sources
Marc-André Lureau [Tue, 17 May 2022 11:52:15 +0000 (13:52 +0200)] 
Doxyfile: browse for build-dir sources

This allows it to pick dbus-arch-deps.h as well when building out-of-tree.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agoMerge branch 'clang-format-config' into 'master'
Simon McVittie [Wed, 18 May 2022 12:04:57 +0000 (12:04 +0000)] 
Merge branch 'clang-format-config' into 'master'

Add a clang-format configuration file

See merge request dbus/dbus!308

3 years agoAdd a clang-format configuration file
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.

3 years agoMerge branch 'fix-issue-368' into 'master'
Simon McVittie [Tue, 17 May 2022 23:24:28 +0000 (23:24 +0000)] 
Merge branch 'fix-issue-368' into 'master'

Fix thread locking issues on Windows

Closes #368 and #370

See merge request dbus/dbus!244

3 years agoOn Windows in autolaunch related function use rmutex related functions to support...
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.

Fixes #368, #370

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agoMerge branch 'silence-clang-wcast-align' into 'master'
Simon McVittie [Tue, 17 May 2022 14:50:50 +0000 (14:50 +0000)] 
Merge branch 'silence-clang-wcast-align' into 'master'

Silence Clang -Wcast-align false-positives

See merge request dbus/dbus!305

3 years agodbus-memory.c: Silence -Wcast-align warnings
Alex Richardson [Sun, 15 May 2022 10:24:15 +0000 (11:24 +0100)] 
dbus-memory.c: Silence -Wcast-align warnings

These values will be appropriately aligned, so we can silence the warning
by adding a void* cast.

3 years agodbus-marshal-bytes.c: Silence -Wcast-align warnings
Alex Richardson [Sun, 15 May 2022 10:23:29 +0000 (11:23 +0100)] 
dbus-marshal-bytes.c: Silence -Wcast-align warnings

We have ensured that the values are aligned at runtime, but Clang's
warning cannot see that. Silence the warning with a void* cast.

3 years agodbus-sysdeps-unix.c: Silence -Wcast-align when using CMSG_DATA
Alex Richardson [Sun, 15 May 2022 10:14:02 +0000 (11:14 +0100)] 
dbus-sysdeps-unix.c: Silence -Wcast-align when using CMSG_DATA

This triggers when building on FreeBSD with clang, but since we know that
the CMSG_DATA() will be aligned we can silence the warning using a cast.

3 years agodbus-string.c: use memcpy() in _dbus_string_insert_{2,4,8}_aligned
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).

3 years agodbus-marshal-basic.c: Silence Clang -Wcast-align false-positives
Alex Richardson [Fri, 13 May 2022 19:25:23 +0000 (20:25 +0100)] 
dbus-marshal-basic.c: Silence Clang -Wcast-align false-positives

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.

3 years agoMerge branch 'cmake-junit-xml-output' into 'master'
Ralf Habacker [Tue, 17 May 2022 11:02:17 +0000 (11:02 +0000)] 
Merge branch 'cmake-junit-xml-output' into 'master'

tools/ci-build.sh: Add a ci_cmake_junit_output argument

See merge request dbus/dbus!299

3 years agotools/ci-install.sh: Install newer CMake on openSuSE
Alex Richardson [Sat, 14 May 2022 18:24:21 +0000 (19:24 +0100)] 
tools/ci-install.sh: Install newer CMake on openSuSE

This is needed for JUnit XML output for tests.

3 years agotools/ci-build.sh: Add a ci_cmake_junit_output argument
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.

3 years agoMerge branch 'fix-cmake-dbus-use-sync' into 'master'
Simon McVittie [Mon, 16 May 2022 18:52:16 +0000 (18:52 +0000)] 
Merge branch 'fix-cmake-dbus-use-sync' into 'master'

cmake: Fix definition of DBUS_USE_SYNC

See merge request dbus/dbus!306

3 years agocmake: Fix definition of DBUS_USE_SYNC
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.

3 years agoMerge branch 'fix-wshadow' into 'master'
Simon McVittie [Mon, 16 May 2022 18:36:38 +0000 (18:36 +0000)] 
Merge branch 'fix-wshadow' into 'master'

dir-watch-kqueue: Silence -Wshadow warning

See merge request dbus/dbus!307

3 years agodir-watch-kqueue: Silence -Wshadow warning
Alex Richardson [Sun, 15 May 2022 10:34:48 +0000 (11:34 +0100)] 
dir-watch-kqueue: Silence -Wshadow warning

This should be the last warning that is preventing us from using -Werror
for FreeBSD builds.

3 years agoMerge branch 'ci-templates' into 'master'
Ralf Habacker [Mon, 9 May 2022 12:29:47 +0000 (12:29 +0000)] 
Merge branch 'ci-templates' into 'master'

Use freedesktop/ci-templates for the GitLab CI

See merge request dbus/dbus!301

3 years agoUse freedesktop/ci-templates for the GitLab CI
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.

3 years agoMerge branch 'fix-issue-369' into 'master'
Simon McVittie [Thu, 5 May 2022 14:20:39 +0000 (14:20 +0000)] 
Merge branch 'fix-issue-369' into 'master'

Add assertions to the [c|r]mutex related functions on Windows

Closes #369

See merge request dbus/dbus!243

3 years agoAdd doc to platform related [c|r]mutex functions
Ralf Habacker [Sun, 1 May 2022 17:54:06 +0000 (19:54 +0200)] 
Add doc to platform related [c|r]mutex functions

3 years agoAdd unit tests for platform-specific mutex implementation.
Ralf Habacker [Wed, 2 Mar 2022 12:17:10 +0000 (13:17 +0100)] 
Add unit tests for platform-specific mutex implementation.

The tests are enabled with the embedded tests; the required
low-level functions from the dbus library are decorated with
DBUS_EMBEDDED_TESTS_EXPORT to indicate the appropriate usage.

On Windows, all tests are run; on unix-like operating systems,
individual tests are disabled:
- the tests on #NULL pointers of type DBus[C|R]Mutex, since they
  point to a data structure and would cause a segment violation
  when accessed.
- the multiple lock test for type DBusCMutex, since it would block
  the current thread.

Since the whole point of "rmutex" is to be able to lock multiple
times, the "rmutex double lock" test is enabled on unix-like
operating systems too.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agoAdd assertions to the [c|r]mutex related functions on Windows
Ralf Habacker [Mon, 20 Dec 2021 10:52:45 +0000 (11:52 +0100)] 
Add assertions to the [c|r]mutex related functions on Windows

This detects some error conditions that can only occur as a
result of a programming error, such as attempting to unlock a
mutex that is not locked.

Fixes #369

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agoMerge branch 'fix-strict-warning-related' into 'master'
Ralf Habacker [Sun, 1 May 2022 16:41:06 +0000 (16:41 +0000)] 
Merge branch 'fix-strict-warning-related' into 'master'

Fix mingw gcc 10.3 compiler warnings

Closes #383

See merge request dbus/dbus!275

3 years agotests: Fix build warning "dereferencing type-punned pointer will break strict-aliasin...
Ralf Habacker [Thu, 7 Apr 2022 10:34:00 +0000 (12:34 +0200)] 
tests: Fix build warning "dereferencing type-punned pointer will break strict-aliasing rules"

To avoid that build break in test-marshall-recursive-util.c the newly
added function _dbus_string_append_buffer_as_hex() is used to print
the hex bytes.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agodbus-string: Add _dbus_string_append_buffer_as_hex()
Ralf Habacker [Thu, 7 Apr 2022 10:24:26 +0000 (12:24 +0200)] 
dbus-string: Add _dbus_string_append_buffer_as_hex()

This function provides a portable way to print data as hex values.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
[smcv: Only compile this when needed, improve assertions, coding style]
Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agodbus: Move DBUS_PRIVATE_EXPORT to private header
Simon McVittie [Thu, 21 Apr 2022 13:38:55 +0000 (14:38 +0100)] 
dbus: Move DBUS_PRIVATE_EXPORT to private header

Unlike the rest of the macros in dbus-macros.h, this one would never
have made sense to use in a public header.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agodbus: Move DBUS_ENABLE_EMBEDDED_TESTS to a new dbus-macros-internal.h
Simon McVittie [Thu, 21 Apr 2022 13:35:44 +0000 (14:35 +0100)] 
dbus: Move DBUS_ENABLE_EMBEDDED_TESTS to a new dbus-macros-internal.h

This avoids a circular dependency: I want to use
DBUS_ENABLE_EMBEDDED_TESTS in dbus-string.h, but
DBUS_ENABLE_EMBEDDED_TESTS was previously defined in dbus-internals.h,
which depends on dbus-string.h.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoMerge branch 'test-socket-dir' into 'master'
Ralf Habacker [Sun, 1 May 2022 16:28:23 +0000 (16:28 +0000)] 
Merge branch 'test-socket-dir' into 'master'

cmake: Allow overriding TEST_SOCKET_DIR

See merge request dbus/dbus!295

3 years agocmake: Allow overriding TEST_SOCKET_DIR
Alex Richardson [Sat, 16 Apr 2022 15:04:20 +0000 (15:04 +0000)] 
cmake: Allow overriding TEST_SOCKET_DIR

This matches the autotools build where that option can also be overridden.

3 years agoMerge branch 'cmake-user-args' into 'master'
Ralf Habacker [Sun, 1 May 2022 16:10:01 +0000 (16:10 +0000)] 
Merge branch 'cmake-user-args' into 'master'

tools/ci-build.sh: Pass user arguments to cmake last

See merge request dbus/dbus!296

3 years agotools/ci-build.sh: Pass user arguments to cmake last
Alex Richardson [Sun, 20 Mar 2022 00:40:34 +0000 (00:40 +0000)] 
tools/ci-build.sh: Pass user arguments to cmake last

This allows a user to override ENABLE_WERROR for platforms that are not
yet -Werror clean.

3 years agoMerge branch 'fix-c++-warnings' into 'master'
Simon McVittie [Thu, 21 Apr 2022 14:08:44 +0000 (14:08 +0000)] 
Merge branch 'fix-c++-warnings' into 'master'

cmake: fixes for compiler warning support

Closes #387

See merge request dbus/dbus!293

3 years agocmake: Let the c++ compiler use the warnings available to it
Ralf Habacker [Thu, 7 Apr 2022 11:59:21 +0000 (13:59 +0200)] 
cmake: Let the c++ compiler use the warnings available to it

Fixes #387

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agocmake: in macro generate_compiler_warning_flags prevent duplicates in variable contai...
Ralf Habacker [Thu, 7 Apr 2022 11:57:35 +0000 (13:57 +0200)] 
cmake: in macro generate_compiler_warning_flags prevent duplicates in variable containing unsupported warnings

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agocmake: Fix detecting -Wformat-* warnings for gcc
Ralf Habacker [Thu, 7 Apr 2022 11:55:26 +0000 (13:55 +0200)] 
cmake: Fix detecting -Wformat-* warnings for gcc

gcc expects -Wformat to be set along with these type of warnings.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agocmake: Fix not detecting unsupported g++ related warning checks
Ralf Habacker [Thu, 7 Apr 2022 11:53:42 +0000 (13:53 +0200)] 
cmake: Fix not detecting unsupported g++ related warning checks

Unsupported warnings are detected by cmake through errors during
compilation, which causes g++ not to detect them, since they are
only output as warnings. Setting -Werror ensures this.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agoIgnore gcc 10.3 'inline' warnings: 'call is unlikely and code size would grow'
Ralf Habacker [Thu, 7 Apr 2022 12:54:29 +0000 (14:54 +0200)] 
Ignore gcc 10.3 'inline' warnings: 'call is unlikely and code size would grow'

As long as gcc does something with compatible semantics, it is up to gcc
how to optimize our code.

The alternative would be to export the functions in question from the
shared library, which has the disadvantage of greatly increasing the
number of calls across a shared library boundary.

Part-of: https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/275
Reviewed-by: Simon McVittie <smcv@collabora.com>