]> git.ipfire.org Git - thirdparty/dbus.git/log
thirdparty/dbus.git
3 years agodbus: move AF_UNIX code to server-socket
Marc-André Lureau [Thu, 17 Mar 2022 14:16:01 +0000 (18:16 +0400)] 
dbus: move AF_UNIX code to server-socket

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agodbus: handle unix server in a new function
Marc-André Lureau [Tue, 8 Feb 2022 13:55:49 +0000 (17:55 +0400)] 
dbus: handle unix server in a new function

Split _dbus_server_listen_platform_specific() to handle unix listenable
address independently, allowing Windows support in following commit.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agodbus: move AF_UNIX code to transport-socket
Marc-André Lureau [Thu, 17 Mar 2022 14:03:00 +0000 (18:03 +0400)] 
dbus: move AF_UNIX code to transport-socket

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agodbus: add _dbus_transport_open_unixexec()
Marc-André Lureau [Fri, 1 Apr 2022 19:00:28 +0000 (23:00 +0400)] 
dbus: add _dbus_transport_open_unixexec()

Split _dbus_transport_open_unix_socket() to leave the "unixexec:"
handling to the unix-specific unit.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agodbus: handle unix transport in a new common function
Marc-André Lureau [Tue, 8 Feb 2022 09:04:33 +0000 (13:04 +0400)] 
dbus: handle unix transport in a new common function

Split out the Unix socket handling from open_platform_specific(),
enabling "unix:" connectable addresses on Windows in next patch.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agodbus: add function for Unix sockets on Windows
Marc-André Lureau [Tue, 8 Feb 2022 11:41:50 +0000 (15:41 +0400)] 
dbus: add function for Unix sockets on Windows

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agodbus: move _DBUS_MAX_SUN_PATH_LENGTH to sysdeps.h
Marc-André Lureau [Tue, 8 Feb 2022 10:25:08 +0000 (14:25 +0400)] 
dbus: move _DBUS_MAX_SUN_PATH_LENGTH to sysdeps.h

Share the same constant for all systems.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agobuild-sys: check for afunix.h
Marc-André Lureau [Wed, 9 Feb 2022 10:48:43 +0000 (14:48 +0400)] 
build-sys: check for afunix.h

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agodbus: move unix socket declarations to common sysdeps.h
Marc-André Lureau [Tue, 8 Feb 2022 12:23:27 +0000 (16:23 +0400)] 
dbus: move unix socket declarations to common sysdeps.h

The function declaration can be moved to system-agnostic header and be
implemented on Windows in following commits.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agodbus: change unix socket functions to return DBusSocket
Marc-André Lureau [Tue, 8 Feb 2022 11:19:32 +0000 (15:19 +0400)] 
dbus: change unix socket functions to return DBusSocket

This will allow to abstract away for Windows Unix socket support.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agodbus: simplify socket close() & invalidate() calls
Marc-André Lureau [Tue, 8 Feb 2022 13:28:16 +0000 (17:28 +0400)] 
dbus: simplify socket close() & invalidate() calls

Now that _dbus_close_socket() invalidates the socket on its own already.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agodbus: set the socket as invalid in _dbus_close_socket()
Marc-André Lureau [Tue, 8 Feb 2022 10:57:05 +0000 (14:57 +0400)] 
dbus: set the socket as invalid in _dbus_close_socket()

This can simplify error handling in many situation where a socket is
returned, such as in the following commits.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agodbus: make _dbus_close_socket() take DBusSocket*
Marc-André Lureau [Tue, 8 Feb 2022 13:15:05 +0000 (17:15 +0400)] 
dbus: make _dbus_close_socket() take DBusSocket*

This will allow to invalidate the socket in the following commit.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agodbus/win: fix a code comment about get_tmpdir()
Marc-André Lureau [Tue, 15 Feb 2022 22:07:56 +0000 (02:07 +0400)] 
dbus/win: fix a code comment about get_tmpdir()

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agos/PF_UNIX/AF_UNIX
Marc-André Lureau [Tue, 8 Feb 2022 08:10:34 +0000 (12:10 +0400)] 
s/PF_UNIX/AF_UNIX

PF_UNIX is an old BSD 4.x relic, and even there they promise that PF_UNIX
is the same as AF_UNIX. (Linux socket(2))

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agoMisc style fix
Marc-André Lureau [Fri, 1 Apr 2022 18:38:25 +0000 (22:38 +0400)] 
Misc style fix

