]> git.ipfire.org Git - thirdparty/dbus.git/log
thirdparty/dbus.git
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>
3 years agobuild: Make modular_tests an auto feature
Simon McVittie [Thu, 23 Jun 2022 19:03:47 +0000 (20:03 +0100)] 
build: Make modular_tests an auto feature

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

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

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

This resolves the TODO comment.

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

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

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

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

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

The Meson build system ships it anyway.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years ago.gitignore: Ignore __pycache__ directories anywhere in the tree
Simon McVittie [Mon, 27 Jun 2022 11:42:42 +0000 (12:42 +0100)] 
.gitignore: Ignore __pycache__ directories anywhere in the tree

The Meson build system adds several Python scripts, some of which import
code from other Python scripts, which will result in __pycache__
directories appearing in the source tree.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoREADME: update for meson build-sys
Marc-André Lureau [Wed, 25 May 2022 09:29:40 +0000 (11:29 +0200)] 
README: update for meson build-sys

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

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

spec: Document a recommendation for IDNs in reversed domain names

See merge request dbus/dbus!324

3 years agospec: Document a recommendation for IDNs in reversed domain names
Simon McVittie [Wed, 13 Jul 2022 14:52:39 +0000 (15:52 +0100)] 
spec: Document a recommendation for IDNs in reversed domain names

D-Bus names are in an ASCII subset, so IDNs have to be in their ACE
encoding (Punycode). ACE-encoded labels contain hyphen/minus characters,
and like any other label containing a hyphen/minus, we recommend
replacing those with underscores, to improve interoperability with
contexts that allow underscores but not hyphen/minus, such as
D-Bus object paths and Flatpak app-IDs.

Prompted by <https://github.com/flatpak/flatpak/issues/4974>.

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

CI fixes

See merge request dbus/dbus!323

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

GCC 10.2.0 complains on opensuse mingw builds, ex:
disable-crash-handling.c: error: STABS debugging information is obsolete and not supported anymore [-Werror]

According to
https://gitlab.freedesktop.org/dbus/dbus/-/issues/133#note_129599,
-gdwarf-2 is the second best option.

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

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

Add autolaunch test on Windows

Closes #235

See merge request dbus/dbus!95

3 years agoAdd a test application for autostart on Windows implementation
Ralf Habacker [Wed, 17 Nov 2021 09:51:39 +0000 (10:51 +0100)] 
Add a test application for autostart on Windows implementation

The test application performs several individual tests to detect possible
problems with the autostart support under Windows. Connections are tested
with the standard scope, a 'custom' scope, the 'install path' scope and
the 'user' scope.

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

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

3 years agosysdeps-win: Use the `connection readiness` event when starting dbus-daemon
Ralf Habacker [Mon, 20 Dec 2021 11:34:14 +0000 (12:34 +0100)] 
sysdeps-win: Use the `connection readiness` event when starting dbus-daemon

In _dbus_get_autolaunch_address() instead of polling at intervals to see
if the shared memory segment is present, the named signal is now used to
reliably get the state of dbus-daemon.

In _dbus_get_autolaunch_shm() the unnecessary initialization of `address`
has been removed, error handling has been improved and the `wait` parameter
has been added to select waiting.

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCOPYING: Move full license text into LICENSES/
Simon McVittie [Wed, 18 May 2022 13:01:25 +0000 (14:01 +0100)] 
COPYING: Move full license text into LICENSES/

Having the full text of the AFL-2.1 and GPL in this file makes it harder
to find the unique information, which is the summary. Move their full
text into LICENSES/ (consistent with how REUSE handles this), leaving
a short summary of the licensing situation in COPYING.

Loosely based on work from Ralf Habacker in dbus!304.

Signed-off-by: Simon McVittie <smcv@collabora.com>
3 years agoCOPYING: The project is called dbus, not D-Bus
Simon McVittie [Wed, 18 May 2022 12:59:17 +0000 (13:59 +0100)] 
COPYING: The project is called dbus, not D-Bus

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

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

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

See merge request dbus/dbus!320