Commit graph

5516 commits

Author SHA1 Message Date
Ralf Habacker
f679669505 Merge branch '117-checks-from-configure-ac' into 'master'
Take cmake checks from configure.ac

See merge request dbus/dbus!18
2018-10-24 17:01:52 +00:00
Ralf Habacker
7bba42587b Remove todo(s) for cmake build system
Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/18
2018-10-24 10:03:30 +02:00
Ralf Habacker
fd00c5fdef Add cmake support for HAVE_GNUC_VARARGS and HAVE_ISO_VARARGS
Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/18
2018-10-24 10:03:30 +02:00
Ralf Habacker
72b0aebb6e Add cmake check for HAVE_DDFD
Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/18
2018-10-24 10:03:30 +02:00
Ralf Habacker
ba8a5e509c Add cmake check for HAVE_DIRFD
Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/18
2018-10-24 10:03:30 +02:00
Ralf Habacker
6c95c7e395 Add cmake check for DBUS_USE_SYNC
Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/18
2018-10-24 10:03:30 +02:00
Ralf Habacker
bd6ece893a Refactor cmake checks for DBUS_VA_COPY and DBUS_VA_COPY_ARRAY
For test case execution, CheckCSourceCompiles is now used instead
of try_compile and the determination of DBUS_VA_AS_ARRAY is
performed with a separate test instead of evaluating the result
of HAVE_VA_COPY and HAVE___VA_COPY.

The tests are performed for all supported compilers. Since older
MSVC compilers (< 2013) do not support va_copy(), the macro
_DBUS_VA_ASSIGN(a1,a2) with the implementation { a1 = a2; } is used
as a fallback.

Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/18
2018-10-24 10:03:30 +02:00
Ralf Habacker
2934dedd1c Add cmake support for DBUS_HAVE_LINUX_EPOLL
Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/18
2018-10-24 10:03:29 +02:00
Ralf Habacker
9455d3542a Use same name for DBUS_HAVE_LINUX_EPOLL cpp macro and Automake conditional
Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/18
2018-10-24 10:03:29 +02:00
Simon McVittie
c9d3bf5f3f Merge branch 'pending-fd-timeout' into 'master'
dbus-daemon test: Allow much longer for pending fd timeout

Reviewed-by: rhabacker
See merge request dbus/dbus!26
2018-10-23 19:21:58 +00:00
Simon McVittie
20e6eb7cd1 dbus-daemon test: Allow much longer for pending fd timeout
The timeout we're using here is 0.5s (500ms), but the actual time taken
is unbounded, because the OS scheduler might not schedule our process
for an arbitrary length of time after we become runnable.

We previously allowed up to 1 second, but in the CI jobs for dbus!9
and dbus!18 we've seen this take up to 3.4 seconds (presumably
because other tests, or other jobs running on the same shared
infrastructure, starved this process). Allow up to 10 seconds to guard
against spurious failures.

The timeout used in the production system.conf is 150 seconds (2½
minutes), and we're only using the shorter 500ms timeout here to make
the test complete more quickly, so ±10 seconds is relatively
insignificant: the main thing is that it's finite.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-23 18:46:12 +00:00
Simon McVittie
f396011354 Merge branch 'broken-poll' into 'master'
build: Never use poll() on Darwin family (macOS, etc.) or Interix

Closes: #232
Reviewed-by: @rhabacker
See merge request dbus/dbus!19
2018-10-22 21:32:48 +00:00
Simon McVittie
0414ea65ca build: Never use poll() on Darwin family (macOS, etc.) or Interix
Doing a runtime check in configure.ac (AC_RUN_IFELSE) has several
disadvantages:

* It doesn't work when cross-compiling. For example, if we build macOS
  binaries on a Linux system, we'd assume that poll() works, but in
  fact it won't.

* It checks the build system capabilities, but that is not necessarily
  appropriate if (for example) a macOS 10.10 user builds binaries that
  could be used by macOS 10.12 or macOS 10.9 users.

* It checks for one specific failure mode, but macOS seems to have a
  history of various implementation issues in poll().

* If we want it to work in CMake, we have to duplicate it in the CMake
  build system.

None of these is a showstopper on its own, but the combination of all
of them makes the current approach to avoiding the broken poll() on
macOS look unreliable. libcurl, a widely-portable library making
extensive use of sockets, specifically doesn't use poll() on Darwin
(macOS, iOS, etc.) or on Interix; let's follow their example here.

