Bug 44109 - Add versioninfo to executable
Summary: Add versioninfo to executable
Status: RESOLVED DUPLICATE of bug 103387
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: 1.5
Hardware: All All
: medium enhancement
Assignee: D-Bus Maintainers
QA Contact: D-Bus Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-23 17:31 UTC by René Berber
Modified: 2018-03-12 18:43 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Adds versioninfo & manifest to dbus-daemon on Windows build. (4.03 KB, patch)
2014-10-10 03:15 UTC, René Berber
Details | Splinter Review

Description René Berber 2011-12-23 17:31:41 UTC
I'm building static libraries and statically linked executables, the version information is not carried into those executables.

In the library source directory (dbus) there is versioninfo.rc which is compiled with windres and then *not* added to the library.  See the log snippet below.

I'm not sure if adding to the library is enough for the version information to be included with the executables, if not, then versioninfo.o should be linked with all executables explicitly.

Build log :

i686-pc-mingw32-windres versioninfo.rc -o versioninfo.o

/bin/sh ../libtool  --tag=CC   --mode=link i686-pc-mingw32-gcc  -Wall -Wextra -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wno-address -Wfloat-equal -Wdeclaration-after-statement -Wno-unused-label -Wno-missing-field-initializers -Wno-unused-parameter -Wno-sign-compare -Wno-pointer-sign -Wno-type-limits -fno-common -fno-strict-aliasing -g -O2   -version-info 9:4:6 -no-undefined   -o libdbus-1.la -rpath /opt/mingw-cross-env/usr/i686-pc-mingw32/lib libdbus_1_la-dbus-address.lo libdbus_1_la-dbus-auth.lo libdbus_1_la-dbus-auth-script.lo libdbus_1_la-dbus-bus.lo libdbus_1_la-dbus-connection.lo libdbus_1_la-dbus-credentials.lo libdbus_1_la-dbus-errors.lo libdbus_1_la-dbus-keyring.lo libdbus_1_la-dbus-marshal-header.lo libdbus_1_la-dbus-marshal-byteswap.lo libdbus_1_la-dbus-marshal-recursive.lo libdbus_1_la-dbus-marshal-validate.lo libdbus_1_la-dbus-message.lo libdbus_1_la-dbus-misc.lo libdbus_1_la-dbus-nonce.lo libdbus_1_la-dbus-object-tree.lo libdbus_1_la-dbus-pending-call.lo libdbus_1_la-dbus-resources.lo libdbus_1_la-dbus-server.lo libdbus_1_la-dbus-server-debug-pipe.lo libdbus_1_la-dbus-server-socket.lo libdbus_1_la-dbus-server-win.lo libdbus_1_la-dbus-sha.lo libdbus_1_la-dbus-signature.lo libdbus_1_la-dbus-timeout.lo libdbus_1_la-dbus-threads.lo libdbus_1_la-dbus-transport.lo libdbus_1_la-dbus-transport-socket.lo libdbus_1_la-dbus-watch.lo libdbus_1_la-dbus-dataslot.lo libdbus_1_la-dbus-file.lo libdbus_1_la-dbus-hash.lo libdbus_1_la-dbus-internals.lo libdbus_1_la-dbus-list.lo libdbus_1_la-dbus-marshal-basic.lo libdbus_1_la-dbus-memory.lo libdbus_1_la-dbus-mempool.lo libdbus_1_la-dbus-pipe.lo libdbus_1_la-dbus-string.lo  libdbus_1_la-dbus-file-win.lo libdbus_1_la-dbus-pipe-win.lo libdbus_1_la-dbus-sysdeps-win.lo libdbus_1_la-dbus-sysdeps-thread-win.lo libdbus_1_la-dbus-transport-win.lo libdbus_1_la-dbus-sysdeps.lo -lws2_32 

libtool: link: i686-pc-mingw32-ar cru .libs/libdbus-1.a  libdbus_1_la-dbus-address.o libdbus_1_la-dbus-auth.o libdbus_1_la-dbus-auth-script.o libdbus_1_la-dbus-bus.o libdbus_1_la-dbus-connection.o libdbus_1_la-dbus-credentials.o libdbus_1_la-dbus-errors.o libdbus_1_la-dbus-keyring.o libdbus_1_la-dbus-marshal-header.o libdbus_1_la-dbus-marshal-byteswap.o libdbus_1_la-dbus-marshal-recursive.o libdbus_1_la-dbus-marshal-validate.o libdbus_1_la-dbus-message.o libdbus_1_la-dbus-misc.o libdbus_1_la-dbus-nonce.o libdbus_1_la-dbus-object-tree.o libdbus_1_la-dbus-pending-call.o libdbus_1_la-dbus-resources.o libdbus_1_la-dbus-server.o libdbus_1_la-dbus-server-debug-pipe.o libdbus_1_la-dbus-server-socket.o libdbus_1_la-dbus-server-win.o libdbus_1_la-dbus-sha.o libdbus_1_la-dbus-signature.o libdbus_1_la-dbus-timeout.o libdbus_1_la-dbus-threads.o libdbus_1_la-dbus-transport.o libdbus_1_la-dbus-transport-socket.o libdbus_1_la-dbus-watch.o libdbus_1_la-dbus-dataslot.o libdbus_1_la-dbus-file.o libdbus_1_la-dbus-hash.o libdbus_1_la-dbus-internals.o libdbus_1_la-dbus-list.o libdbus_1_la-dbus-marshal-basic.o libdbus_1_la-dbus-memory.o libdbus_1_la-dbus-mempool.o libdbus_1_la-dbus-pipe.o libdbus_1_la-dbus-string.o libdbus_1_la-dbus-file-win.o libdbus_1_la-dbus-pipe-win.o libdbus_1_la-dbus-sysdeps-win.o libdbus_1_la-dbus-sysdeps-thread-win.o libdbus_1_la-dbus-transport-win.o libdbus_1_la-dbus-sysdeps.o

