Commit graph

436 commits

Author SHA1 Message Date
Simon McVittie
1477ca5035 build: Introduce ${runstatedir} and use it for the pid file
By default ${runstatedir} is the same as ${localstatedir}/run, but many
Linux distributions configure it to be /run and mount a tmpfs in that
location. All other factors being equal, it is preferable to use /run
where available because it is guaranteed to be local, whereas traversing
/var might involve automounting a networked filesystem (even though
/var/run itself is very likely to be a tmpfs).

/run or /var/run is currently only used in a few places in dbus, but
I plan to make more use of it during the development of
<https://bugs.freedesktop.org/show_bug.cgi?id=100344>.

The pid file is not part of the API between dbus and other software
(other than distribution init scripts for dbus itself), so we do not
need to keep it strictly compatible; so it is OK to move it.

We do not yet use /run for the system bus socket, because that is
part of the API between D-Bus clients and servers, and has always been
"officially" /var/run/dbus/system_bus_socket.
<https://bugs.freedesktop.org/show_bug.cgi?id=101628> tracks the
possibility of changing that.

Similarly, we do not replace /var/run/console with /run/console, because
that path is part of the API between dbus-daemon and the obsolete PAM
modules pam_console and pam_foreground that used /var/run/console.
<https://bugs.freedesktop.org/show_bug.cgi?id=101629> tracks the possible
future removal of that code path.

In the CMake build system, the equivalent of ${runstatedir} remains
hard-coded to the equivalent of ${localstatedir}/run for simplicity. For
the sort of system-wide installations that would consider redefining
${runstatedir} to /run, the Autotools build system is strongly
recommended: in particular this is what Linux distributions are expected
to use.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101569
2017-06-30 10:51:14 +01:00
Simon McVittie
77f4f5c53e Start 1.11.16 development
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-06-29 22:37:04 +01:00
Simon McVittie
f0079c312b 1.11.14
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-06-29 18:20:01 +01:00
Simon McVittie
ae7568face Install a systemd tmpfiles.d snippet to create /var/lib/dbus/machine-id
On systemd systems, /etc/machine-id is guaranteed to exist and has
the same format as the D-Bus machine ID. The major D-Bus implementations
read /etc/machine-id if it exists, but some less up-to-date
implementations still only read /var/lib/dbus/machine-id. We can be
nice to those implementations by ensuring /var/lib/dbus/machine-id
is a symlink; this way, the two files can never get out of sync.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101570
2017-06-28 19:09:53 +01:00
Simon McVittie
6ffec5ef16 Opt-in to deprecation warnings for GLib 2.38 and 2.40
Now that g_test_trap_fork() has gone, we no longer have any calls to
GLib functions deprecated in or before 2.40.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101362
2017-06-12 11:42:38 +01:00
Simon McVittie
8821af59c8 Bump GLib dependency for tests to 2.40
This is quite old (it's the version in Ubuntu 14.04 LTS, and older
than the version in Debian 8) but gives us g_test_skip(),
g_test_trap_subprocess() and GVariantDict, all of which will be
useful in the regression tests.

Remove workarounds for old versions.

After this commit we are still using the deprecated g_test_trap_fork(),
which will be removed in a subsequent commit. Don't opt-in to the new
deprecation warnings from 2.38 and 2.40 yet, because under our recommended
settings for dbus developers (-Werror) they would break the build.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101362
2017-06-12 11:40:18 +01:00
Laurent Bigonville
d8ad72ccb9 configure.ac: Drop check for selinux/av_permissions.h
selinux/av_permissions.h is deprecated and is not even used in the code
since commit ba088208bc, in 2013.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100912
Reviewed-by: Simon McVittie <smcv@collabora.com>
2017-05-31 13:40:19 +01:00
Laurent Bigonville
89419e0a8c Remove calls to sidget/sidput
sidget and sidput functions are noop and deprecated since libselinux 2.0.86.

