Bug 52322 - dbus-binding-tool fails in glib-server mode on MS-Windows with mingw
Summary: dbus-binding-tool fails in glib-server mode on MS-Windows with mingw
Alias: None
Product: dbus
Classification: Unclassified
Component: GLib (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Rob Taylor
QA Contact:
Depends on:
Reported: 2012-07-20 20:02 UTC by Mark Mikofski
Modified: 2012-07-23 09:41 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

list of GTK files and libgio symbols (347.61 KB, text/plain)
2012-07-20 20:02 UTC, Mark Mikofski

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Mikofski 2012-07-20 20:02:32 UTC
Created attachment 64463 [details]
list of GTK files and libgio symbols

Trying to create a header file from xml ...

    $ which dbus-binding-tool

    $ dbus-binding-tool --mode=glib-server --prefix=some_object \
    > --output=example-service-glue.h example-service.xml
    Compilation failed: Failed to execute child process (No such file or directory)

... doesn't create the header file

Steps to reproduce:
0) download mingw-get-inst and install mingw and msys environment with gcc toolchain and some other libraries (libexpat, libz, libxml2, libxslt, libffi)
1) download PyGTK all-in-one ms-windows installer, install, and add /c/Python27/Lib/site-packages/gtk-2.0/runtime/bin to $PATH
2) download dbus-1.6.4 tarball, extract and build
3) download dbus-glib-0.100 tarball, extract and try to build
4) comment out examples subdir in makefile and build again
5) run dbus-binding-tool in glib-server mode with an example xml file from dbus-glib/dbus/examples

Actual results:
Output is "Compilation failed: Failed to execute child process (No such file or directory)", and no header file is created.

Expected results:
The file is generated using the example xml file supplied. There are no errors.

Build date and platform:
dbus-1.6.4 (2012-07-19), dbus-glib-0.100 (2012-06-25) MS-Windows XPSP3(x86), mingw(mingw32)

Additional information:
dbus-binding-tool --mode=glib-client example.xml > example-glue.h seems to work, i.e. there is no error and the file is created.

> For Windows you might need to change the default in configure.ac to end
> with $(EXEEXT) (which is empty on Unix and ".exe" on Windows), and
> re-run autoconf and configure. To test whether that works without having
> to re-run autoconf, you could configure like this:

>     ./configure ... \

> --with-dbus-binding-tool=\$\(top_builddir\)/dbus/dbus-binding-tool\$\(EXEEXT\)

dbus-binding-tool.exe *is* being compiled *with* the .exe ending, so I didn't try adding $(EXEEXT) to configure.ac. Make compiles dbus-binding-tool.exe, but quits when it enters the example subdirectory and tries to execute dbus-binding-tool in glib-server mode (using libtool --mode=execute).

I've also attached the list of symbols in libgio-2.0_0.dll which (I think) is what dbus-binding-tool uses. I also included a list of the files in gtk-2.0/runtime/bin, in case there is a library missing that dbus-glib
Comment 1 Mark Mikofski 2012-07-23 05:59:13 UTC
This is **not** a bug in dbus-glib. This is an issue with MS-Windows and the setenv.cmd script from GTK that added the GTK bin file to the Windows PATH environmental variable, and then surrounded it in quotation marks, which has inconsistent results on MS-Windows. (i.e. sometimes it recognizes some files, sometimes it doesn't. MS recommends against putting quotes in the PATH evironmental variable.

The resolution is simple. (1) Do not use the setenv.cmd script from GTK, (or if you do, edit the script so that the PATH environmental variable is *not* surrounded in quotation marks.) (2) Append the path to the GTK runtime bin folder manually e.g.

    $ export PATH=/c/python27/lib/site-packages/gtk-2.0/runtime/bin:$PATH

maybe edit your .bashrc to include it and some of the other variables that setenv creates, or maybe just add it to your MS-Windows path (and the other variables?) via Start | Control Panel | System | Advanced | Environmental Variables | Path | Edit or New for PKG_CONFIG_PATH.

I'm not sure if I am allowed to RESOLVE this and mark it as NOTABUG since I'm not a maintainer and well seems like the issue only affected me, but I would consider it closed.
Comment 2 Simon McVittie 2012-07-23 09:41:55 UTC
(In reply to comment #1)
> This is an issue with [...] the
> setenv.cmd script from GTK that added the GTK bin file to the Windows PATH

NOTOURBUG then. Thanks!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.