libtool: link: i686-pc-mingw32-ranlib .libs/libdbus-1.a
Comment 1 René Berber 2014-06-26 00:45:54 UTC
Bug still present in version 1.8.4, and it has a related problem: missing manifest (i.e. related because the manifest can/should be included inside the .rc file -- and both linked into the executable).

The lack of a manifest means dbus-daemon is running in an "Operating System Context" of Windows Vista, while the real OS is Windows 7, 8, or 8.1.

What's the real performance impact? I don't really know, I'm no Windows expert.  But read this if you want to get an idea: http://msdn.microsoft.com/en-us/library/windows/desktop/hh848036%28v=vs.85%29.aspx
Comment 2 René Berber 2014-10-10 03:15:50 UTC
Created attachment 107642 [details] [review]
Adds versioninfo & manifest to dbus-daemon on Windows build.

Just like the description says.

Notes: Its mostly a copy of what exists in the library, doesn't change that part at all (versioninfo is not added to the library, and unless it is somehow linked to the executable, its useless in the library).

Added the executable manifest, a simple one, that defines compatibility with all versions of Windows from XP to 10.  This avoids running the program in a Vista compatible way, which is the default for Win 7 and later.

Didn't add anything to the other executables produced in the build.
Comment 3 Simon McVittie 2018-03-12 12:00:00 UTC
Comment on attachment 107642 [details] [review]
Adds versioninfo & manifest to dbus-daemon on Windows build.

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

This seems a lot like Bug #103387. Ralf, please could you check whether there's anything here that we'll still want after applying your patch from Bug #103387?

::: bus/Makefile.am
@@ +6,5 @@
> +#
> +#if DBUS_WIN
> +
> +%.o: %.rc
> +	$(WINDRES) $< -o $@

This needs to be $(RC) since 1.11.22

::: bus/dbus.manifest
@@ +1,4 @@
> +<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"
> +          xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
> +<description>DBus</description>

Either "dbus-daemon" or "D-Bus message bus service" depending what conventionally appears here

@@ +4,5 @@
> +<description>DBus</description>
> +<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
> +    <security>
> +      <requestedPrivileges>
> +        <requestedExecutionLevel level="asInvoker" uiAccess="false"/>

Ralf, is this something we should be adding to all executables?

@@ +19,5 @@
> +		<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
> +		<!-- The ID below indicates app support for Windows 8.1 -->
> +		<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
> +		<!-- The ID below indicates app support for Windows 10 -->
> +		<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>

I can see that this might be something we might want?

::: bus/versioninfo.rc.in
@@ +11,5 @@
> + */
> + 
> +/* This file is processed by configure to create versioninfo.rc */
> +
> +#line __LINE__ "versioninfo.rc.in"

We had some trouble with #line directives in MSVC's resource compiler (Bug #103015) so we probably need to lose that part.

@@ +36,5 @@
> +    BLOCK "StringFileInfo"
> +    BEGIN
> +        BLOCK "040904b0"
> +        BEGIN
> +            VALUE "Comments", "Provided under the terms of the GNU Lesser General Public License.\0"

This isn't true: dbus is dual-licensed under GPL-2.0 (or any later version) or AFL-2.1. It isn't LGPL.

@@ +41,5 @@
> +            VALUE "CompanyName", "FreeDesktop.org\0"
> +            VALUE "FileDescription", "dbus - FreeDesktop message bus system\0"
> +            VALUE "FileVersion", "@DBUS_VERSION@\0"
> +            VALUE "InternalName", "dbus\0"
> +            VALUE "LegalCopyright", "Copyright © 2009 - 2014 FreeDesktop.org\0"

The form we used in the other .rc file was

© 1994-2017 dbus contributors, see dbus source code for details

since freedesktop.org is not a copyright holder. (The copyright holders are individual contributors, like Ralf Habacker for his contributions, or their employers, like Collabora Ltd. for my contributions.)
Comment 4 Ralf Habacker 2018-03-12 18:43:40 UTC

*** This bug has been marked as a duplicate of bug 103387 ***


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.