]> git.ipfire.org Git - thirdparty/dbus.git/log
thirdparty/dbus.git
3 years agoMerge branch '30x-faster-testing' into 'master'
Simon McVittie [Mon, 18 Jul 2022 13:06:58 +0000 (13:06 +0000)] 
Merge branch '30x-faster-testing' into 'master'

tests: Speed up bus-dispatch OOM testing by a factor of 30

See merge request dbus/dbus!328

3 years agodispatch test: Pass in test data directory as a C string
Simon McVittie [Sun, 17 Jul 2022 15:20:14 +0000 (16:20 +0100)] 
dispatch test: Pass in test data directory as a C string

This reduces duplication a little bit.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest/bus: Break up dispatch test into three separate tests
Simon McVittie [Fri, 15 Jul 2022 14:41:14 +0000 (15:41 +0100)] 
test/bus: Break up dispatch test into three separate tests

This is really three separate test-cases: one for traditional
activation as a direct child process of the dbus-daemon, and two for
traditional activation (successful and failing) via the setuid
dbus-daemon-launch-helper on Unix.

The ones where activation succeeds extremely slow, as a result of the
instrumentation for simulating malloc() failures combined with a large
number of memory operations, particularly when using AddressSanitizer.

Splitting up "OOM" tests like these has a disproportionately good impact
on the time they take, because the simulated malloc() failure
instrumentation repeats the entire test making the first malloc() fail,
then making the second malloc() fail, and so on. For allocation failures
in the second half of the test, this means we repeat the first half of
the test with no malloc() failures a very large number of times, which
is not a good use of time, because we already tested it successfully.

Even when not using the "OOM" instrumentation, splitting up these tests
lets them run in parallel, which is also a major time saving.

Needless to say, this speeds up testing considerably. On my modern but
unexceptional x86 laptop, in a typical debug build with Meson, the old
dispatch test took just over 21 minutes, which drops to about 40 seconds
each for the new normal-activation and helper-activation tests (and for
most of that time, they're running in parallel, so the wall-clock time
taken for the whole test suite is somewhere around a minute).

In a debug build with Meson, gcc and AddressSanitizer, the old dispatch
test takes longer than my patience will allow, and the new separate
tests take about 5-6 minutes each. Reduce their timeout accordingly, but
not as far as the default for slow tests (5 minutes) to allow some
headroom for AddressSanitizer or slower systems.

The failed-helper-activation test is almost instantaneous, and no longer
needs to be marked as slow.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest/bus: Factor out common setup/teardown code
Simon McVittie [Fri, 15 Jul 2022 14:27:24 +0000 (15:27 +0100)] 
test/bus: Factor out common setup/teardown code

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoMerge branch 'uid-0-in-userns' into 'master'
Simon McVittie [Mon, 18 Jul 2022 11:15:17 +0000 (11:15 +0000)] 
Merge branch 'uid-0-in-userns' into 'master'

test: Skip tests that involve switching uid if unable to do so

Closes #407

See merge request dbus/dbus!330

3 years agotest: Skip tests that involve switching uid if unable to do so
Simon McVittie [Mon, 18 Jul 2022 10:14:08 +0000 (11:14 +0100)] 
test: Skip tests that involve switching uid if unable to do so

In a Linux user namespace, it is possible that we are uid 0 but are
unable to switch to some other uid like DBUS_USER or DBUS_TEST_USER,
because the other uid is not "mapped" in the user namespace, resulting
in setuid() or setresuid() failing with EINVAL "Invalid argument".
For example, it's easy for this to happen when running under the
bubblewrap tool.

Try to drop privileges in a child process, and skip the test if we
are unable to do so.

Resolves: dbus#407
Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoMerge branch 'issue-405' into 'master'
Simon McVittie [Mon, 18 Jul 2022 09:27:44 +0000 (09:27 +0000)] 
Merge branch 'issue-405' into 'master'

Escape socket path when building the D-Bus address

See merge request dbus/dbus!329

3 years agoEscape socket path when building the D-Bus address
Marc-André Lureau [Fri, 15 Jul 2022 15:13:47 +0000 (19:13 +0400)] 
Escape socket path when building the D-Bus address

Fixes:
https://gitlab.freedesktop.org/dbus/dbus/-/issues/405

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agoMerge branch 'oom-score-adj' into 'master'
Simon McVittie [Sun, 17 Jul 2022 19:01:43 +0000 (19:01 +0000)] 
Merge branch 'oom-score-adj' into 'master'

Improve dbus-daemon-launch-helper behaviour if it cannot write oom_score_adj

See merge request dbus/dbus!291

3 years agosysdeps: Only open oom_score_adj read/write if we need to write it
Simon McVittie [Fri, 1 Apr 2022 17:56:26 +0000 (18:56 +0100)] 
sysdeps: Only open oom_score_adj read/write if we need to write it

If we're running in a sandbox, we might not have write access to
oom_score_adj. In the common case where we don't have any special
protection from the OOM-killer, we can detect that with only read
access, and skip the part where we open it for writing.

