Commit graph

6573 commits

Author SHA1 Message Date
Alex Richardson
e2f3f0123c clang-format: add spaces before parens
Previously, clang-format was not adding a space after sizeof.
2022-09-21 11:35:05 +00:00
Simon McVittie
a225a9c41a Merge branch 'fix-freebsd-ci' into 'master'
gitlab-ci: update FreeBSD CI image to 13.1

See merge request dbus/dbus!347
2022-09-21 11:31:43 +00:00
Alex Richardson
93203e9524 gitlab-ci: update FreeBSD CI image to 13.1
FreeBSD 13.0 has reached EOL and it appears packages
are built against a newer baseline now, so we end up
with missing symbol errors:
ld-elf.so.1: /lib/libc.so.7: version FBSD_1.7 required by /usr/local/lib/libpython3.9.so.1.0 not found

It also appears that the fdpass test still fails on 13.1, so update the
condition to less than 14.0
2022-09-21 09:01:56 +00:00
Simon McVittie
546617d23c Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-09-19 10:45:01 +01:00
Simon McVittie
1c53a181ee Merge branch 'test-socket-dir' into 'master'
test: Use DBUS_TEST_SOCKET_DIR to create the test socket

See merge request dbus/dbus!334
2022-09-15 19:13:21 +00:00
Alex Richardson
e1ff3c09d7 test: Use DBUS_TEST_SOCKET_DIR to create the test socket
I am trying to run cross-compiled tests in QEMU with the build directory
mounted via smbfs, and therefore creating the sockets in the CWD does not
work. Using DBUS_TEST_SOCKET_DIR (/tmp by default) allows me to run the
tests successfully.
2022-09-15 18:58:20 +00:00
Alex Richardson
3b605a5a6d cmake: define DBUS_TEST_SOCKET_DIR in the config header
This matches autotools.
2022-09-15 18:22:49 +00:00
Alex Richardson
feff0333d5 meson: define DBUS_TEST_SOCKET_DIR in the config header
This matches autotools
2022-09-15 18:22:49 +00:00
Simon McVittie
6c9b4846b9 Merge branch 'mempool-flex-array-followup' into 'master'
mempool: Require C99 flexible arrays

See merge request dbus/dbus!344
2022-09-15 17:02:35 +00:00
Simon McVittie
57c9f99d78 mempool: Require C99 flexible arrays
dbus 1.15.x officially requires C99, so we can do this unconditionally
on the 1.15.x branch.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-09-15 16:46:59 +00:00
Simon McVittie
e2f7256bbe Merge branch 'mempool-flex-array' into 'master'
dbus-mempool: Use flexible or zero-length arrays if possible

See merge request dbus/dbus!343
2022-09-15 16:46:46 +00:00
Simon McVittie
374087124c dbus-mempool: Use flexible or zero-length arrays if possible
If the elements field has a fixed nonzero size, accessing elements
beyond that size is technically undefined behaviour, which is caught
by some options of the undefined behaviour sanitizer. Try to use a C99
flexible array, or failing that, a zero-length array (which is a popular
non-standard syntax to achieve the same thing).