Also use pkg-config to detect libselinux and force version >= 2.0.86

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100912
Reviewed-by: Simon McVittie <smcv@collabora.com>
2017-05-31 13:39:29 +01:00
Simon McVittie
36fcd43005 Pass in DBUS_TEST_EXEC via environment, not hard-coded into binaries
This avoids "capturing" the build directory in the built binaries
when built with embedded tests, which is good for reproducible builds.
See <https://reproducible-builds.org/> for more information.

Signed-off-by: Simon McVittie <smcv@debian.org>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100692
2017-04-18 17:20:30 +01:00
Simon McVittie
54c81ee9e8 Autotools build: Use pkg-config to find libexpat
The version of expat that added the .pc file was released in 2012.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69801
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2017-04-10 12:40:19 +01:00
Simon McVittie
fa2f000a66 Start towards 1.11.14 2017-04-07 18:56:39 +01:00
Simon McVittie
7b35fdcc4b 1.11.12 2017-04-07 16:00:16 +01:00
Simon McVittie
d3ac2cece7 Stop opting out of -Wswitch-enum and -Wswitch-default
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
2017-04-07 14:02:52 +01:00
Simon McVittie
30497f854b autotools: Allow relocatable pkg-config metadata on an opt-in basis
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99721
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-03-20 14:37:27 +00:00
Ralf Habacker
d160c1a71a cmake, autotools: Add find package config support for cmake clients
With this support cmake and autotools generates cmake equivalent of
pkgconfig files on configure time named DBus1Config*.cmake. These
files are installed into the related directory where cmake expects
find_package related config files.

For instructions how to use this feature with clients see readme.cmake.

With previous DBus versions each cmake client using DBus as dependency
needed a related FindDBus*.cmake in its source distribution or in
the cmake binary packages. With the 'config' find package style support
provided by this patch this requirement has been removed.

The generated config file uses pkgconfig on unix or autotools to
fetch package build flags, which is the prefered way. On Windows
we do not want to require CMake users to have pkg-config installed
so it uses cmake buildin target export support for exporting all
targets into DBus1ConfigTargets*.cmake.

[smcv: make sure variable substitution works in Autotools too]

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99721
Reviewed-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-03-20 14:18:45 +00:00
Ralf Habacker
216627825d cmake: Optionally create relocatable dbus-1.pc file
Relocatable pkgconfig files are necessary when using packages installed to
a location that does not match the location for which they were compiled.

However, using ${pcfiledir} is problematic for system installations
in standard locations, because it interferes with pkg-config's
ability to filter out -I, -L options that are redundant with compiler
defaults (which is important if you are trying to use a newer version
of a library than the system copy).

In practice operating system vendors installing dbus to standard
locations use Autotools, so we enable relocatable builds by default
when building with CMake.

For simplicity, we're also not relocatable if the library directory
is something more complicated than lib or lib64 (e.g. under Debian
multiarch); we don't want to have to compute how many ../ to add.
This is non-trivial to determine in an Autotools build, so for now
there is no support for relocation when built with Autotools,
even as an opt-in feature.

Going via the ${original_prefix} variable is because under Autotools,
both ${prefix} and ${exec_prefix} technically default to NONE, with
NONE replaced with their real defaults of /usr/local and '${prefix}'
(respectively) later on. If we tried to expand ${prefix} at the time
that we choose the value of ${pkgconfig_prefix}, that would cause
a broken value "prefix=NONE" to be hard-coded.

[smcv: no relocation on Autotools, make it optional in CMake,
expand commit message]

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99721
Reviewed-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-03-20 14:14:42 +00:00
Simon McVittie
b031874106 Start towards 1.11.12 2017-02-16 22:28:55 +00:00
Simon McVittie
2918f6b129 Prepare 1.11.10
Signed-off-by: Simon McVittie <smcv@debian.org>
2017-02-16 16:35:06 +00:00
Lennart Poettering
e8617fbd27 systemd: add sysusers.d snippet for booting up with unpopulated /etc
This adds a "sysusers.d" snippet for creating the system user "dbus" at
boot, if it is missing, in order to support stateless systems that boot
up with an empty /etc and need static information for determining which
system users to create.