As pointed out by Simon McVittie <smcv@collabora.com>:
https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/249#note_1323102

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agoMerge branch 'leak-sanitizer' into 'master'
Simon McVittie [Fri, 15 Jul 2022 15:14:35 +0000 (15:14 +0000)] 
Merge branch 'leak-sanitizer' into 'master'

Silence some LeakSanitizer warnings

See merge request dbus/dbus!326

3 years agodbus-launch-x11: Ignore X11 connection when checking for memory leaks
Simon McVittie [Fri, 15 Jul 2022 14:08:02 +0000 (15:08 +0100)] 
dbus-launch-x11: Ignore X11 connection when checking for memory leaks

The X11 connection is opened and never closed. Because dbus-launch
forks and continues to run non-trivial code in a forked child, it is
not clear whether (or where) it would be safe to close it; instead, we
leave it open until process exit, at which point the socket is cleaned
up by the kernel.

Any memory allocated for the X11 connection is only allocated once per
run of dbus-launch, so there's no need to keep track of it, and we can
silence these memory leak warnings as uninteresting.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest-privserver: Exit if DBusLoop cannot be allocated
Simon McVittie [Fri, 15 Jul 2022 12:48:03 +0000 (13:48 +0100)] 
test-privserver: Exit if DBusLoop cannot be allocated

Otherwise, we'd just crash when we dereference the null pointer.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest-privserver: Move cleanup of DBusLoop into test_service_data_free()
Simon McVittie [Fri, 15 Jul 2022 12:47:33 +0000 (13:47 +0100)] 
test-privserver: Move cleanup of DBusLoop into test_service_data_free()

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest-privserver: Don't leak a copy of the server address
Simon McVittie [Fri, 15 Jul 2022 12:47:01 +0000 (13:47 +0100)] 
test-privserver: Don't leak a copy of the server address

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoMerge branch 'compiler-args' into 'master'
Simon McVittie [Fri, 15 Jul 2022 12:16:59 +0000 (12:16 +0000)] 
Merge branch 'compiler-args' into 'master'

meson: Improve handling of compiler arguments

See merge request dbus/dbus!325

3 years agomeson: Enable more compiler warnings
Simon McVittie [Fri, 15 Jul 2022 10:38:26 +0000 (11:38 +0100)] 
meson: Enable more compiler warnings

This provides parity with what we did in Autotools (most of it via
AX_COMPILER_FLAGS_CFLAGS).

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomeson: Pass project-wide compile arguments to has_header_symbol, etc.
Simon McVittie [Fri, 15 Jul 2022 10:42:11 +0000 (11:42 +0100)] 
meson: Pass project-wide compile arguments to has_header_symbol, etc.

Otherwise, we'll miss symbols that only appear when _GNU_SOURCE is
defined, like environ in Linux unistd.h.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomeson: Comment why we disable certain compiler warnings
Simon McVittie [Fri, 15 Jul 2022 11:14:45 +0000 (12:14 +0100)] 
meson: Comment why we disable certain compiler warnings

This knowledge shouldn't be lost when we delete the Autotools build
system.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomeson: Build with -fno-common if supported
Simon McVittie [Fri, 15 Jul 2022 11:18:04 +0000 (12:18 +0100)] 
meson: Build with -fno-common if supported

This turns off a poorly-supported feature of older compilers. Even when
using an older compiler, we want to behave more strictly.

The Autotools build already did this.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomeson: Build with -fno-strict-aliasing if supported
Simon McVittie [Fri, 15 Jul 2022 09:42:19 +0000 (10:42 +0100)] 
meson: Build with -fno-strict-aliasing if supported

We know that dbus is not fully strict-aliasing-compliant. In Autotools
we got this from AX_COMPILER_FLAGS_CFLAGS.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomeson: Set up functionally necessary compiler arguments separately
Simon McVittie [Fri, 15 Jul 2022 11:13:43 +0000 (12:13 +0100)] 
meson: Set up functionally necessary compiler arguments separately

We have to set up feature-flag options like _GNU_SOURCE before we
do compiler checks like cc.has_header_symbol, otherwise we'll miss
symbols that are guarded by a feature-flag test, like environ in Linux
unistd.h.

