Commit graph

439 commits

Author SHA1 Message Date
Ralf Habacker
19d6954b05 tools/ci-build.sh: Double maximum test time when running tests on Windows
The currently timeout of 60 seconds is too short for test-dbus-daemon on
Windows, depending on the load of the CI system.

Fixes #359
2021-12-06 23:52:01 +01:00
Ralf Habacker
acb9ca7422 tools/ci-*.sh: Show used command line for CI build scripts
This makes it much easier to determine the command line used for the
purpose of reproducing the build.
2021-11-29 15:20:10 +00:00
Ralf Habacker
0eef54ea1b _dbus_spawn_program(): Add additional parameter to return error
By specifying an error instance via the additional parameter, errors that
occur in it are transported to the caller in a coordinated manner.

This eliminates the need to query GetLastError() outside the function,
which can return an incorrect value if the implementation changes.
2021-11-29 13:07:04 +01:00
Ralf Habacker
ba1dc32667 _dbus_spawn_program() now returns #NULL for unification in case of error 2021-11-29 13:07:04 +01:00
Ralf Habacker
fe84e9b0e5 dbus-run-session: also catches a server-exit under Windows
If the dbus-daemon fails before the --ready-event-handle is signalled,
then dbus-run-session now detects that, and exit unsuccessfully.

Fixes #354
2021-11-25 16:46:27 +01:00
Ralf Habacker
2334307fbd tools/dbus-run-session.c: use _dbus_win_set_error_from_last_error() on remaining locations
The previously used function _dbus_win_stderr_win_error() has been removed
because it is no longer used.
2021-11-23 08:38:14 +01:00
Ralf Habacker
79df3d2811 tools/dbus-run-session: fix race between manual and automatically started dbus-daemon on Windows
dbus-run-session starts a dbus-daemon before the client application.
We must avoid letting the application try to connect before the
dbus-daemon's DBusServer is listening for connections.

In the Unix implementation, we already achieved this via the
--print-address option. If the client tried to connect too soon,
the server would not yet be listening and the client would fail.

In the Windows implementation, we communicate the bus address to
the client application as an autolaunch: address, so if the client
tried to connect too soon, it would autolaunch a new dbus-daemon
instead of using the one that it was intended to use.

We can avoid this by using a new option to pass in a Windows event
object, which will be set when the server has started and is ready
to process connections.

Fixes #297
2021-11-23 08:38:14 +01:00
Ralf Habacker
151574605e tools/cmake-format: fix sed warning Expression #1, char 25: unknown option for »s« in --all mode 2021-10-25 15:56:09 +02:00
Ralf Habacker
75003c4ca1 tools/cmake-format: add support to use custom source root directory 2021-10-25 15:42:37 +02:00
Simon McVittie
a42a07a1fb dbus-send: Validate interface, member names before use
Instead of a failed check or assertion failure and a core dump, let's
produce an error message on stderr and a graceful nonzero exit status.
It's still not going to *work*, but at least we can avoid crashing.

    $ dbus-send / com.example.Nope..Nope
    Interface name was not valid: 'com.example.Nope.'
    $ dbus-send / com.example.Nope.0
    Invalid signal name: Member name was not valid: '0'

Resolves: dbus#338
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-06-21 12:04:05 +01:00
Simon McVittie
dde5c8fdc4 dbus-send: Print an error message if object path is syntactically invalid
$ dbus-send // nope
    Object path was not valid: '//'

Related to dbus#338.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-06-21 12:02:27 +01:00
Marc-André Lureau
c5385dfd60 ci: bump msys2 deps, fix broken links
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-01-13 18:53:23 +04:00
Ralf Habacker
6412ccdf67 tools/ci-install.sh: Use package=() style for local package list to avoid '\' notation 2020-11-24 07:08:42 +00:00
Ralf Habacker
9c5734fe90 On CI use common install prefix named 'dep_prefix' for installing local packages
With this commit a new variable 'ci_local_packages' has been introduced
to have a choice for using development packages from a local installation
or from the distribution.
2020-11-24 07:08:42 +00:00
Ralf Habacker
e82d5fe486 tools/ci-build.sh: Clean up directories from possible previous builds
Otherwise, ci-build.sh cannot be executed on a local system if there
are previous runs.
2020-11-24 07:08:42 +00:00
Ralf Habacker
478484f13c tools/ci-install.sh: merge multiple calls to apt-get
This required a reorganization of the steps that had been carried out.
The new order is:
   1. install packages with apt-get
   2. create user for build if required
   3. fetch and unpack tar balls
   4. create messagebus user
