]> git.ipfire.org Git - thirdparty/dbus.git/log
thirdparty/dbus.git
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>
3 years agomaintainer-upload-docs: Remove assumptions about source, build dirs
Simon McVittie [Fri, 24 Jun 2022 12:21:15 +0000 (13:21 +0100)] 
maintainer-upload-docs: Remove assumptions about source, build dirs

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomaintainer-upload-docs: Fail if an undefined variable is referenced
Simon McVittie [Fri, 24 Jun 2022 12:46:38 +0000 (13:46 +0100)] 
maintainer-upload-docs: Fail if an undefined variable is referenced

"Unofficial strict mode" for shell scripting.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agomaintainer-upload-docs: Allow servers and directories to be overridden
Simon McVittie [Fri, 24 Jun 2022 12:46:12 +0000 (13:46 +0100)] 
maintainer-upload-docs: Allow servers and directories to be overridden

This lets maintainers test the script without putting changes
directly into production!

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobuild: Make update-authors convenience target runnable from Meson
Simon McVittie [Fri, 24 Jun 2022 12:41:27 +0000 (13:41 +0100)] 
build: Make update-authors convenience target runnable from Meson

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobuild: Remove a misleading comment
Simon McVittie [Fri, 24 Jun 2022 12:27:33 +0000 (13:27 +0100)] 
build: Remove a misleading comment

It's fine to define DBUS_COMPILATION for anything that is being
compiled as part of dbus.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobuild: Implement a runtime_dir option
Simon McVittie [Fri, 24 Jun 2022 12:17:26 +0000 (13:17 +0100)] 
build: Implement a runtime_dir option

If the prefix is /usr, then this defaults to /run, similar to the
special cases for /var and /etc built into Meson. This is correct for
typical modern Linux distributions implementing FHS 3.0. This is
intentionally not consistent with Autotools and CMake: if distributions
are transitioning to a different way to build dbus, then that's a good
time to re-evaluate their build options.

Otherwise, this defaults to LOCALSTATEDIR/run, consistent with Autotools
and CMake.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest: Correct generation of .test metadata
Simon McVittie [Fri, 24 Jun 2022 12:01:54 +0000 (13:01 +0100)] 
test: Correct generation of .test metadata

If a helper executable is not, in itself, a test-case, then we should
not generate metadata that tells ginsttest-runner to run it as a
test-case.

Meanwhile, we were previously generating foo_with_config.test metadata
for tests that don't get installed; stop doing that.

We also need to distinguish between the abstract name of the test
(which usually does not start with test-), the name of the .test file
(which does start with test- for compiled executables), and the name
of the executable (which may include .exe as well). To make validation
against the Autotools build system as straightforward as possible,
generate exactly the same names as in Autotools. We can consider removing
the test- prefix later, if we remove the Autotools build system.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest: Allow for scripts that don't get installed
Simon McVittie [Fri, 24 Jun 2022 12:00:28 +0000 (13:00 +0100)] 
test: Allow for scripts that don't get installed

At the moment there aren't any like this, but it seems reasonable that
we might get some later.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest: Don't run integration tests at build-time
Simon McVittie [Fri, 24 Jun 2022 11:59:40 +0000 (12:59 +0100)] 
test: Don't run integration tests at build-time

Some items listed in the tests array are helper executables rather
than actually being tests, and should not be run as a test at any time.
Those have {"test": false}. Expand this special case to the scripts
array for completeness (although currently, no scripts need this).

Meanwhile, some items listed in the scripts array are "as-installed"
integration tests which cannot safely be run at build-time, because
they make assertions about the state of the installed system.
Introduce {"build_time_test": false} for these, and expand this special
case to the tests array for completeness (although currently, no
compiled executables need this).

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobuild: Propagate some comments from Autotools build into Meson
Simon McVittie [Fri, 24 Jun 2022 11:51:12 +0000 (12:51 +0100)] 
build: Propagate some comments from Autotools build into Meson

Comments like these represent hard-won knowledge which we should not
discard.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobuild: Add machine-readable licensing markers to the Meson build system
Simon McVittie [Fri, 24 Jun 2022 11:50:23 +0000 (12:50 +0100)] 
build: Add machine-readable licensing markers to the Meson build system

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agotest: Try to create temporary XDG_RUNTIME_DIR with correct mode
Simon McVittie [Thu, 23 Jun 2022 18:44:27 +0000 (19:44 +0100)] 
test: Try to create temporary XDG_RUNTIME_DIR with correct mode

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agodoc: avoid Python injection if filenames contain quotes
Simon McVittie [Fri, 24 Jun 2022 11:15:14 +0000 (12:15 +0100)] 
doc: avoid Python injection if filenames contain quotes

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobuild: Distribute Meson build system in release tarballs
Simon McVittie [Fri, 24 Jun 2022 11:49:32 +0000 (12:49 +0100)] 
build: Distribute Meson build system in release tarballs

As long as we are treating Autotools as a first-class citizen, what we
release will be `make distcheck` output.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobuild: Make the DBUS_MACHINE_UUID_FILE correctly absolute
Simon McVittie [Fri, 24 Jun 2022 11:47:58 +0000 (12:47 +0100)] 
build: Make the DBUS_MACHINE_UUID_FILE correctly absolute

get_option('localstatedir') might be relative.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobuild: Resolve localstatedir, sysconfdir relative to prefix
Simon McVittie [Fri, 24 Jun 2022 11:47:25 +0000 (12:47 +0100)] 
build: Resolve localstatedir, sysconfdir relative to prefix

If the prefix is something like /opt/dbus, then --localstatedir=var
should result in using /opt/dbus/var, and so on. However, if configured
with --localstatedir=/var, then the prefix is ignored.

Meson special-cases these to default to /var and /etc (respectively),
as absolute paths, if the prefix is /usr; so distribution builds will
typically still end up using /var and /etc.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agobuild: Require yelp-build for ducktype docs, not Doxygen docs
Simon McVittie [Fri, 24 Jun 2022 11:19:58 +0000 (12:19 +0100)] 
build: Require yelp-build for ducktype docs, not Doxygen docs

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agodoc: Build Ducktype documentation even if doxygen is not found
Simon McVittie [Fri, 24 Jun 2022 11:16:28 +0000 (12:16 +0100)] 
doc: Build Ducktype documentation even if doxygen is not found

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

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

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

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

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

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