]> git.ipfire.org Git - thirdparty/dbus.git/log
thirdparty/dbus.git
3 years agoCI: Don't wait for Windows Docker image before doing Unix builds
Simon McVittie [Fri, 1 Apr 2022 13:47:27 +0000 (14:47 +0100)] 
CI: Don't wait for Windows Docker image before doing Unix builds

The default in Gitlab-CI is that each job waits for all jobs in
previous stages to complete, but we can override this default by
explicitly saying that there are no prerequisites.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoMerge branch 'fix-macosx-launchd-build' into 'master'
Simon McVittie [Fri, 1 Apr 2022 13:56:24 +0000 (13:56 +0000)] 
Merge branch 'fix-macosx-launchd-build' into 'master'

Fix building on Mac OSX when using launchd

See merge request dbus/dbus!287

3 years agoFix building on Mac OSX when using launchd
Ralf Habacker [Thu, 31 Mar 2022 06:57:08 +0000 (08:57 +0200)] 
Fix building on Mac OSX when using launchd

Provided by Dawid Wróbel at
https://invent.kde.org/packaging/craft-blueprints-kde\
/-/blob/master/libs/dbus/0002-fix-macos-build.diff

3 years agoMerge branch 'wip/find-arch-include-dir' into 'master'
Ralf Habacker [Wed, 30 Mar 2022 08:16:59 +0000 (08:16 +0000)] 
Merge branch 'wip/find-arch-include-dir' into 'master'

cmake: Look for dbus-arch-deps.h next to DBus1Config.cmake

Closes #314

See merge request dbus/dbus!191

3 years agocmake: Look for dbus-arch-deps.h next to DBus1Config.cmake
Simon McVittie [Fri, 6 Nov 2020 14:42:19 +0000 (14:42 +0000)] 
cmake: Look for dbus-arch-deps.h next to DBus1Config.cmake

