Bug 94094 - [PATCH] Fix build failure caused by missing include
Summary: [PATCH] Fix build failure caused by missing include
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: git master
Hardware: Other other
: medium normal
Assignee: Simon McVittie
QA Contact: D-Bus Maintainers
URL:
Whiteboard: review?
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-02-11 17:16 UTC by Eric
Modified: 2016-08-16 13:48 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch including <dbus/dbus.h> to fix compile failure (644 bytes, patch)
2016-02-11 17:16 UTC, Eric
Details | Splinter Review
Only compile test-bus-launch-helper, etc. if embedded tests are enabled (7.02 KB, patch)
2016-02-11 21:10 UTC, Simon McVittie
Details | Splinter Review

Description Eric 2016-02-11 17:16:28 UTC
Created attachment 121680 [details] [review]
Patch including <dbus/dbus.h> to fix compile failure

Scanning dependencies of target test-bus-launch-helper
[ 80%] Building C object bus/CMakeFiles/test-bus-launch-helper.dir/C_/repos/dbus/bus/config-loader-expat.o
[ 81%] Building C object bus/CMakeFiles/test-bus-launch-helper.dir/C_/repos/dbus/bus/config-parser-common.o
[ 82%] Building C object bus/CMakeFiles/test-bus-launch-helper.dir/C_/repos/dbus/bus/config-parser-trivial.o
[ 82%] Building C object bus/CMakeFiles/test-bus-launch-helper.dir/C_/repos/dbus/bus/desktop-file.o
[ 83%] Building C object bus/CMakeFiles/test-bus-launch-helper.dir/C_/repos/dbus/bus/utils.o
[ 84%] Building C object bus/CMakeFiles/test-bus-launch-helper.dir/C_/repos/dbus/bus/activation-helper.o
[ 85%] Building C object bus/CMakeFiles/test-bus-launch-helper.dir/C_/repos/dbus/bus/test-launch-helper.o
In file included from C:/repos/dbus/bus/test-launch-helper.c:26:0:
C:/repos/dbus/bus/activation-helper.h:28:1: error: unknown type name 'dbus_bool_t'
 dbus_bool_t run_launch_helper (const char *bus_name, DBusError *error);
 ^
C:/repos/dbus/bus/activation-helper.h:28:54: error: unknown type name 'DBusError'
 dbus_bool_t run_launch_helper (const char *bus_name, DBusError *error);
                                                      ^
make[2]: *** [bus/CMakeFiles/test-bus-launch-helper.dir/C_/repos/dbus/bus/test-launch-helper.o] Error 1
make[1]: *** [bus/CMakeFiles/test-bus-launch-helper.dir/all] Error 2
make: *** [all] Error 2
Comment 1 Simon McVittie 2016-02-11 20:12:22 UTC
What configuration (cmake options) are you using to build D-Bus?

What platform is this on?

From the mentions of "C_" in your log I'm guessing Windows. If you're building on Windows, then it doesn't make sense to compile test-bus-launch-helper.
Comment 2 Simon McVittie 2016-02-11 20:18:32 UTC
(In reply to Simon McVittie from comment #1)
> From the mentions of "C_" in your log I'm guessing Windows. If you're
> building on Windows, then it doesn't make sense to compile
> test-bus-launch-helper.

Oh, I see you're the same person cross-compiling for Android on Windows... I'm amazed that works, tbh.

The issue here seems to be that in the recommended Autotools build system, test-bus-launch-helper (and some other stuff) is built if we are compiling for non-Windows *and* "embedded tests" (intrusive tests that insert extra crap into the binaries) are enabled; but in the CMake build system, test-bus-launch-helper is built whenever we are compiling for non-Windows, even if "embedded tests" are disabled.

The CMake build system is basically there because some developers on Windows want to use Microsoft Visual C++ as their C compiler, in order to use its built-in debugger. It can also compile for GNU/Linux on GNU/Linux just so that it's easier to stop it bit-rotting, but it isn't really intended for more complex situations like non-GNU Unixes, and many combinations of options probably don't work.
Comment 3 Simon McVittie 2016-02-11 20:32:31 UTC
Comment on attachment 121680 [details] [review]
Patch including <dbus/dbus.h> to fix compile failure

Review of attachment 121680 [details] [review]:
-----------------------------------------------------------------

Strictly speaking this file should always have done this, so I'm applying it, but please don't interpret that as the CMake build system being fully-supported.
Comment 4 Simon McVittie 2016-02-11 20:55:45 UTC
Patch applied for 1.11.2, thanks. Leaving this bug open while I clean up the build for those tests.
Comment 5 Simon McVittie 2016-02-11 21:10:23 UTC
Created attachment 121692 [details] [review]
Only compile test-bus-launch-helper, etc. if embedded tests  are enabled

These source files are specific to the embedded tests and make no sense
otherwise.

Also remove a comment in the CMake build system about fixing the
build of the activation helper on Windows: the activation helper
is Unix-specific and always will be, since it relies on Unix setuid
to function.
Comment 6 Simon McVittie 2016-07-11 11:04:20 UTC
(assigning to myself to remind me that I can't be the reviewer for my own code)
Comment 7 Simon McVittie 2016-08-16 13:48:26 UTC
(In reply to Simon McVittie from comment #5)
> Only compile test-bus-launch-helper, etc. if embedded tests  are enabled

Applied unreviewed for 1.11.6. I assume that any maintainer who objected would have said something by now.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.