Commit graph

450 commits

Author SHA1 Message Date
Alex Richardson
1c08115609 Fix no-X11 build after d847b5f6ae
Since that commit the error variable is used in all cases not only the
DBUS_BUILD_X11 #ifdef branches.

Fixes: https://gitlab.freedesktop.org/dbus/dbus/-/issues/392
(cherry picked from commit 6c1c7e539f)
Backported-from: dbus!298
2022-09-13 12:24:35 +01:00
Simon McVittie
8aa34131dd 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:06:46 +01:00
Ralf Habacker
067733d4b0 tools/ci-install.sh: clean up the previously used installation prefix and the downloaded mingw packages
This is necessary to have a clean initial state when running the script
locally.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2022-09-12 17:58:03 +01:00
Ralf Habacker
85f5f05038 tools/ci-install.sh: Use partially qualified versions with mingw package names
Fixes dbus/dbus#388

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2022-09-12 17:57:50 +01:00
Ralf Habacker
7e9d3708b1 tools/ci-install.sh: on debian|ubuntu reduce the need for mingw package name changes
Instead of having to specify an exact version that needs to be adjusted
with each repository update, it is now possible to specify package names
without version or partially qualified versions, which reduces the
frequency of necessary adjustments.

This is achieved by searching for the package names in a previously
downloaded list of available packages.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2022-09-12 17:57:46 +01:00
Simon McVittie
b03cb9f9cd CI: Make most gcc warnings fatal for CMake builds
This makes sure we notice problems early.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-27 17:09:33 +00:00
Simon McVittie
61cfa140cb CI: Use https to download MSYS packages
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-25 14:08:58 +00:00
Simon McVittie
97c2f9e306 CI: Install ci-certificates
We need this to be able to download MSYS packages now.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-25 14:08:58 +00:00
Simon McVittie
69c610f6f0 CI: Remove EOL versions of Debian and Ubuntu
Debian 9 'stretch' is EOL, and Ubuntu 16.04 is EOL unless you enter into
a special subscription with Canonical. This puts them outside our
informal security-support policy, and realistically, anyone sufficiently
change-averse to be following these distributions is not going to be
backporting a current version of dbus.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-25 13:54:05 +00:00
Marc-André Lureau
94f8689417 docker/windows: fix bad path from MR !218
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-01-27 23:07:18 +04:00
Marc-André Lureau
98c903656d gitlab-ci: build a Windows docker image, with VS15 & msys
Based on GStreamer & Mesa freedesktop gitlab CI, use the Windows 1809
runner provided by the GStreamer Foundation.

https://www.freedesktop.org/wiki/Infrastructure/

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-01-21 21:16:45 +04:00
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