See also https://bugzilla.gnome.org/show_bug.cgi?id=302672 and
https://daniel.haxx.se/blog/2016/10/11/poll-on-mac-10-12-is-broken/
for some relevant history.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: https://gitlab.freedesktop.org/dbus/dbus/issues/232
2018-10-22 16:45:33 +00:00
Simon McVittie
86ae83d468 NEWS: Note cmake fixes that might be cherry-picked to dbus-1.12
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-22 15:17:15 +01:00
Ralf Habacker
8cd1c21552 cmake: Fix incorrect header list separator in configure checks
CMake expects a semicolon-separated list of headers, not a
space-separated list. In particular, this meant we failed to detect
getpwnam_r() on Linux, and fell back to getpwnam().

Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-10-22 14:58:26 +01:00
Simon McVittie
3ec1359d4c Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-22 12:59:05 +01:00
Simon McVittie
30141d0bd3 Update bug reporting URLs to use freedesktop.org Gitlab
The README change reuses text from CONTRIBUTING.md.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-22 12:47:53 +01:00
Simon McVittie
e18475c6fc ci: Clarify why we are running autogen.sh even for CMake builds
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-22 12:43:49 +01:00
Ralf Habacker
195c843b7b cmake: Add comment to configure checks explaining why we are not specifying HAVE_SOCKLEN_T
Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/117
Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-10-20 13:53:52 +02:00
Ralf Habacker
ae728666d5 Move DBUS_USE_OUTPUT_DEBUG_STRING to config.h.cmake
Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/117
Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-10-20 13:53:45 +02:00
Ralf Habacker
6c761bdfff tools/ci-build.sh: Add a note why we are running autogen.sh also on cmake builds
Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/117
Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-10-20 13:53:33 +02:00
Ralf Habacker
1be81295c3 Remove duplicated HAVE_CONFIG_H definition in cmake build system
Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/117
Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-10-20 13:53:29 +02:00
Ralf Habacker
e70b4213f6 Add missing setup of DBUS_BUS_ENABLE_INOTIFY
Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/117
Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-10-20 13:53:14 +02:00
Ralf Habacker
c0bfd55938 Move DBUS_ENABLE_EMBEDDED_TESTS and BUS_ENABLE_MODULAR_TESTS to config.h.cmake
Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/117
Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-10-20 13:53:01 +02:00
Ralf Habacker
6978c1192c Keep macro values in config.h.cmake synchronized with Autotools
Autotools sets the value of HAVE_xxx macros in config.h to 1 if
the corresponding value exists. This has not been used consistently
in config.h.cmake so far.

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/117
Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-10-20 13:52:46 +02:00
Ralf Habacker
c174a8e886 configure.ac: Remove unused HAVE_V*PRINTF macros
The corresponding functions are used unconditionally.

Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-10-19 12:50:31 +01:00
Simon McVittie
401b8e5dd8 Merge branch 'desktop-sections' into 'master'
Parse desktop file section names more like the Desktop Entry specification

Closes #208

See merge request dbus/dbus!17

Reviewed-by: David King (@amigadave)
2018-10-19 11:26:31 +00:00
Simon McVittie
4b46e9cb0f desktop-file: Treat backslashes in section names as literal
The Desktop Entry Specification doesn't give any special meaning to
backslashes in section names: a line "[\n]" starts a section whose
name is the two characters (backslash, n), not a section whose name
is a newline. GKeyFile in GLib matches this interpretation.

In practice, the only section used by dbus-daemon is "D-BUS Service",
only way this could make a difference is if someone had written it
as "D-BUS\sService". According to
https://codesearch.debian.net/search?q=%5C%5BD-BUS%5C%5CsService%5C%5D
there is no instance of that pattern in Debian.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-19 11:11:55 +00:00
Simon McVittie
99580298f3 desktop-file: Justify implementation of is_valid_section_name()
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-19 11:11:55 +00:00
Simon McVittie
bd9b26ae47 desktop-file test: Add to CMake build
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-19 11:11:55 +00:00
Simon McVittie
9ae7232573 desktop-file test: Expand coverage to include more corner-cases
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-19 11:11:55 +00:00
David King
3ef9e789c1 is_valid_section_name: Fix logical expression
Group names in desktop files may contain all ASCII characters, except
control characters and '[' and ']'. Rather than accepting all values,
thanks to a logical operator confusion found by GCC warning
-Wlogical-op, instead explicitly reject the invalid values.