This is only installed on systemd-based systems.

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99162
2017-02-13 14:49:52 +00:00
Simon McVittie
6dd92fd825 Don't test AppArmor mediation of activation if libapparmor < 2.10
We need libapparmor 2.10 for the test, but not for the actual
functionality, for which 2.8.95 is enough. In particular this lets
us compile with AppArmor enabled on Ubuntu 14.04, which is still
the newest host platform available on travis-ci.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98666
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
2016-11-29 12:31:52 +00:00
Simon McVittie
c64db84836 Start towards 1.11.10
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-11-29 12:31:23 +00:00
Simon McVittie
c45454668b dbus 1.11.8 and D-Bus Specification 0.30
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-11-28 20:25:35 +00:00
Simon McVittie
80654389f8 Add an integration test for AppArmor mediating activation
This requires libapparmor 2.10, for aa_features_new_from_kernel()
and related functions.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98666
2016-11-28 12:11:52 +00:00
Simon McVittie
f745d59bc1 Merge branch 'dbus-1.10' 2016-11-22 20:08:22 +00:00
Simon McVittie
97802948f5 NEWS
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-11-22 20:06:36 +00:00
Simon McVittie
5a1dcca8bf Don't test X11 autolaunching if it was disabled at compile time
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98665
2016-11-22 19:27:43 +00:00
Simon McVittie
b2d1471172 Configure the compiler to suggest useful function attributes
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-10-13 22:44:33 +01:00
Thomas Zimmermann
003e5e6847 Test compiler and linker flags with AX_COMPILER_FLAGS_* macros
The autoconf macros AX_COMPILER_FLAGS_{CFLAGS|CXXFLAGS|LDFLAGS} test
for compiler and linker support of various flags, and add the flags to
the generated output.

If the command-line option '--enable-compile-warnings' is specified to
'configure', a number of additional warning options is also added to the
output. This is the default.

The AX_COMPILER_FLAGS_* macros add stricter warnings then before. The
patch disables some of them to make dbus build without errors. A later
patch set should fix the warnings and remove the compiler flags.

This patch integrates all tests for compiler flags into the call to
AX_COMPILER_FLAGS_CFLAGS. All tests for compiler flags are now done
in a single place. The old macros have been removed.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
[smcv: add missing $ to DISABLE_WARNINGS]
[smcv: drop -Wno-discarded-qualifiers]
[smcv: drop non-C++ option -Wpointer-sign in C++ mode]
[smcv: work around an AX_COMPILER_FLAGS_CFLAGS bug]
[smcv: this source tree is called dbus, not DBus]
Signed-off-by: Simon McVittie <smcv@debian.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97357
2016-10-13 17:20:42 +01:00
Simon McVittie
91ae697d41 Clean up how we arrange for environ to be declared
Annoyingly, the POSIX way to declare environ (as
"extern char **environ") is a redundant declaration in glibc with
_GNU_SOURCE; work around that.

We also have a workaround for _NSGetEnviron() needing to be used
instead of direct access to environ in at least some circumstances on
Mac OS. Attempt to sync that up between all the files that use environ,
consistently sorting the most special special-cases first (Windows
for files that are compiled there, then Mac, then GNU, with
lowest-common-denominator POSIX last).

The affected files are already OS-specific, so I'm not bothering to
introduce a nicer or higher-level API for this.

