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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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.
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.
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>