(We would also not have write access to oom_score_adj if we're running
with elevated Linux capabilities while not root, but that should never
actually happen for dbus-daemon-launch-helper, which is setuid root
for production use or has no capabilities during unit-testing.)

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoactivation-helper: Never crash if unable to write oom_score_adj
Simon McVittie [Fri, 1 Apr 2022 17:58:34 +0000 (18:58 +0100)] 
activation-helper: Never crash if unable to write oom_score_adj

_dbus_warn() normally only logs a warning, but can be made fatal by
environment variables. In particular, we do that during unit testing,
which can result in a build-time test failure if dbus is built in a
sandbox environment that prevents write access.

_dbus_log() does only the logging part of _dbus_warn(), which seems
more appropriate here.

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

Add Unix socket support on Windows

See merge request dbus/dbus!249

3 years agospec: AF_UNIX now available on Windows as well
Marc-André Lureau [Fri, 25 Mar 2022 10:45:39 +0000 (14:45 +0400)] 
spec: AF_UNIX now available on Windows as well

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agospec: try to improve comment about AF_UNIX path
Marc-André Lureau [Fri, 25 Mar 2022 10:39:14 +0000 (14:39 +0400)] 
spec: try to improve comment about AF_UNIX path

The comment refers to the nul-padding of sockaddr_un member sun_path and
using an addrlen of sizeof(sockaddr_un). There is not much need to
document an old now "broken" behaviour.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agodbus: extract out _dbus_server_new_for_dir()
Marc-André Lureau [Fri, 25 Mar 2022 12:23:38 +0000 (16:23 +0400)] 
dbus: extract out _dbus_server_new_for_dir()

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agogitlab: skip failing runtime directory check, add FIXME
Marc-André Lureau [Thu, 24 Mar 2022 12:59:16 +0000 (16:59 +0400)] 
gitlab: skip failing runtime directory check, add FIXME

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agodbus/win: use SIO_AF_UNIX_GETPEERPID to lookup peer PID
Marc-André Lureau [Tue, 15 Feb 2022 12:51:02 +0000 (16:51 +0400)] 
dbus/win: use SIO_AF_UNIX_GETPEERPID to lookup peer PID

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agotest: enable AF_UNIX server-oom test on !unix
Marc-André Lureau [Wed, 9 Feb 2022 10:03:12 +0000 (14:03 +0400)] 
test: enable AF_UNIX server-oom test on !unix

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agotest/server-oom: do not hardcode /tmp
Marc-André Lureau [Thu, 24 Mar 2022 11:42:05 +0000 (15:42 +0400)] 
test/server-oom: do not hardcode /tmp

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agotest: enable AF_UNIX relay tests on !unix
Marc-André Lureau [Wed, 9 Feb 2022 08:23:56 +0000 (12:23 +0400)] 
test: enable AF_UNIX relay tests on !unix

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agotest/relay: do not hardcode /tmp on !unix
Marc-André Lureau [Thu, 24 Mar 2022 11:39:44 +0000 (15:39 +0400)] 
test/relay: do not hardcode /tmp on !unix

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agotest: enable AF_UNIX loopback tests on !unix
Marc-André Lureau [Wed, 9 Feb 2022 07:34:35 +0000 (11:34 +0400)] 
test: enable AF_UNIX loopback tests on !unix

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agotests/loopback: do not hardcode /tmp for !unix
Marc-André Lureau [Thu, 17 Mar 2022 13:12:41 +0000 (17:12 +0400)] 
tests/loopback: do not hardcode /tmp for !unix

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agotest: fix loopback AF_UNIX tests to work on Windows
Marc-André Lureau [Wed, 9 Feb 2022 07:56:19 +0000 (11:56 +0400)] 
test: fix loopback AF_UNIX tests to work on Windows

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agotest: enable AF_UNIX corrupt test on !unix
Marc-André Lureau [Wed, 9 Feb 2022 08:25:54 +0000 (12:25 +0400)] 
test: enable AF_UNIX corrupt test on !unix

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agotests/corrupt: do not hardcode /tmp on !unix
Marc-André Lureau [Thu, 17 Mar 2022 13:13:26 +0000 (17:13 +0400)] 
tests/corrupt: do not hardcode /tmp on !unix

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agotest: add test_check_af_unix_works()
Marc-André Lureau [Wed, 9 Feb 2022 08:32:23 +0000 (12:32 +0400)] 
test: add test_check_af_unix_works()

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agodbus: add a few directory separator macros
Marc-André Lureau [Wed, 9 Feb 2022 07:54:52 +0000 (11:54 +0400)] 
dbus: add a few directory separator macros

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3 years agodbus: move DBUS_IS_DIR_SEPARATOR to dbus-internals.h
Marc-André Lureau [Wed, 9 Feb 2022 07:52:51 +0000 (11:52 +0400)] 
dbus: move DBUS_IS_DIR_SEPARATOR to dbus-internals.h

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
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>