2020-11-24 07:08:42 +00:00
Ralf Habacker
1e3d82d85e Move installing packages into tools/ci-install.sh
In tools/ci-build.sh the cross compile setup has to be moved further up
to match the correct subdirectory.
2020-11-24 07:08:42 +00:00
Ralf Habacker
2534c2076f Drop unused travis CI configuration files 2020-11-16 14:48:59 +01:00
William Earley
3545d0f4de dbus-launch: Replace slashes in DISPLAY if present
dbus-daemon fails to autolaunch with X11 on macOS 10.8+ because XQuartz
(the X11 package for macOS) provides a value for `$DISPLAY` that is
not expected by dbus, in that it contains `/` characters. This is
addressed by replacing the invalid path character `/` with `_`.

Resolves: #8
Resolves: #311
2020-11-06 17:17:09 +00:00
Simon McVittie
053238254e ci-build: Update required MSYS packages
The older versions we were previously building against are no longer
available on mirrors.

Based on changes proposed in !189 by Arnout Engelen, and the package
list gathered by Ralf Habacker in #318.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/318
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-11-06 13:38:45 +00:00
Ralf Habacker
3f3368b490 cmake: Use CMAKE_INSTALL_FULL_<dir> for configuration and state
This means we apply GNUInstallDirs' various special cases when
the prefix is /, /usr or something starting with /opt; these are
not applied when installing to CMAKE_INSTALL_<dir>. See
https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html#special-cases
2020-06-10 18:13:47 +00:00
Simon McVittie
eeef787418 Normalize C source files to end with exactly one newline
Some editors automatically remove trailing blank lines, or
automatically add a trailing newline to avoid having a trailing
non-blank line that is not terminated by a newline. To avoid unrelated
whitespace changes when users of such editors contribute to dbus,
let's pre-emptively normalize all files.

Unlike more intrusive whitespace normalization like removing trailing
whitespace from each line, this seems unlikely to cause significant
issues with cherry-picking changes to stable branches.

Implemented by:

    find . -name '*.[ch]' -print0 | \
    xargs -0 perl -0777 -p -i -e 's/\n+\z//g; s/\z/\n/g'

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-06-10 10:47:31 +00:00
Ralf Habacker
fa763da827 CI: for cmake show the used command lines when compiling and linking
This helps to detect incorrect settings.
2020-05-29 16:43:52 +02:00
Ralf Habacker
d64316a676 CI: Add running test cases for cross builds
Before building a wine prefix is created and search pathes
for binaries are configured in the wine prefix.

This commit adds a new shell variable 'ci_runtime' for specifing
the type of compiler support library which defaults to static for now.
2020-05-29 16:43:45 +02:00
Ralf Habacker
08eb885be6 cmake: build and install dbus-cleanup-sockets on non Windows platforms 2020-04-29 17:35:08 +00:00
Ralf Habacker
f88ca3b853 cmake: build and install dbus-uuidgen on non Windows platforms 2020-04-29 17:35:08 +00:00
Ralf Habacker
6e8d75834e Add support to generate the api documentation in Qt help format
Qt help files are used by Qt Creator and KDevelop, for example, to support
the development of Qt-based applications and libraries.

Generating api documentation in Qt help format is controlled by two
user specific options named --enable-qt-help and --with-qchdir (autotools)
and -DENABLE_QT_HELP and -DINSTALL_QCH_DIR (cmake).
2020-04-29 15:23:23 +00:00
Simon McVittie
0ddc510130 Merge branch 'ci-updates' into 'master'
CI: Update to Debian 10 'buster', drop Debian 8 'jessie', add qhelpgenerator

See merge request dbus/dbus!151
2020-04-16 10:25:39 +00:00
Simon McVittie
23e1f044f4 CI: Install qhelpgenerator for native production build on buster
This will be used in dbus!150.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-04-06 14:59:34 +01:00
Natanael Copa
6d92e8e983 _dbus_generate_random_bytes: use getrandom(2)
Use getrandom(2) and fall back to /dev/urandom if it is missing or if it
fails some any reason.