However, we don't want to pass flags for extra compiler warnings
when doing these checks, because that can cause false negatives:
in particular, Meson's check programs nearly always trigger -Wunused.
So the warnings need to be in a separate list.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest: Work around TAP test regression in Meson 0.63.0
Simon McVittie [Fri, 15 Jul 2022 00:37:47 +0000 (01:37 +0100)] 
test: Work around TAP test regression in Meson 0.63.0

With Meson 0.63.0, detailed output of TAP tests is not logged, and the
test deadlocks if the stderr pipe fills up. I'm hoping this will be fixed
before 0.63.1, but in the meantime we can work around it by falling back
to the 'exitcode' protocol: this means we lose machine-readable detailed
test results, but at least our tests pass.

See https://github.com/mesonbuild/meson/issues/10577 and
https://github.com/mesonbuild/meson/issues/10563 for details of the
Meson regression.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobuild: Distribute update-authors.sh in tarballs
Simon McVittie [Thu, 14 Jul 2022 23:43:49 +0000 (00:43 +0100)] 
build: Distribute update-authors.sh in tarballs

Newer versions of Meson require the script for a run_target() to be
present at configure time, even if the script isn't run.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoUpdate NEWS
Simon McVittie [Thu, 14 Jul 2022 20:16:29 +0000 (21:16 +0100)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoMerge branch 'meson' into 'master'
Simon McVittie [Thu, 14 Jul 2022 10:58:22 +0000 (10:58 +0000)] 
Merge branch 'meson' into 'master'

Meson build system (fork of !135)

Closes #325

See merge request dbus/dbus!303

3 years agomaintainer-upload-docs: Use paths pointing into the source directory
Simon McVittie [Wed, 13 Jul 2022 19:45:50 +0000 (20:45 +0100)] 
maintainer-upload-docs: Use paths pointing into the source directory

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: take cmake config.h as artifacts
Marc-André Lureau [Fri, 8 Jul 2022 13:03:12 +0000 (17:03 +0400)] 
CI: take cmake config.h as artifacts

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agoCI: Don't run tests for openSUSE Meson mingw builds for now
Simon McVittie [Mon, 27 Jun 2022 18:13:07 +0000 (19:13 +0100)] 
CI: Don't run tests for openSUSE Meson mingw builds for now

They don't find their library dependencies.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Link libexpat statically when using Wine to run tests
Simon McVittie [Mon, 27 Jun 2022 17:32:31 +0000 (18:32 +0100)] 
CI: Link libexpat statically when using Wine to run tests

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Skip tests that run dbus-daemon when running on Windows
Simon McVittie [Mon, 27 Jun 2022 17:22:30 +0000 (18:22 +0100)] 
CI: Skip tests that run dbus-daemon when running on Windows

Mitigates: #400
Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Explicitly build before running tests
Simon McVittie [Mon, 27 Jun 2022 16:13:52 +0000 (17:13 +0100)] 
CI: Explicitly build before running tests

If we don't do this, Meson will build everything that is a direct
dependency of the test executables, but it won't build indirect
dependencies like GLib's gspawn-win32-helper.exe.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Ensure that subprojects (if used) are on the Wine PATH
Simon McVittie [Mon, 27 Jun 2022 11:48:44 +0000 (12:48 +0100)] 
CI: Ensure that subprojects (if used) are on the Wine PATH

If we are not using Meson subprojects, this will have no practical
effect, because the directories won't exist.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Collect artifacts for Windows builds
Simon McVittie [Mon, 27 Jun 2022 10:21:11 +0000 (11:21 +0100)] 
CI: Collect artifacts for Windows builds

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Force use of subprojects for Windows 32-bit build
Simon McVittie [Mon, 27 Jun 2022 10:20:56 +0000 (11:20 +0100)] 
CI: Force use of subprojects for Windows 32-bit build

The Windows image has expat and zlib installed, but they're 64-bit DLLs
which won't link successfully into our 32-bit build.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Collect config.h
Simon McVittie [Mon, 27 Jun 2022 10:15:13 +0000 (11:15 +0100)] 
CI: Collect config.h

This will help to verify that the Meson and Autotools/CMake builds are
equivalent.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Enable Ducktype-based documentation on Debian/Ubuntu
Simon McVittie [Mon, 27 Jun 2022 10:14:06 +0000 (11:14 +0100)] 
CI: Enable Ducktype-based documentation on Debian/Ubuntu

We don't currently know the equivalent of python3-mallard-ducktype on
other OSs like openSUSE, but we know this should work on Debian (it does
when we do Autotools builds).

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Run Meson with -v so we can see compiler command-lines
Simon McVittie [Mon, 27 Jun 2022 10:13:14 +0000 (11:13 +0100)] 
CI: Run Meson with -v so we can see compiler command-lines

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Enable modular tests for all Meson-based CI builds
Simon McVittie [Fri, 24 Jun 2022 17:15:03 +0000 (18:15 +0100)] 
CI: Enable modular tests for all Meson-based CI builds

The whole point of these tests is that they're safe to enable because
they don't affect the production binaries.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Factor out Wine setup so that it applies equally to Meson
Simon McVittie [Fri, 24 Jun 2022 16:21:00 +0000 (17:21 +0100)] 
CI: Factor out Wine setup so that it applies equally to Meson

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Install cross pkg-config on openSUSE
Simon McVittie [Fri, 24 Jun 2022 16:11:47 +0000 (17:11 +0100)] 
CI: Install cross pkg-config on openSUSE

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Explicitly enable wrap dependencies
Simon McVittie [Fri, 24 Jun 2022 16:10:49 +0000 (17:10 +0100)] 
CI: Explicitly enable wrap dependencies

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Tell Meson build where to find the source directory
Simon McVittie [Fri, 24 Jun 2022 13:37:22 +0000 (14:37 +0100)] 
CI: Tell Meson build where to find the source directory

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Implement debug build variant for Meson
Simon McVittie [Fri, 24 Jun 2022 13:32:19 +0000 (14:32 +0100)] 
CI: Implement debug build variant for Meson

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Explicitly disable features that can't work on Windows
Simon McVittie [Fri, 24 Jun 2022 16:29:55 +0000 (17:29 +0100)] 
CI: Explicitly disable features that can't work on Windows

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Add glue to build with mingw-w64 toolchain on Debian
Simon McVittie [Fri, 24 Jun 2022 13:21:30 +0000 (14:21 +0100)] 
CI: Add glue to build with mingw-w64 toolchain on Debian

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Only use openSUSE mingw*-meson as a replacement for `meson setup`
Simon McVittie [Fri, 24 Jun 2022 15:48:46 +0000 (16:48 +0100)] 
CI: Only use openSUSE mingw*-meson as a replacement for `meson setup`

These pass a lot of configure arguments taken from RPM macros, which
are only accepted by the meson command if we don't explicitly select
a mode.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Verify that Autotools `make dist` includes everything needed for Meson
Simon McVittie [Mon, 27 Jun 2022 11:41:41 +0000 (12:41 +0100)] 
CI: Verify that Autotools `make dist` includes everything needed for Meson

This is similar to what we have done for CMake since dbus/dbus!87
(commit 1063bba "CI: Do the CMake native debug build from an Autotools
`make dist`"). Our official source releases are Autotools `make dist`
tarballs, so our CI should assert that such tarballs contain everything
necessary to do a CMake or Meson build, so that downstream distributions
using our tarballs as source can choose their preferred build system.

When the Meson build system is ready to be recommended as more preferred
than Autotools, we can do as GLib did: stop releasing `make dist`
tarballs, and start releasing `meson dist` tarballs instead (which will
change nothing for Meson or CMake users, but Autotools users will have
to run autoreconf or autogen.sh before building).

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Consistently build in ./build
Simon McVittie [Fri, 24 Jun 2022 13:15:27 +0000 (14:15 +0100)] 
CI: Consistently build in ./build

This will make it easier to capture log files. All our CI builds happen
in an expendable checkout, so we can safely remove and re-create ./build.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Collect all Meson logs, not just the test log
Simon McVittie [Fri, 24 Jun 2022 14:07:27 +0000 (15:07 +0100)] 
CI: Collect all Meson logs, not just the test log

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Add repository for word-size-independent mingw stuff
Simon McVittie [Fri, 24 Jun 2022 13:09:01 +0000 (14:09 +0100)] 
CI: Add repository for word-size-independent mingw stuff

windows:mingw:win64 depends on packages from windows:mingw.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Reinstate mingw*-glib2-devel
Simon McVittie [Fri, 24 Jun 2022 13:07:19 +0000 (14:07 +0100)] 
CI: Reinstate mingw*-glib2-devel

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCI: Use mingw32-meson if that's what we're targeting
Simon McVittie [Thu, 23 Jun 2022 17:52:32 +0000 (18:52 +0100)] 
CI: Use mingw32-meson if that's what we're targeting

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoAdd meson build CI
Marc-André Lureau [Sat, 5 Feb 2022 22:44:59 +0000 (02:44 +0400)] 
Add meson build CI

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agotest: Don't prepend test- to the names of manual tests
Simon McVittie [Wed, 13 Jul 2022 18:31:33 +0000 (19:31 +0100)] 
test: Don't prepend test- to the names of manual tests

This makes them consistent with what we do in Autotools.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomeson: Create /var/lib/dbus
Simon McVittie [Wed, 13 Jul 2022 18:28:41 +0000 (19:28 +0100)] 
meson: Create /var/lib/dbus

This holds the machine ID created by dbus-uuidgen.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomeson: Don't use cc.has_function to check for va_copy
Simon McVittie [Wed, 13 Jul 2022 16:55:27 +0000 (17:55 +0100)] 
meson: Don't use cc.has_function to check for va_copy

va_copy is not an ordinary function (an extern symbol), so we can't
treat it as one. Instead, use the same compilation/linking check as
in the Autotools build system.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agocmake: drop DBUS_VERBOSE_C_S
Marc-André Lureau [Mon, 11 Jul 2022 07:17:12 +0000 (11:17 +0400)] 
cmake: drop DBUS_VERBOSE_C_S

Apparently, not used anywhere.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agocmake: drop unused HAVE_VASPRINTF/HAVE_VSNPRINTF checks
Marc-André Lureau [Mon, 11 Jul 2022 07:02:42 +0000 (11:02 +0400)] 
cmake: drop unused HAVE_VASPRINTF/HAVE_VSNPRINTF checks

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agocmake/autotools: remove HAVE_DIRFD/HAVE_DDFD
Marc-André Lureau [Mon, 11 Jul 2022 06:59:33 +0000 (10:59 +0400)] 
cmake/autotools: remove HAVE_DIRFD/HAVE_DDFD

dirfd() is assumed to be present on Linux, dd_fd is never used.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agocmake: drop needless headers checks
Marc-André Lureau [Fri, 8 Jul 2022 15:38:18 +0000 (19:38 +0400)] 
cmake: drop needless headers checks

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agomeson: add missing header checks
Marc-André Lureau [Fri, 8 Jul 2022 15:47:34 +0000 (19:47 +0400)] 
meson: add missing header checks

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agomeson: add windows_output_debug_string option
Marc-André Lureau [Fri, 8 Jul 2022 15:29:06 +0000 (19:29 +0400)] 
meson: add windows_output_debug_string option

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[smcv: Rename to avoid using "Win32" to refer to both 32- and 64-bit]
Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoautotools: dist listen-autolaunch-win.conf.in as well
Marc-André Lureau [Fri, 8 Jul 2022 13:41:49 +0000 (17:41 +0400)] 
autotools: dist listen-autolaunch-win.conf.in as well

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agomeson: add test-autolaunch-win
Marc-André Lureau [Fri, 8 Jul 2022 12:02:41 +0000 (16:02 +0400)] 
meson: add test-autolaunch-win

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agotest: Set PATH or WINEPATH to find dbus-daemon.exe in build-time tests
Simon McVittie [Wed, 13 Jul 2022 18:02:44 +0000 (19:02 +0100)] 
test: Set PATH or WINEPATH to find dbus-daemon.exe in build-time tests

When building for Windows, either natively or cross-compiling and
running tests with Wine, test-autolaunch-win expects to be able to
find the just-built dbus-daemon.exe in the PATH.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomeson: Allow disabling Valgrind instrumentation
Simon McVittie [Tue, 28 Jun 2022 12:23:31 +0000 (13:23 +0100)] 
meson: Allow disabling Valgrind instrumentation

This would currently result in a hard dependency on Valgrind headers
when linking dependent projects to libdbus (see
https://github.com/mesonbuild/meson/pull/10544 for an attempt to
avoid this), so distributions likely don't want to enable this feature
in their main builds of valgrind (although they could enable it in
special debug builds like the one in Debian's dbus-tests package if
desired).

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomeson: Fix the check for --version-script support
Simon McVittie [Tue, 28 Jun 2022 12:06:35 +0000 (13:06 +0100)] 
meson: Fix the check for --version-script support

At the time we do this check, version_script has not yet been generated,
so we have to use something else.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomeson: Add GLib version macros
Simon McVittie [Tue, 28 Jun 2022 11:50:32 +0000 (12:50 +0100)] 
meson: Add GLib version macros

This helps to avoid unintended dependencies on newer versions of GLib.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomeson: Define HAVE_GIO_UNIX
Simon McVittie [Tue, 28 Jun 2022 11:50:06 +0000 (12:50 +0100)] 
meson: Define HAVE_GIO_UNIX

Some of the tests check for this.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomeson: Check for LOG_PERROR
Simon McVittie [Tue, 28 Jun 2022 11:42:09 +0000 (12:42 +0100)] 
meson: Check for LOG_PERROR

We use this when writing to the system log.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomeson: Check for environ declaration
Simon McVittie [Tue, 28 Jun 2022 11:41:51 +0000 (12:41 +0100)] 
meson: Check for environ declaration

We use this in various places.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomeson: Replicate Autotools check for __sync_sub_and_fetch
Simon McVittie [Tue, 28 Jun 2022 11:30:55 +0000 (12:30 +0100)] 
meson: Replicate Autotools check for __sync_sub_and_fetch

The built-in atomic intrinsics are not exactly functions, so it's
incorrect to use has_function to check for them.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomeson: Always define HAVE_DECL_MSG_NOSIGNAL to 1 or 0
Simon McVittie [Tue, 28 Jun 2022 11:28:08 +0000 (12:28 +0100)] 
meson: Always define HAVE_DECL_MSG_NOSIGNAL to 1 or 0

This is consistent with Autotools AC_CHECK_DECLS.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomeson: Don't check for dirfd
Simon McVittie [Tue, 28 Jun 2022 11:00:43 +0000 (12:00 +0100)] 
meson: Don't check for dirfd

We never actually look at HAVE_DIRFD.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomeson: Don't define DBUS_ENABLE_ASSERTS
Simon McVittie [Tue, 28 Jun 2022 10:52:02 +0000 (11:52 +0100)] 
meson: Don't define DBUS_ENABLE_ASSERTS

The other build systems don't define this, and it's too confusing to
have both DBUS_ENABLE_ASSERTS and DBUS_ENABLE_ASSERT.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest: Extend some timeouts
Simon McVittie [Fri, 24 Jun 2022 14:10:40 +0000 (15:10 +0100)] 
test: Extend some timeouts

Group slow tests (those taking about a minute or more in one of the
configurations built on Gitlab-CI) into a new 'slow' suite, which can
be used with `meson test --no-suite=slow` to run just the faster tests.
They default to a 5 minute timeout (usually enough) unless overridden
(bus/dispatch.c can be *very* slow when OOM testing is enabled, and
gets a 30 minute timeout).

For the remaining tests, default to Meson's usual 30 second timeout,
but bump up the timeout a bit in some cases to have a safety margin
(my method was to take the slowest run on our Gitlab-CI, and make sure
we're allowing about 3 times that long).

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agodbus: Only use compile flags from valgrind, not libraries
Simon McVittie [Mon, 27 Jun 2022 17:28:29 +0000 (18:28 +0100)] 
dbus: Only use compile flags from valgrind, not libraries

Recent versions of valgrind have library code, which we don't need (or
want) to link to; all we actually want is <valgrind.h> and <memcheck.h>.

I had hoped that this would suppress the Requires.private when
generating our .pc file, but it doesn't seem to.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest: Group together tests that run the dbus-daemon
Simon McVittie [Mon, 27 Jun 2022 17:25:06 +0000 (18:25 +0100)] 
test: Group together tests that run the dbus-daemon

These have slightly different requirements on CI, and are harder to
get working on Windows.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest: Add missing session.conf, system.conf to Meson build
Simon McVittie [Mon, 27 Jun 2022 14:53:18 +0000 (15:53 +0100)] 
test: Add missing session.conf, system.conf to Meson build

For as-installed testing on Unix, we want these to be symlinks to the
production versions of the same file.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomeson_post_install.py: Correct path to dbus-daemon-launch-helper
Simon McVittie [Mon, 27 Jun 2022 14:41:04 +0000 (15:41 +0100)] 
meson_post_install.py: Correct path to dbus-daemon-launch-helper

It's installed in the ${libexecdir} for both Autotools and Meson.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomeson_post_install.py: Call chmod after chown
Simon McVittie [Mon, 27 Jun 2022 14:39:19 +0000 (15:39 +0100)] 
meson_post_install.py: Call chmod after chown

If we call chmod before chown, then chown will remove the setuid bit.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobuild: Change how we create empty directories from Meson
Simon McVittie [Mon, 27 Jun 2022 14:37:17 +0000 (15:37 +0100)] 
build: Change how we create empty directories from Meson

Use install_emptydir() in Meson versions that support it, or a script
with similar invocation in versions that do not. This will make it
straightforward to migrate to install_emptydir() when we drop support
for Meson versions older than 0.60.0.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobuild: Change how we create symlinks from Meson
Simon McVittie [Mon, 27 Jun 2022 14:12:54 +0000 (15:12 +0100)] 
build: Change how we create symlinks from Meson

Use install_symlink() in Meson versions that support it, or a script
with similar invocation in versions that do not. This will make it
straightforward to migrate to install_symlink() when we drop support
for Meson versions older than 0.61.0.

Based on an implementation in the game-data-packager package, which used
a shell script.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobuild: Don't replace prefix in .pc file if relocation is disabled
Simon McVittie [Mon, 27 Jun 2022 14:14:18 +0000 (15:14 +0100)] 
build: Don't replace prefix in .pc file if relocation is disabled

Replacing the prefix with a path relative to ${pcfiledir} can be harmful
if the number of path components between the prefix and the ${libdir}
is not what we expect, in particular on Debian-derived systems where the
${libdir} is normally lib/x86_64-linux-gnu or similar.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agodoc: Don't install introspect.xsl for now
Simon McVittie [Mon, 27 Jun 2022 13:54:33 +0000 (14:54 +0100)] 
doc: Don't install introspect.xsl for now

Maybe this should be installed, but for now maintain parity with
Autotools.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobus: Install example systemd hardening when using Meson
Simon McVittie [Mon, 27 Jun 2022 13:52:54 +0000 (14:52 +0100)] 
bus: Install example systemd hardening when using Meson

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest: Install transient-services.sh into a subdirectory
Simon McVittie [Mon, 27 Jun 2022 13:26:12 +0000 (14:26 +0100)] 
test: Install transient-services.sh into a subdirectory

This is what we do with Autotools, and keeping Meson the same means we
can diff the installed trees more easily.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agodoc: Make Meson yelp-build invocation compatible with older versions
Simon McVittie [Mon, 27 Jun 2022 11:54:52 +0000 (12:54 +0100)] 
doc: Make Meson yelp-build invocation compatible with older versions

Older versions of yelp-build like the one in Debian 11 do not allow
permuting arguments, so all options (in this case -o) must appear
before all positional parameters.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agodoc: Write absolute path to DTDS into XML catalog
Simon McVittie [Mon, 27 Jun 2022 10:53:20 +0000 (11:53 +0100)] 
doc: Write absolute path to DTDS into XML catalog

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest: libdbus-testutils depends on GIO, not just GLib
Simon McVittie [Fri, 24 Jun 2022 17:14:21 +0000 (18:14 +0100)] 
test: libdbus-testutils depends on GIO, not just GLib

This matters when we build against GLib as a Meson subproject.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobuild: Define x11 to an empty dependency if X11 autolaunch is disabled
Simon McVittie [Fri, 24 Jun 2022 16:53:12 +0000 (17:53 +0100)] 
build: Define x11 to an empty dependency if X11 autolaunch is disabled

Otherwise, we can't build successfully for Windows with X11 autolaunch
explicitly disabled.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest: Make environment variables consistent with Autotools
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>
3 years agosubprojects: Allow expat and GLib to be built as subprojects
Simon McVittie [Fri, 24 Jun 2022 13:27:10 +0000 (14:27 +0100)] 
subprojects: Allow expat and GLib to be built as subprojects

This should let us build everything with a mingw-w64 toolchain, without
having to use prebuilt dependencies from MSYS.

Signed-off-by: Simon McVittie <smcv@collabora.com>