<dbus/dbus-arch-deps.h> is architecture-dependent, and compilers have
not traditionally supported an installation path for architecture-specific
headers (Debian-based systems have /usr/include/${multiarch_tuple}, but
that isn't portable beyond Debian). When dbus was built using Autotools,
dependent projects that use CMake need to look for this header in the
right place.

Unfortunately, it seems that at least recent versions of CMake will
ignore the HINTS we get from pkg-config if they are told to search in
a non-standard prefix via ${DBus1_ROOT}.

Look for dbus-arch-deps.h in a directory derived from the filename of
the CMake config file, before trying the normal search algorithm. The
CMake config file is in ${libdir}, and so is the architecture-specific
header, so this should work reasonably reliably.

According to the CMake documentation, if we search for the same thing
multiple times, the first successful result will be used; and searching
with NO_DEFAULT_PATH is the official way to prepend things to the
search order.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/314
Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoMerge branch 'generalize-autolaunch' into 'master'
Simon McVittie [Tue, 29 Mar 2022 19:12:02 +0000 (19:12 +0000)] 
Merge branch 'generalize-autolaunch' into 'master'

dbus-launch: Generalize support for discovering an existing bus

Closes #385

See merge request dbus/dbus!273

3 years agodbus-launch: If no X11, look for existing bus before failing
Simon McVittie [Wed, 16 Mar 2022 13:30:33 +0000 (13:30 +0000)] 
dbus-launch: If no X11, look for existing bus before failing

What we are aiming for here is that `dbus-launch --autolaunch` will
exit with an error if it would have been unable to advertise the bus
in a way that will be picked up by other instances of itself, so that
we don't get a proliferation of autolaunched dbus-launch instances,
each with its own dbus-daemon, and none of them talking to the others.

However, we don't need to do that *immediately*: we can try to look for
an existing instance first. If we find one, then we can assume that
it's suitable for use, even if X11 autolaunching was disabled at
compile-time or if connecting to the X server failed at runtime. We
only need to bail out if we get to the point where we are ready to start
forking child processes.

This lets systemd users run `dbus-launch --autolaunch` to find a
systemd-managed dbus-daemon, even if X11 autolaunching is disabled.
When combined with the previous commit, it also lets macOS users run
`dbus-launch --autolaunch` to find a launchd-managed dbus-daemon.

Resolves: dbus/dbus#385
Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agodbus-launch: Generalize support for discovering an existing bus
Simon McVittie [Wed, 16 Mar 2022 13:24:53 +0000 (13:24 +0000)] 
dbus-launch: Generalize support for discovering an existing bus

Previously we were looking for an existing bus via
_dbus_lookup_user_bus(), meaning a user bus $XDG_RUNTIME_DIR/bus
(in practice this is managed by systemd --user, although in principle
there's nothing to stop other session frameworks from providing the
same thing).

_dbus_lookup_session_address() looks for an externally-managed
dbus-daemon in a more general way: on macOS it uses launchd, and on other
Unix it's a thin wrapper around _dbus_lookup_user_bus(). Let's try that,
so that macOS users can get their existing dbus-daemon from launchd.

This partially resolves dbus/dbus#385, although initially only for macOS
users who have (unusually) enabled X11 autolaunching support.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoMerge branch 'ci-opensuse-support' into 'master'
Ralf Habacker [Tue, 29 Mar 2022 14:24:04 +0000 (14:24 +0000)] 
Merge branch 'ci-opensuse-support' into 'master'

On CI add support for building package based on openSUSE distribution

Closes #383

See merge request dbus/dbus!192

3 years agoCI: Switch active cmake related jobs to opensuse as default
Ralf Habacker [Tue, 1 Mar 2022 12:30:45 +0000 (13:30 +0100)] 
CI: Switch active cmake related jobs to opensuse as default

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agoOn CI add build support for openSUSE distributions
Ralf Habacker [Tue, 1 Mar 2022 12:25:01 +0000 (13:25 +0100)] 
On CI add build support for openSUSE distributions

The mingw related jobs are running the whole test suite which
is an extension to the available jobs.

The environment variable ci_suite is not used on openSUSE
distributions, as it is determined from the installed image.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agocmake: temporary disable fatal warnings related to new opensuse builds
Ralf Habacker [Thu, 17 Mar 2022 13:28:34 +0000 (14:28 +0100)] 
cmake: temporary disable fatal warnings related to new opensuse builds

This is necessary for these CI builds to be successful.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agoMerge branch 'compile-with-clang' into 'master'
Ralf Habacker [Tue, 29 Mar 2022 12:36:47 +0000 (12:36 +0000)] 
Merge branch 'compile-with-clang' into 'master'

cmake: Only add warning flags if the compiler supports them

Closes #387

See merge request dbus/dbus!276

3 years agocmake: Only add warning flags if the compiler supports them
Alex Richardson [Sat, 19 Mar 2022 14:58:59 +0000 (14:58 +0000)] 
cmake: Only add warning flags if the compiler supports them

I am compiling for FreeBSD where the compiler is Clang and doesn't accept
all the GCC warning flags. This breaks the -Werror build:
```
error: unknown warning option '-Wduplicated-branches' [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wduplicated-cond' [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wjump-misses-init' [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wlogical-op'; did you mean '-Wlong-long'? [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wrestrict' [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wunused-but-set-variable'; did you mean '-Wunused-const-variable'? [-Werror,-Wunknown-warning-option]
```

With this change we use check_{c,cxx}_compiler_flag to check if the flag
is supported before adding it. In the future this will allow adding
clang-specific warning flags to the list of warnings as well since they
will be ignored for GCC.

3 years agoMerge branch 'bug834725' into 'master'
Simon McVittie [Tue, 29 Mar 2022 12:19:58 +0000 (12:19 +0000)] 
Merge branch 'bug834725' into 'master'

sysdeps-unix: check fd before calling _dbus_fd_set_close_on_exec()

See merge request dbus/dbus!285

3 years agosysdeps-unix: check fd before calling _dbus_fd_set_close_on_exec()
Mike Gilbert [Sun, 27 Mar 2022 19:09:48 +0000 (15:09 -0400)] 
sysdeps-unix: check fd before calling _dbus_fd_set_close_on_exec()

If /proc/self/oom_score_adj does not exist, fd will invalid (-1).
Attempting to set the CLOEXEC flag will obviously fail, and we lose the
original errno value from open().

Bug: https://bugs.gentoo.org/834725
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
3 years agoMerge branch 'cross-compile-session-socket' into 'master'
Ralf Habacker [Tue, 29 Mar 2022 11:49:56 +0000 (11:49 +0000)] 
Merge branch 'cross-compile-session-socket' into 'master'

cmake: Fix DBUS_SESSION_SOCKET_DIR when cross-compiling

See merge request dbus/dbus!279

3 years agocmake: Fix DBUS_SESSION_SOCKET_DIR when cross-compiling
Alex Richardson [Sat, 19 Mar 2022 14:56:12 +0000 (14:56 +0000)] 
cmake: Fix DBUS_SESSION_SOCKET_DIR when cross-compiling

Inferring it from the environment is not correct, since the host system
could have a different temporary directory defined. Instead of guessing
based on the host, require the user to pass an explicit directory when
cross-compiling. This is helpful for me since I am cross-compiling for
FreeBSD from macOS and on my host TMPDIR is set to
/var/folders/<random characters>/T/ instead of the expected /tmp.

3 years agoMerge branch 'fix-fetching-mingw-packages' into 'master'
Ralf Habacker [Tue, 29 Mar 2022 11:39:45 +0000 (11:39 +0000)] 
Merge branch 'fix-fetching-mingw-packages' into 'master'

tools/ci-install.sh: on debian|ubuntu reduce the need for mingw package name changes

Closes #388

See merge request dbus/dbus!286

3 years ago.gitignore: Ignore downloaded and installed mingw packages used on debian|ubuntu
Ralf Habacker [Tue, 29 Mar 2022 08:00:26 +0000 (10:00 +0200)] 
.gitignore: Ignore downloaded and installed mingw packages used on debian|ubuntu

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agotools/ci-install.sh: clean up the previously used installation prefix and the downloa...
Ralf Habacker [Tue, 29 Mar 2022 07:59:59 +0000 (09:59 +0200)] 
tools/ci-install.sh: clean up the previously used installation prefix and the downloaded mingw packages

This is necessary to have a clean initial state when running the script
locally.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agotools/ci-install.sh: Use partially qualified versions with mingw package names
Ralf Habacker [Tue, 29 Mar 2022 07:56:40 +0000 (09:56 +0200)] 
tools/ci-install.sh: Use partially qualified versions with mingw package names

Fixes dbus/dbus#388

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agotools/ci-install.sh: on debian|ubuntu reduce the need for mingw package name changes
Ralf Habacker [Tue, 29 Mar 2022 07:36:54 +0000 (09:36 +0200)] 
tools/ci-install.sh: on debian|ubuntu reduce the need for mingw package name changes

Instead of having to specify an exact version that needs to be adjusted
with each repository update, it is now possible to specify package names
without version or partially qualified versions, which reduces the
frequency of necessary adjustments.

This is achieved by searching for the package names in a previously
downloaded list of available packages.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agoMerge branch 'cmake-fix-export-dynamic' into 'master'
Ralf Habacker [Thu, 24 Mar 2022 22:13:55 +0000 (22:13 +0000)] 
Merge branch 'cmake-fix-export-dynamic' into 'master'

cmake: Only pass -Wl,--export-dynamic when linking

See merge request dbus/dbus!278

3 years agocmake: Use -Wl,-export_dynamic when building for macOS
Alex Richardson [Sat, 19 Mar 2022 19:23:32 +0000 (19:23 +0000)] 
cmake: Use -Wl,-export_dynamic when building for macOS

The macOS linker does not accept --export-dynamic, so use this
alternate spelling.

3 years agocmake: Only pass -Wl,--export-dynamic when linking
Alex Richardson [Sat, 19 Mar 2022 17:56:54 +0000 (17:56 +0000)] 
cmake: Only pass -Wl,--export-dynamic when linking

Otherwise we get the following warnings when building .o files with Clang:
clang-13: warning: -Wl,--export-dynamic: 'linker' input unused [-Wunused-command-line-argument]

This is required to allow the -Werror build to pass on FreeBSD.

3 years agoMerge branch 'cmake-unnecessary-include-dir' into 'master'
Ralf Habacker [Thu, 24 Mar 2022 14:36:15 +0000 (14:36 +0000)] 
Merge branch 'cmake-unnecessary-include-dir' into 'master'

cmake: Drop an unnecessary include directory

See merge request dbus/dbus!282

3 years agocmake: Drop an unnecessary include directory
Alex Richardson [Wed, 23 Mar 2022 22:06:33 +0000 (22:06 +0000)] 
cmake: Drop an unnecessary include directory

There should be no need to include the directory above the DBus sources,
if that is actually required users can always pass -I flags to CMake.
I noticed this because CLion started indexing all my cloned projects when
I opened DBus due to this include path.

3 years agoMerge branch 'detect-backtrace-freebsd' into 'master'
Ralf Habacker [Thu, 24 Mar 2022 13:56:13 +0000 (13:56 +0000)] 
Merge branch 'detect-backtrace-freebsd' into 'master'

cmake: Detect backtrace() support on platforms such as FreeBSD

See merge request dbus/dbus!281

3 years agocmake: Detect backtrace() support on platforms such as FreeBSD
Alex Richardson [Sun, 20 Mar 2022 23:25:29 +0000 (23:25 +0000)] 
cmake: Detect backtrace() support on platforms such as FreeBSD

On FreeBSD use of backtrace requires linking libexecinfo. The current
check_symbol_exists() will fail due to that missing library. Fortunately,
CMake ships with a FindBacktrace module (at least since 3.0) that can
be used to correctly handle platforms such as FreeBSD (and OpenBSD
according to the FindBacktrace source).

3 years agoMerge branch 'fix-freebsd-environ' into 'master'
Ralf Habacker [Thu, 24 Mar 2022 13:40:44 +0000 (13:40 +0000)] 
Merge branch 'fix-freebsd-environ' into 'master'

Revert "Fix gcc compile error: redundant redeclaration of ‘environ’ [-Werror=redundant-decls]"

See merge request dbus/dbus!277

3 years agoRevert "Fix gcc compile error: redundant redeclaration of ‘environ’ [-Werror=redundan...
Alex Richardson [Sat, 19 Mar 2022 14:48:04 +0000 (14:48 +0000)] 
Revert "Fix gcc compile error: redundant redeclaration of ‘environ’ [-Werror=redundant-decls]"

Breaks the build on FreeBSD which doens't have an environ declaration.
The CMake check_symbol_exists call sets `HAVE_DECL_ENVIRON` to an empty
variable (which means if(DEFINED) suceeds). This normalization should not
be necessary as it will be handled correctly by `#cmakedefine01`. If not,
all the other HAVE_* defines would also be wrong.

This reverts commit e8b34b419e44e0b95622f45c0f17487e241b1961.

3 years agoMerge branch 'issue-templates' into 'master'
Ralf Habacker [Fri, 18 Mar 2022 07:47:10 +0000 (07:47 +0000)] 
Merge branch 'issue-templates' into 'master'

Add bug and feature template for issue tracker

See merge request dbus/dbus!270

3 years agoAdd feature template
Ralf Habacker [Thu, 10 Mar 2022 12:16:37 +0000 (13:16 +0100)] 
Add feature template

3 years agoAdd bug template
Ralf Habacker [Thu, 10 Mar 2022 12:06:42 +0000 (13:06 +0100)] 
Add bug template

3 years agoMerge branch 'memcmp' into 'master'
Simon McVittie [Wed, 16 Mar 2022 15:58:11 +0000 (15:58 +0000)] 
Merge branch 'memcmp' into 'master'

sysdeps: Implement _DBUS_DOUBLES_BITWISE_EQUAL with memcmp

See merge request dbus/dbus!274

3 years agosysdeps: Implement _DBUS_DOUBLES_BITWISE_EQUAL with memcmp
Simon McVittie [Wed, 16 Mar 2022 14:54:55 +0000 (14:54 +0000)] 
sysdeps: Implement _DBUS_DOUBLES_BITWISE_EQUAL with memcmp

memcmp is the Standard C way to compare arbitrary regions of memory
bit-by-bit, so let's use it, instead of reinventing it in a way that
violates Standard C aliasing rules.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotools/ci-build.sh: Define and use variable builddir
Ralf Habacker [Fri, 10 Dec 2021 11:00:36 +0000 (12:00 +0100)] 
tools/ci-build.sh: Define and use variable builddir

Reviewed-by: Simon McVittie <smcv@collabora.com>
3 years ago.gitignore: Add sub directory ci-build*
Ralf Habacker [Thu, 25 Nov 2021 12:07:36 +0000 (13:07 +0100)] 
.gitignore: Add sub directory ci-build*

Reviewed-by: Simon McVittie <smcv@collabora.com>
3 years agoMerge branch 'ci-job-names' into 'master'
Simon McVittie [Wed, 16 Mar 2022 14:03:22 +0000 (14:03 +0000)] 
Merge branch 'ci-job-names' into 'master'

CI: Adjust job names

See merge request dbus/dbus!262

3 years agoCI: Adjust job names
Ralf Habacker [Tue, 1 Mar 2022 12:20:43 +0000 (13:20 +0100)] 
CI: Adjust job names

Job names now provide more information about platform, build environment,
system and configuration, which makes it easier to read.

The names for the build environments has been shorted to commonly known
names e.g. 'mingw64' for 'x86_64-w64-mingw32'.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agoMerge branch 'fix-issue-381' into 'master'
Ralf Habacker [Tue, 8 Mar 2022 15:07:13 +0000 (15:07 +0000)] 
Merge branch 'fix-issue-381' into 'master'

cmake: Fix race condition on creating docbook based files

Closes #381

See merge request dbus/dbus!268

3 years agocmake: Fix race condition on creating docbook based files
Ralf Habacker [Thu, 3 Mar 2022 11:40:17 +0000 (12:40 +0100)] 
cmake: Fix race condition on creating docbook based files

With the previous implementation, race conditions could arise because a
generated intermediate file was used by multiple targets.

To fix the mentioned problem, the macro 'generate_docbook_file' has been
integrated into a in a new macro 'add_docbook' to simplify the dependency
chain and make it easier to use.

When using an xml template with the 'TEMPLATE' parameter, a separate
intermediate xml file is used for each generated output file to avoid
overwriting each other, which was the main cause of the described problem.

Due to the adaptation of the calling conventions it was necessary to
introduce the parameter 'MAN_CATEGORY'.

Fixes #381

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agoMerge branch 'fix-issue-375-1' into 'master'
Ralf Habacker [Fri, 4 Mar 2022 07:26:15 +0000 (07:26 +0000)] 
Merge branch 'fix-issue-375-1' into 'master'

cmake: fix setting DBUS_*_CONFIG_FILE on non win32 platform

See merge request dbus/dbus!267

3 years agocmake: Set DBUS_*_CONFIG_FILE to be in datadir on Unix
Ralf Habacker [Thu, 3 Mar 2022 08:48:51 +0000 (09:48 +0100)] 
cmake: Set DBUS_*_CONFIG_FILE to be in datadir on Unix

The files were installed to the datadir (usually /usr/share) since
commit 70950325, but the macros used to implement dbus-daemon --system
and dbus-daemon --session still looked for them in the sysconfdir
(usually /etc).

Fixes: 70950325 "Adjust cmake build to match autoconf installation locations"
3 years agoMerge branch 'fix-issue-375' into 'master'
Ralf Habacker [Thu, 3 Mar 2022 11:45:09 +0000 (11:45 +0000)] 
Merge branch 'fix-issue-375' into 'master'

cmake: setup variable WORDS_BIGENDIAN correctly

Closes #375

See merge request dbus/dbus!266

3 years agocmake: setup variable WORDS_BIGENDIAN correctly
Ralf Habacker [Wed, 2 Mar 2022 10:00:06 +0000 (11:00 +0100)] 
cmake: setup variable WORDS_BIGENDIAN correctly

Since version 3.0 cmake provides the macro test_big_endian for
that purpose.

fixes #375

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agoAdd api doc to _dbus_platform_c|rmutex_new()
Ralf Habacker [Mon, 21 Feb 2022 15:07:48 +0000 (16:07 +0100)] 
Add api doc to _dbus_platform_c|rmutex_new()

The documentation has been added to the header to avoid duplication as
these functions are implemented platform specific.

Cherry-picked from merge request dbus/dbus!243

Reviewed-by: @smcv
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agoUpdate NEWS
Simon McVittie [Tue, 1 Mar 2022 18:44:25 +0000 (18:44 +0000)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoMerge branch 'configure_with-x_option' into 'master'
Simon McVittie [Tue, 1 Mar 2022 18:28:06 +0000 (18:28 +0000)] 
Merge branch 'configure_with-x_option' into 'master'

build: Fix logic for --with-x configure option

See merge request dbus/dbus!263

3 years agoConvert "if" calls to AS_IF macro for the block that handles X11
Lars Wendler [Tue, 1 Mar 2022 15:11:05 +0000 (16:11 +0100)] 
Convert "if" calls to AS_IF macro for the block that handles X11

3 years agoAdd have_x11=no if --without-x was given to make later checks happy
Lars Wendler [Tue, 1 Mar 2022 15:08:06 +0000 (16:08 +0100)] 
Add have_x11=no if --without-x was given to make later checks happy

3 years agoEmit an error when --with-x was given but no X11 libs were found
Lars Wendler [Tue, 1 Mar 2022 15:05:52 +0000 (16:05 +0100)] 
Emit an error when --with-x was given but no X11 libs were found

3 years agoMove DBUS_X_* definitions into PKG_CHECK_MODULES block
Lars Wendler [Tue, 1 Mar 2022 15:01:29 +0000 (16:01 +0100)] 
Move DBUS_X_* definitions into PKG_CHECK_MODULES block

3 years agobuild: Treat --with-x[=yes] the same as --with-x=auto
Lars Wendler [Tue, 1 Mar 2022 14:56:30 +0000 (15:56 +0100)] 
build: Treat --with-x[=yes] the same as --with-x=auto

Previously, --with-x would disable the check for X11 libraries, which
was not intended.

3 years agoMerge branch 'bus-inotify-error-handling' into 'master'
Simon McVittie [Mon, 28 Feb 2022 23:00:58 +0000 (23:00 +0000)] 
Merge branch 'bus-inotify-error-handling' into 'master'

bus: Fix error handling for inotify_init()

See merge request dbus/dbus!235

3 years agobus: Show the errno if inotify cannot be initialized
Simon McVittie [Fri, 10 Dec 2021 13:09:15 +0000 (13:09 +0000)] 
bus: Show the errno if inotify cannot be initialized

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobus: Correct check for inotify_init() failure
Simon McVittie [Fri, 10 Dec 2021 13:08:38 +0000 (13:08 +0000)] 
bus: Correct check for inotify_init() failure

fd 0 is a valid fd - although if we are using stdin as our inotify fd,
something is weird somewhere.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoRevert "spec: Go back to v0.38"
Simon McVittie [Mon, 28 Feb 2022 18:20:14 +0000 (18:20 +0000)] 
Revert "spec: Go back to v0.38"

This reverts commit 428f60e8b2f5e3f1871c3173700bbe2d8139e242.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoPost-release version bump for 1.15.x
Simon McVittie [Mon, 28 Feb 2022 18:20:08 +0000 (18:20 +0000)] 
Post-release version bump for 1.15.x

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoPrepare v1.14.0 dbus-1.14.0
Simon McVittie [Mon, 28 Feb 2022 11:36:48 +0000 (11:36 +0000)] 
Prepare v1.14.0

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/350
Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agospec: Go back to v0.38
Simon McVittie [Mon, 28 Feb 2022 11:23:39 +0000 (11:23 +0000)] 
spec: Go back to v0.38

Nothing changed in v0.39 yet, and it would be confusing to have the
version uploaded alongside dbus 1.14.0 say "not yet finalized".

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoRevert "Disable MSVC CI by default for now"
Simon McVittie [Mon, 28 Feb 2022 11:22:30 +0000 (11:22 +0000)] 
Revert "Disable MSVC CI by default for now"

This reverts commit 254b17977e228a4ec419c98e95588d564d36ddb1.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoUpdate AUTHORS
Simon McVittie [Mon, 28 Feb 2022 11:15:32 +0000 (11:15 +0000)] 
Update AUTHORS

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoMerge branch 'doc_dbus-api-design_link_fixes' into 'master'
Ralf Habacker [Mon, 28 Feb 2022 08:16:17 +0000 (08:16 +0000)] 
Merge branch 'doc_dbus-api-design_link_fixes' into 'master'

doc/dbus-api-design: fix broken links

See merge request dbus/dbus!257

3 years agodoc/dbus-api-design: fix broken links
Michael Nosthoff [Thu, 24 Feb 2022 16:31:45 +0000 (16:31 +0000)] 
doc/dbus-api-design: fix broken links

* use version independent qtdbus url
* developer.gnome.org links moved to developer-old.gnome.org
* bustle now on freedesktop gitlab

3 years agoMerge branch 'mingw-w64-printf' into 'master'
Ralf Habacker [Mon, 28 Feb 2022 07:47:19 +0000 (07:47 +0000)] 
Merge branch 'mingw-w64-printf' into 'master'

build: Opt out from using mingw-w64's replacement printf(), etc.

Closes #380

See merge request dbus/dbus!261

3 years agoCI: Make most gcc warnings fatal for CMake builds
Simon McVittie [Sun, 27 Feb 2022 17:09:05 +0000 (17:09 +0000)] 
CI: Make most gcc warnings fatal for CMake builds

This makes sure we notice problems early.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Use current Debian stable release for mingw-w64 builds
Simon McVittie [Fri, 25 Feb 2022 16:08:32 +0000 (16:08 +0000)] 
CI: Use current Debian stable release for mingw-w64 builds

Now that we have resolved the failure to build with newer mingw-w64,
we don't need to hold these back to Debian 10 'buster' and can upgrade
to the current stable release, Debian 11 'bullseye'.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobuild: Opt out from using mingw-w64's replacement printf(), etc.
Simon McVittie [Fri, 25 Feb 2022 16:06:59 +0000 (16:06 +0000)] 
build: Opt out from using mingw-w64's replacement printf(), etc.

The Windows code in dbus is careful to use Windows-specific equivalents
of the Standard C features that are not implemented by msvcrt.dll, so
we don't need to substitute a Standard C printf implementation.

This avoids compiler warnings/errors when gcc expects us to be using
Microsoft printf syntax (`ms_printf` attribute), but newer versions of
mingw-w64 expect us to be using GNU or Standard C printf syntax
(`gnu_printf` attribute) as a result of `__USE_MINGW_ANSI_STDIO` being
enabled by default if not otherwise specified.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/380
Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoMerge branch 'ci' into 'master'
Simon McVittie [Fri, 25 Feb 2022 14:55:49 +0000 (14:55 +0000)] 
Merge branch 'ci' into 'master'

CI: Update Debian releases

See merge request dbus/dbus!260

3 years agoCI: Use https to download MSYS packages
Simon McVittie [Fri, 25 Feb 2022 13:31:43 +0000 (13:31 +0000)] 
CI: Use https to download MSYS packages

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Install ci-certificates
Simon McVittie [Fri, 25 Feb 2022 13:31:12 +0000 (13:31 +0000)] 
CI: Install ci-certificates

We need this to be able to download MSYS packages now.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Build on Debian 11 'bullseye' instead of Debian 10 'buster'
Simon McVittie [Fri, 25 Feb 2022 13:48:05 +0000 (13:48 +0000)] 
CI: Build on Debian 11 'bullseye' instead of Debian 10 'buster'

This is the current stable release for Debian, making Debian 10 a much
less interesting target for backports. Add a manually-triggered job
so we can still try buster occasionally.

Continue to use buster for mingw-w64 builds until format string issues
with bullseye toolchains can be sorted out.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Remove EOL versions of Debian and Ubuntu
Simon McVittie [Fri, 25 Feb 2022 13:45:10 +0000 (13:45 +0000)] 
CI: Remove EOL versions of Debian and Ubuntu

Debian 9 'stretch' is EOL, and Ubuntu 16.04 is EOL unless you enter into
a special subscription with Canonical. This puts them outside our
informal security-support policy, and realistically, anyone sufficiently
change-averse to be following these distributions is not going to be
backporting a current version of dbus.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoDisable MSVC CI by default for now
Simon McVittie [Fri, 25 Feb 2022 13:53:56 +0000 (13:53 +0000)] 
Disable MSVC CI by default for now

The necessary CI runner doesn't seem to be available, and we shouldn't
let that prevent us from merging dbus changes. This can be reverted
when the runner comes back.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobuild: Fix update-authors rule to work out-of-tree
Simon McVittie [Wed, 23 Feb 2022 19:42:46 +0000 (19:42 +0000)] 
build: Fix update-authors rule to work out-of-tree

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoAUTHORS: Update from git history
Simon McVittie [Wed, 23 Feb 2022 19:42:26 +0000 (19:42 +0000)] 
AUTHORS: Update from git history

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoStart development of dbus 1.13.24
Simon McVittie [Wed, 23 Feb 2022 19:40:15 +0000 (19:40 +0000)] 
Start development of dbus 1.13.24

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoPrepare dbus 1.13.22 and spec 0.38 dbus-1.13.22
Simon McVittie [Wed, 23 Feb 2022 14:35:07 +0000 (14:35 +0000)] 
Prepare dbus 1.13.22 and spec 0.38

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoUpdate NEWS
Simon McVittie [Wed, 23 Feb 2022 14:30:46 +0000 (14:30 +0000)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoMerge branch 'oom-score-adj' into 'master'
Simon McVittie [Wed, 23 Feb 2022 12:29:22 +0000 (12:29 +0000)] 
Merge branch 'oom-score-adj' into 'master'

Fix handling of /proc/self/oom_score_adj on Linux

Closes #374 and #378

See merge request dbus/dbus!255

3 years agosysdeps-unix: Diagnose failure to open /proc/self/oom_score_adj
Simon McVittie [Mon, 21 Feb 2022 16:07:26 +0000 (16:07 +0000)] 
sysdeps-unix: Diagnose failure to open /proc/self/oom_score_adj

Previously, we silently ignored this, but now that we're more careful
about the contexts in which we try to reset the OOM score and whether
we log failures as a warning, we can let the dbus-daemon-launch-helper
show a message if it can't write there.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agospawn-unix: Don't log an error if unable to reset Linux OOM score
Simon McVittie [Mon, 21 Feb 2022 16:02:13 +0000 (16:02 +0000)] 
spawn-unix: Don't log an error if unable to reset Linux OOM score

We cannot safely log between fork() and exec() because it isn't an
async-signal-safe operation (in particular it might allocate memory).

We also don't want to treat a failure here as a real problem, because
it might legitimately not work: in a system dbus-daemon that has dropped
privileges from root, the pseudo-file representing this process parameter
remains owned by root and cannot be altered by the unprivileged user.

For the main use-case for this operation, the system dbus-daemon, we
have another opportunity to do this in the dbus-daemon-launch-helper
(see the previous commit).

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agodbus-daemon-launch-helper: Reset Linux OOM score adjustment here
Simon McVittie [Mon, 21 Feb 2022 16:00:42 +0000 (16:00 +0000)] 
dbus-daemon-launch-helper: Reset Linux OOM score adjustment here

Previously, we were relying on the system bus being able to reset
its OOM score adjustment after it forks, but before it execs the
dbus-daemon-launch-helper. However, it can't actually do that (leading
to dbus#378), because the system bus typically starts as root, uses its
root privileges to adjust resource limits, and then drops privileges
to the `@DBUS_USER@`, typically `dbus` or `messagebus`. This leaves the
pseudo-files in /proc for its process parameters owned by root, and the
`@DBUS_USER@` is not allowed to open them for writing.

The dbus-daemon-launch-helper is setuid root, so it can certainly
alter its OOM score adjustment before exec'ing the actual activated
service. We need to do this before dropping privileges, because after
dropping privileges we would be unable to write to this process
parameter.

This is a non-async-signal-safe context, so we can safely log errors
here, unlike the fork-and-exec code paths.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/378
Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agospawn-unix: On Linux, don't try to increase OOM-killer protection
Simon McVittie [Mon, 21 Feb 2022 15:53:38 +0000 (15:53 +0000)] 
spawn-unix: On Linux, don't try to increase OOM-killer protection

The oom_score_adj parameter is a signed integer, with increasingly
positive values being more likely to be killed by the OOM-killer,
and increasingly negative values being less likely.

Previously, we assumed that oom_score_adj would be negative or zero,
and reset it to zero, which does not require privileges because it
meant we're voluntarily giving up our OOM-killer protection.
In particular, bus/dbus.service.in has OOMScoreAdjust=-900, which
we don't want system services to inherit.

However, systemd >= 250 has started putting a positive oom_score_adj
on user processes, to make it more likely that the OOM killer will kill
a user process rather than a system process. Changing from a positive
oom_score_adj to zero is increasing protection from the OOM-killer,
which only a privileged process is allowed to do, resulting in warnings
whenever we carry out traditional (non-systemd) service activation
on the session bus.

To avoid this, do the equivalent of:

    if (oom_score_adj < 0)
        oom_score_adj = 0;

which is always allowed.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/374
Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agosysdeps-unix: Factor out _dbus_reset_oom_score_adj
Simon McVittie [Mon, 21 Feb 2022 15:41:41 +0000 (15:41 +0000)] 
sysdeps-unix: Factor out _dbus_reset_oom_score_adj

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agospawn-unix: Correct indentation
Simon McVittie [Mon, 21 Feb 2022 15:29:46 +0000 (15:29 +0000)] 
spawn-unix: Correct indentation

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoMerge branch 'integration-test' into 'master'
Simon McVittie [Tue, 22 Feb 2022 17:05:05 +0000 (17:05 +0000)] 
Merge branch 'integration-test' into 'master'

tests: Ensure session bus has started before integration test

See merge request dbus/dbus!256

3 years agotests: Ensure session bus has started before integration test
Simon McVittie [Mon, 21 Feb 2022 10:35:10 +0000 (10:35 +0000)] 
tests: Ensure session bus has started before integration test

The session dbus-daemon won't necessarily be run immediately on login
if we are using systemd socket activation for it, and the transient
services directory $XDG_RUNTIME_DIR/dbus-1/services isn't created until
it's actually run. Ping the dbus-daemon to make sure it's available.

Signed-off-by: Simon McVittie <smcv@debian.org>
Bug-Debian: https://bugs.debian.org/1005889

3 years agoMerge branch 'cmake-fixes' into 'master'
Ralf Habacker [Mon, 21 Feb 2022 14:50:14 +0000 (14:50 +0000)] 
Merge branch 'cmake-fixes' into 'master'

cmake: remove obsolete variable DBUS_SOURCE_DIR

See merge request dbus/dbus!254

3 years agocmake: remove obsolete variable DBUS_SOURCE_DIR
Ralf Habacker [Fri, 18 Feb 2022 07:33:15 +0000 (08:33 +0100)] 
cmake: remove obsolete variable DBUS_SOURCE_DIR

This issue has been reported at #377

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agoMerge branch 'xml-catalog' into 'master'
Simon McVittie [Mon, 21 Feb 2022 14:11:02 +0000 (14:11 +0000)] 
Merge branch 'xml-catalog' into 'master'

doc: Introduce XML catalog

See merge request dbus/dbus!202

3 years agodoc: Introduce XML catalog
Jan Tojnar [Thu, 11 Feb 2021 05:00:45 +0000 (06:00 +0100)] 
doc: Introduce XML catalog

This adds a nice way of loading the DTD files based on the identifier
in the DOCTYPE declaration, no matter where the DTDs are installed.
See also ‘XML catalog’ Wikipedia entry and update-xmlcatalog(8).

3 years agoMerge branch 'add-confidential-mr-doc' into 'master'
Simon McVittie [Mon, 21 Feb 2022 13:55:18 +0000 (13:55 +0000)] 
Merge branch 'add-confidential-mr-doc' into 'master'

CONTRIBUTING.md: creation of "confidential" merge requests added

See merge request dbus/dbus!252

3 years agoCONTRIBUTING.md: creation of "confidential" merge requests added
Ralf Habacker [Thu, 17 Feb 2022 10:10:00 +0000 (11:10 +0100)] 
CONTRIBUTING.md: creation of "confidential" merge requests added

See #368

3 years agoMerge branch 'fix-issue-377' into 'master'
Simon McVittie [Thu, 17 Feb 2022 14:57:23 +0000 (14:57 +0000)] 
Merge branch 'fix-issue-377' into 'master'

cmake: fix for ninja phony cycle related configuring errors

Closes #377

See merge request dbus/dbus!253

3 years agocmake: fix for ninja phony cycle related configuring errors
Ralf Habacker [Thu, 17 Feb 2022 13:04:55 +0000 (14:04 +0100)] 
cmake: fix for ninja phony cycle related configuring errors

A prefix has been added to the custom target names in docbook-related
macros to fix the reported error:

  ninja: error: build.ninja:xxx: multiple rules generate
  doc/dbus-xxx.1.html [-w dupbuild=err]

Fixes #377

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agocmake: drop obsolete dependencies for generated docbook source files
Ralf Habacker [Thu, 17 Feb 2022 13:03:17 +0000 (14:03 +0100)] 
cmake: drop obsolete dependencies for generated docbook source files

The docbook source files are already dependencies of the generated
docbook files.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
3 years agocmake: let macro docbook handle all requested formats in one call
Ralf Habacker [Thu, 17 Feb 2022 13:01:56 +0000 (14:01 +0100)] 
cmake: let macro docbook handle all requested formats in one call

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>