This solves problem where dbus-uuidgen is called from a chroot which
lacks /dev/urandom.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
2020-03-26 16:56:59 +01:00
Ralf Habacker
2d256d42ce cmake: complete adding version info to all installed executables on Windows 2020-02-19 10:23:01 +01:00
Tuomo Rinne
5314ced357 cmake: Add X11 include path for tools
Fixes compilation issues for case when X11 is not in a standard location
2020-01-22 21:56:53 +00:00
Christopher Morin
9842689a29 dbus-send: add --sender option
Clients listening for a signal can match against the 'sender', expecting
it to come from a connection with a specific name. With this change,
dbus-send can send signals to them.
2019-07-15 12:36:50 +00:00
Ralf Habacker
9dc72c9fb8 cmake: install missing files to keep in sync with autotools builds 2019-03-13 08:56:59 +01:00
Ralf Habacker
2798e68776 Adjust indents of CMakeLists.txt files always to 4 spaces 2019-01-24 09:08:15 +01:00
Ralf Habacker
f4032b05ed tools/cmake-format: Add option --check-indents to check indentations independently from other options
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2019-01-24 09:07:45 +01:00
Ralf Habacker
904fa97a1b Remove obsolete parameter in end... cmake keywords 2019-01-24 09:07:27 +01:00
Ralf Habacker
5972bbe382 Remove spaces between cmake command and opening bracket 2019-01-24 09:07:27 +01:00
Ralf Habacker
7dd83ba874 Replace tabs by 4 spaces in CMakeLists.txt files 2019-01-24 09:07:27 +01:00
Ralf Habacker
38b7c2859e Remove trailing spaces in CMakeLists.txt files 2019-01-24 09:07:27 +01:00
Ralf Habacker
eb4b378958 tools/cmake-format: Do not exclude CMakeLists.txt files
This fixes a regression of merge request !82 introduced
with the rebase to !84.
2019-01-24 09:07:10 +01:00
Simon McVittie
ad7e2749cf Merge branch 'reformat-cmake-files' into 'master'
Reformat cmake files

Closes #252

See merge request dbus/dbus!82
2019-01-23 20:52:37 +00:00
Simon McVittie
6d8280ec93 Merge branch 'code-coverage' into 'master'
Adapt to API change in AX_CODE_COVERAGE version 28

Closes #249

See merge request dbus/dbus!88

Reviewed-by: @pwithnall
2019-01-23 20:45:32 +00:00
Ralf Habacker
f855d0bb48 Add script for formatting cmake files
The prefered call order is

  tools/cmake-format --trailing-spaces
  # create git commit
  tools/cmake-format --tabs
  # create git commit
  tools/cmake-format --keyword-case
  # create git commit
  tools/cmake-format --keyword-spaces
  # create git commit
  tools/cmake-format --end-args
  # create git commit
  tools/cmake-format --indents
  # create git commit

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2019-01-23 21:34:08 +01:00
Ralf Habacker
a8e5e5c552 Add cmake macros add_executable_version_info and add_library_version_info
This helps to reduce duplicated code.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2019-01-22 09:58:27 +01:00
Ralf Habacker
3bf97922bd Move cmake related build system to top level
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2019-01-22 09:57:40 +01:00
Simon McVittie
83be61aa2d Consistently add CODE_COVERAGE_CPPFLAGS everywhere
We forgot this in a couple of places.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 18:46:07 +00:00
Simon McVittie
e0ea7a130c Consistently add CODE_COVERAGE_LIBS everywhere
We need to link the code coverage objects, directly or indirectly,
into every executable and every shared library. The rule I've followed
to make it clear that we do this, without too much repetition, is:
each executable, shared library or convenience library has
CODE_COVERAGE_LIBS in its LDADD or LIBADD, unless it is linked to a
convenience library in the same directory that has CODE_COVERAGE_LIBS
in *its* LIBADD.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 18:45:38 +00:00
Simon McVittie
1063bba06b CI: Do the CMake native debug build from an Autotools make dist
We officially release dbus in the form of Autotools `make dist` tarballs,
but people who have downloaded those tarballs should be able to choose
the CMake build system. Our CI should assert that they can.

(The Autotools debug build already does a `make distcheck`, which
asserts that tarball releases can be used for an Autotools build.)

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: dbus#255
2019-01-21 15:05:11 +00:00
Simon McVittie
fa63c16346 .gitignore: Ignore many more generated files
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-14 13:28:50 +00:00