Commit graph

6438 commits

Author SHA1 Message Date
Simon McVittie
0dac45dce2 CI: Explicitly enable wrap dependencies
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
f49791ec99 CI: Tell Meson build where to find the source directory
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
cceffebed3 CI: Implement debug build variant for Meson
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
14bfd498c6 CI: Explicitly disable features that can't work on Windows
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
c21d47836c CI: Add glue to build with mingw-w64 toolchain on Debian
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
da94d0c029 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
5eee2d552a 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
600926adce 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
aaf0be63bd CI: Collect all Meson logs, not just the test log
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
be17ca80fe 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
1e5badb071 CI: Reinstate mingw*-glib2-devel
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
c9c2ed8ebf CI: Use mingw32-meson if that's what we're targeting
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Marc-André Lureau
07ddd3597e Add meson build CI
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
60a88f360c 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
5d3756f6fb meson: Create /var/lib/dbus
This holds the machine ID created by dbus-uuidgen.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
cfa56a666c 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>
2022-07-13 20:36:13 +01:00
Marc-André Lureau
9016b48cf9 cmake: drop DBUS_VERBOSE_C_S
Apparently, not used anywhere.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-07-13 20:36:13 +01:00
Marc-André Lureau
a5c8dda5cf cmake: drop unused HAVE_VASPRINTF/HAVE_VSNPRINTF checks
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-07-13 20:36:13 +01:00
Marc-André Lureau
95df73b463 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>
2022-07-13 20:36:13 +01:00
Marc-André Lureau
f0a4d92490 cmake: drop needless headers checks
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-07-13 20:36:13 +01:00
Marc-André Lureau
e986c2b5b6 meson: add missing header checks
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-07-13 20:36:13 +01:00
Marc-André Lureau
ffc063a95c 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>
2022-07-13 20:36:13 +01:00
Marc-André Lureau
f893b86e52 autotools: dist listen-autolaunch-win.conf.in as well
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-07-13 20:36:13 +01:00
Marc-André Lureau
9aa751f59e meson: add test-autolaunch-win
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
ac9d36836e 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
9215dbea53 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
64e490afe7 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
154cc9d5ca meson: Add GLib version macros
This helps to avoid unintended dependencies on newer versions of GLib.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
6a4835e627 meson: Define HAVE_GIO_UNIX
Some of the tests check for this.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
17e12ccfb0 meson: Check for LOG_PERROR
We use this when writing to the system log.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
d78d742f41 meson: Check for environ declaration
We use this in various places.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
35eca11708 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
ec3edd80a6 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
4f966cc1b4 meson: Don't check for dirfd
We never actually look at HAVE_DIRFD.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
9c9fae18dd 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
09ebed95ea 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
b228b478a4 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
64711328ec 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
1dc8cf5875 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
6f6fd74a31 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
6eefa5da34 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
398820d1fe 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
e2f2c5dd42 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
abef795081 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
47deeb4a9e 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
b47263d0ab bus: Install example systemd hardening when using Meson
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
08348e9e46 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
c74504fb7e 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>
2022-07-13 20:36:13 +01:00
Simon McVittie
29ae675978 doc: Write absolute path to DTDS into XML catalog
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
77312171b9 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>
2022-07-13 20:36:13 +01:00