dbus 1.15.x has C99 as a requirement, but this commit avoids assuming
C99 in order to make this change backportable to 1.14.x if it becomes
necessary to do so (for example to be able to run tests or fuzzers
against 1.14.x, or if compilers' defaults become more strict).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-09-15 15:26:58 +01:00
Simon McVittie
2ea6bdcab8 Update NEWS for 1.15.x branch
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-09-12 21:45:50 +01:00
Simon McVittie
9127b8ffa5 Merge branch 'msys2-packages' into 'master'
CI: Don't pin msys2 packages to a specific version at all

See merge request dbus/dbus!338
2022-09-12 19:19:49 +00:00
Simon McVittie
bb38fb361e CI: Don't pin msys2 packages to a specific version at all
Similar to dbus/dbus!286, but more so: just use the package names,
ignoring their version numbers completely.

pcre2 is not strictly needed at the moment, but it'll be a dependency
for GLib >= 2.73.x (older versions used pcre). For a bit of
future-proofing, download both pcre and pcre2.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-09-12 20:01:50 +01:00
Simon McVittie
9f9a01b1da Merge branch 'windows-no-tap' into 'master'
TAP-related workarounds in Meson build system

Closes #414

See merge request dbus/dbus!340
2022-09-12 19:00:27 +00:00
Simon McVittie
52a8adf901 test: Don't use strict TAP parsing on Windows
Debug messages in a background thread can corrupt the machine-readable
TAP output, and in particular GWin32AppInfo emits debug messages from
a background thread when we link to libgio.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/414
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-09-12 19:36:16 +01:00
Simon McVittie
c9d0f7968f build: Only work around Meson 0.63.0 bugs for version 0.63.0
mesonbuild/meson#10577 was fixed in 0.63.1.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-09-12 19:23:54 +01:00
Simon McVittie
031c2b1332 Merge branch 'fix/412' into 'master'
_dbus_message_iter_append_check: Fix ifdef check

Closes #412

See merge request dbus/dbus!336
2022-08-18 13:25:16 +00:00
Johannes Kauffmann
eb195d70d0 _dbus_message_iter_append_check: Fix ifdef check
With internal DBus checks disabled, but with assertions enabled, the
function would be ifdef'ed out. This is problematic, since the function
is called from within an assertion statement in _dbus_variant_write().

Fixes #412.

Co-authored-by: Simon McVittie <smcv@collabora.com>
2022-08-18 12:34:24 +00:00
Simon McVittie
7e0c51d800 Merge branch 'add-freebsd-ci' into 'master'
Add a FreeBSD CI job

See merge request dbus/dbus!280
2022-08-10 11:33:11 +00:00
Alex Richardson
468cc3e8ba Update NEWS to mention FreeBSD CI 2022-08-10 11:18:20 +00:00
Alex Richardson
31fd3822c3 Add myself to AUTHORS 2022-08-10 11:18:20 +00:00
Alex Richardson
82d5ee848d gitlab-ci: Add a FreeBSD meson job
Also bump the FDO_DISTRIBUTION_TAG to ensure the disk images
include meson.
2022-08-10 11:18:20 +00:00
Alex Richardson
ee880ef811 tools/ci-install.sh: Install meson build dependencies on FreeBSD
Python is already installed, but we need the python3 package to get the
/usr/local/bin/python3 symlink rather than the one with the version suffix.
2022-08-10 11:18:20 +00:00
Alex Richardson
932b740826 test/fdpass.c: skip test that fails on FreeBSD 13.0
The /odd-limit/at test passes on 13.1 and 14.0 images, but fails on 13.1.
Debugging has not given me any useful hints why this may be the case, so
disable this test on 13.0 for now.

This allows us to drop the ci_test_fatal: "no" override which will ensure
that any FreeBSD regressions are caught.
2022-08-10 11:18:20 +00:00
Alex Richardson
1378e8e37e gitlab-ci: Add a FreeBSD autotools CI job
Now that the underlying issues with FreeBSD autotools CI have been fixed,
we can add a CI job to prevent future regressions.
2022-08-10 11:18:20 +00:00
Alex Richardson
db441d3017 ci-build.sh: Add a autotools ci_variant without the docs archive
This is needed to add autotools support to the FreeBSD CI since we don't
include all the packages needed to build dbus-docs.tar.xz.
2022-08-10 11:18:20 +00:00
Alex Richardson
2659a0f18e gitlab-ci: Use GNU make on FreeBSD
The Makefile.am files contain % pattern rules that are not supported by
`make` (bmake) on FreeBSD. Since the replacing the patterns is non-trivial,
this commit updates the CI script to use GNU make when building on FreeBSD.
2022-08-10 11:18:20 +00:00
Alex Richardson
defbade7b9 gitlab-ci: Don't use sudo for the FreeBSD job
We are already building as root and sudo is not currently installed on
the CI image, so the autotools build fails without this change.
2022-08-10 11:18:20 +00:00
Alex Richardson
902260f6da gitlab-ci: Install pkg-config on FreeBSD
Without this change the autotools build system fails to find glib and
reports an error. The CMake build worked prior to this change since CMake
has fallback logic to find glib even without pkg-config.
2022-08-10 11:18:20 +00:00
Alex Richardson
d67132d3d0 gitlab-ci: Add a FreeBSD CMake CI job
This uses https://gitlab.freedesktop.org/freedesktop/ci-templates,
and runs the FreeBSD build+test inside a QEMU VM.
This depends on the recently merged ci-templates MR
https://gitlab.freedesktop.org/freedesktop/ci-templates/-/merge_requests/142,
so we bump the required ci-templates commit hash.

There is one undiagnosed failure in test-fdpass that needs investigation,
so for now failures are permitted. Autotools and meson jobs will be added
in follow-up commits.
2022-08-10 11:18:20 +00:00
Alex Richardson
a214ed824d dbus-sysdeps-util-unix.c: Avoid including sys/syslimits.h
This header is GCC specific header that on my system just contains
`#include_next <limits.h>`. FreeBSD also provides this header but it
contains a `#warning` that it should not be used. Replace the one use
with `#include <limit.h>` and drop the configure checks.
2022-08-10 11:18:20 +00:00
Alex Richardson
82f5c96644 cmake: Always try to find pkg-config
Commit 97bdefd4e2 move the
include(FindPkgConfig) call into a Linux-specific codepath, so pkg-config
was not being detected on FreeBSD. This mean that the check for
PKG_CONFIG_FOUND to determine whether to install .pc files later on
would always fail and .pc files were not installed on FreeBSD.
2022-08-10 11:18:20 +00:00
Alex Richardson
7ca69a9785 dbus-launch-x11.c: Silence clang -Wcast-align warning
In this case the cast is safe since the manual guarantees that the
underlying storage is an array of `long`.
2022-08-10 11:18:20 +00:00
Alex Richardson
aec2ad7efb test-utils-glibc.c: Fix -Werror,-Wmissing-noreturn on FreeBSD
Add a conditional _DBUS_GNUC_NORETURN to avoid
`error: function 'back_to_root' could be declared with attribute 'noreturn'`
2022-08-10 11:18:20 +00:00
Alex Richardson
cf51eeb555 test-utils-glib.c: Avoid using a non-portable errno value
ENODATA is not available on FreeBSD. Since the actual errno value here
does not matter, use EPERM instead.
This fixes the DBus build on FreeBSD.
2022-08-10 11:18:20 +00:00
Alex Richardson
a7fe9438c4 dbus-sysdeps-unix.c: Fix unused function warning on FreeBSD
The function close_ignore_error() is only used in some cases. To avoid
duplicating the #ifdef condition, this patch moves the check just before
the definition of _dbus_close_all().
2022-08-10 11:18:20 +00:00
Alex Richardson
aa90d09940 tools/ci-build.sh: Ensure that $builddir is set
When adding the new FreeBSD CI, this was not implicitly forwarded to QEMU,
so the build script failed with confusing errors. Add an explicit check
that the variable is set to make those cases easier to debug.
2022-08-10 11:18:20 +00:00
Alex Richardson
ca091e78d3 tools/ci-install.sh: Add FreeBSD support
This adds support for installing the required packages on FreeBSD.
2022-08-10 11:18:20 +00:00
Alex Richardson
295912045e tools/ci-{build,install}.sh: Use a portable interpreter argument
FreeBSD has bash installed as /usr/local/bin/bash, so hardcoding /bin/bash
does not work. Instead use the portable replacement using env which will
find bash in $PATH.
2022-08-10 11:18:20 +00:00
Simon McVittie
17db7f268a Merge branch 'cxx-only-on-windows' into 'master'
meson: Only require C++ compiler when building for Windows

See merge request dbus/dbus!333
2022-08-10 10:38:26 +00:00
Simon McVittie
bc24596886 meson: Only require C++ compiler when building for Windows
dbus is generally a C-only project, but the Windows side has a tiny
amount of C++ to initialize global locks (because Windows doesn't have
a direct equivalent of PTHREAD_MUTEX_INITIALIZER). We don't need a C++
compiler when building for a non-Windows OS, so there's no need to
find it or check which options it supports.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-26 17:08:56 +00:00
Simon McVittie
72d0a79eba NEWS: Update Dependencies section
dbus!332 increased the CMake dependency.

The Meson build system is new, but it seems reasonable to mention the
new (optional) dependencies at top level.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-26 11:37:28 +01:00
Ralf Habacker
697aae005a Merge branch 'cmake-current-source-dir' into 'master'
cmake: Fix top-level directory references when vendored into a larger project

See merge request dbus/dbus!332
2022-07-26 04:31:13 +00:00
Jordan Williams
625366dd0e
Update NEWS 2022-07-25 14:14:57 -05:00
Jordan Williams
e62e42f84c
Add name to AUTHORS 2022-07-25 14:14:57 -05:00
Jordan Williams
fac146f44d
Use project relative paths in CMake files
This makes it possible for projects to incorporate D-Bus as a CMake sub-project in a larger CMake project.
Before this PR, doing so would result in many errors.
This is because CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR would point to directories above the D-Bus project.
Using paths relative to the project directory, PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR, corrects for this.
2022-07-25 14:14:57 -05:00
Jordan Williams
ad5836cb0d
Bump CMake version to 3.4
With the minimum version set to 3.4, none of the policies need to be set explicitly to the `NEW` behavior.
Each of the policies removed here was introduced before CMake version 3.4.
By default then, each of them will be set to NEW automatically.
This is part of the behavior of cmake_minimum_required.
The cmake_policy commands are therefore redundant and have been removed.
2022-07-25 14:14:56 -05:00
Simon McVittie
8e0290fcc8 release-checklist: Add a reminder to update both Autotools and Meson
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-23 11:23:06 +01:00