Based on the best bits of an earlier patch from me, and an earlier
patch from Thomas Zimmermann.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97357
2016-10-13 17:20:34 +01:00
Simon McVittie
cc7df2fbf9 Remove now-misleading comment
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-10-10 20:50:28 +01:00
Simon McVittie
06cd2ade51 Enable the same warnings when targeting Windows as for Unix
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-10-10 18:16:16 +01:00
Simon McVittie
f678f23be2 Enable some more compiler warnings
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98192
2016-10-10 18:15:32 +01:00
Thomas Zimmermann
3c7c840f80 Remove configure option '--disable-compiler-optimisations'
This path removes the obsolete configure option
'--disable-compiler-optimisations'. Users can control compiler flags
by setting CFLAGS, CXXFLAGS, etc in the build environment.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Reviewed-by: Simon McVittie <smcv@debian.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97357
2016-10-10 15:09:59 +01:00
Thomas Zimmermann
85b520ab8f Add configure option '--enable-debug' to control debugging and profiling
The command-line option '--enable-debug' controls the debugging and
profiling flags of the build. Debugging is disabled by default and only
enabled on developer builds. Profiling is always disabled. Both options
can be overridden from the command line (e.g., for profiling of release
builds).

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
[smcv: remove trailing whitespace from new lines]
Reviewed-by: Simon McVittie <smcv@debian.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97357
2016-10-10 15:09:25 +01:00
Simon McVittie
866ff0e926 Start towards 1.11.8
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-10-10 15:09:09 +01:00
Simon McVittie
655b3e613c Release 1.11.6 and spec 0.29
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-10-10 10:19:54 +01:00
Simon McVittie
44bc193efb 1.10.12 2016-10-10 10:19:44 +01:00
Simon McVittie
88e0ccb2d3 Disable deprecation warnings for stable branch
We're not going to replace deprecated functions here.

Signed-off-by: Simon McVittie <smcv@debian.org>
Reviewed-by: Colin Walters <walters@verbum.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98157
2016-10-10 10:06:26 +01:00
Simon McVittie
a363822f5f dbus-daemon test: exercise pending fd timeout test
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-08-16 18:27:43 +01:00
Simon McVittie
b08487d482 1.11.5 2016-08-16 00:21:48 +01:00
Simon McVittie
0ffa8fd4e8 1.10.11 2016-08-15 23:31:18 +01:00
Simon McVittie
b25d78a16d 1.11.4 2016-08-15 21:44:06 +01:00
Simon McVittie
640c5ad853 1.10.10
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-08-15 19:59:18 +01:00
Simon McVittie
2ec7c67b16 Document use of AX_CODE_COVERAGE
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-08-15 14:31:44 +01:00
Thomas Zimmermann
be04ba8354 Use AX_CODE_COVERAGE for test-coverage statistics
DBus uses custom rules in its Makefiles to implement test-coverage
statistics.

This patch implements test-coverage statistics with the autoconf macro
AX_CODE_COVERAGE. The script automatically tests for tools (e.g., gcov,
lcov), sets build variables and creates Makefile rules.

Run 'configure' with '--enable-code-coverage' to enable support for
test-coverage statistics. Run 'make check-code-coverage' to run the
tests and generate the statistics.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
[smcv: do not alter compiler.m4; move AM_CXXFLAGS to the one place we
compile C++]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88922
2016-08-15 14:30:51 +01:00
Simon McVittie
8c24df0ba0 Merge branch 'dbus-1.10' 2016-07-29 19:15:21 +01:00
Ioan-Adrian Ratiu
1bfde22292 configure.ac: explicitely check stdint.h
Otherwise HAVE_STDINT_H will not be defined or the var will not be
picked up from cache so builds could fail with errors like:
| ../../dbus-1.10.8/dbus/dbus-internals.h:239:8: error: ‘uintptr_t’ undeclared (first use in this function)

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
[smcv: fix Autoconf underquoting]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-07-29 19:12:59 +01:00
Simon McVittie
0621b5790e 1.11.3 2016-03-07 20:54:05 +00:00
Simon McVittie
4e06dcf35b 1.11.2 2016-03-07 19:36:01 +00:00
Simon McVittie
ffa99f343d 1.10.9 2016-03-07 19:31:52 +00:00