Signed-off-by: David King <dking@redhat.com>
Fixes: https://gitlab.freedesktop.org/dbus/dbus/issues/208
2018-10-19 11:11:55 +00:00
Simon McVittie
5defe7d9eb Add basic test coverage for the bus' desktop file parser
This doesn't cover backslash-escaping in values, or various other
corner cases, but it's a start.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-19 11:11:55 +00:00
Simon McVittie
91de178f9e CONTRIBUTING.md: Update and rewrite
This file hadn't kept up with reality, and needs updating for Gitlab.
Take the opportunity to rewrite it.

Much of the text, particularly about commit messages, was taken from
Wayland's contributing guide (thanks to Ander Conselvan de Oliveira,
Bryce Harrington, Eric Engestrom, Pekka Paalanen and Daniel Stone).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-19 09:58:42 +00:00
Simon McVittie
cc00a7a6e9 CONTRIBUTING: Reformat as Markdown
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-19 09:58:42 +00:00
Simon McVittie
8d3adce7b1 CONTRIBUTING: Remove all trailing whitespace
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-19 09:58:42 +00:00
Ralf Habacker
6d4639a333 Use separate bus configuration files for executing test cases with a temporary session bus
Instead of the previous adaptation of the existing template
for the session bus, a separate template is now used, which
can be more easily adapted to the requirements of the test
applications.

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/57
2018-10-18 20:06:43 +02:00
Simon McVittie
93b7bb392b dbus-launch: Fix unused variable warning when libX11 not present
Closes: https://gitlab.freedesktop.org/dbus/dbus/issues/228
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-18 15:30:56 +00:00
David King
c0bf0d185d dbus-send: Avoid duplicated-branches warning
Switch the order of the argument checks to avoid the
-Wduplicated-branches warning.

Signed-off-by: David King <dking@redhat.com>
Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-10-18 12:36:03 +01:00
David King
a653191342 _dbus_get_is_errno_eagain_or_ewouldblock: Avoid warning
EAGAIN and EWOULDBLOCK are documented to possibly be numerically equal,
for instance in errno(3), and a simple logical OR check will trigger the
-Wlogical-op warning of GCC. The GCC developers consider the warning to
work as-designed in this case:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602

Avoid such a warning by explicitly checking if the values are identical.

Fixes: https://gitlab.freedesktop.org/dbus/dbus/issues/225
Signed-off-by: David King <dking@redhat.com>
Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-10-18 12:34:09 +01:00
Ralf Habacker
70bfb94b5c Build dbus-run-session on non Windows platforms with cmake
dbus-run-session is the preferred way to run a temporary D-Bus
session scoped to the lifetime of a process, for example
dbus-run-session -- make check.

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/193
2018-10-16 15:19:11 +02:00
Simon McVittie
7b3abcf28c cmake: Make Autotools consistency check work in out-of-srcdir builds
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-15 13:52:06 +01:00
Simon McVittie
aced59e202 cmake: Define HAVE_PRCTL, HAVE_RAISE according to existing checks
Otherwise test-segfault will not be able to disable core dumps, making
it extremely slow and noisy to run the tests under cmake.
I added the missing checks in commit be55374f, but didn't add the
corresponding symbols to config.h.cmake.

Fixes: be55374f "cmake: check for the necessary symbols for test-segfault.c"
Closes: https://gitlab.freedesktop.org/dbus/dbus/issues/227
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-15 13:51:38 +01:00
Simon McVittie
4f594be197 Update NEWS 2018-10-05 12:34:03 +01:00
Simon McVittie
2019ec75e8 Belatedly add a NEWS entry for mingw-w64 printf fixes
This was backported to dbus-1.12, so it needed a NEWS entry there,
at which point it seems odd for it not to have one here.
2018-10-05 12:34:03 +01:00
Simon McVittie
e3fb085886 ci: Use a separate ccache for each CI job
This should avoid them overwriting each other.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-04 18:41:29 +01:00
Simon McVittie
a2f416c289 ci: Mark many Gitlab jobs to be run manually
freedesktop.org Gitlab doesn't currently have enough test runners
available to run all of this every time. For higher-risk changes
(for example those that change the build system) we can run the
complete set through the web UI.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-04 17:26:42 +01:00
Simon McVittie
a6d926b805 ci: Reshuffle mingw jobs so we test different combinations
We test the combinations that we don't test on Travis-CI.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-04 17:04:41 +01:00
Simon McVittie
d0728fd06e ci: Use ccache to speed up repeated builds
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-04 10:50:37 +01:00
Simon McVittie
408b222a9f ci: Teach ci-install.sh to install wine on Debian 9 'stretch'
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=108177
Acked-by: Philip Withnall <withnall@endlessm.com>
2018-10-04 10:21:29 +01:00