Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FTFBS with glib2.0 >=2.66.3 #500

Closed
cpaelzer opened this issue Mar 8, 2021 · 8 comments
Closed

FTFBS with glib2.0 >=2.66.3 #500

cpaelzer opened this issue Mar 8, 2021 · 8 comments

Comments

@cpaelzer
Copy link

cpaelzer commented Mar 8, 2021

FTFBS due to new glib2.0 >=2.66.3

Example:

In file included from /usr/include/glib-2.0/glib/gmacros.h:241,
                 from /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h:9,
                 from /usr/include/glib-2.0/glib/gtypes.h:32,
                 from /usr/include/glib-2.0/glib/galloca.h:32,
                 from /usr/include/glib-2.0/glib.h:30,
                 from /<<PKGBUILDDIR>>/open-vm-tools/lib/include/vmware/tools/plugin.h:32,
                 from dndcp.cpp:36:
/usr/include/c++/10/type_traits:56:3: error: template with C linkage
   56 |   template<typename _Tp, _Tp __v>
      |   ^~~~~~~~
dndcp.cpp:34:1: note: ‘extern "C"’ linkage started here
   34 | extern "C" {
      | ^~~~~~~~~~

Full log:
https://launchpadlibrarian.net/525172798/buildlog_ubuntu-hirsute-amd64.open-vm-tools_2%3A11.2.5-2_BUILDING.txt.gz

On the glib side this is due to:
https://gitlab.gnome.org/GNOME/glib/-/issues/2331
Also related:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1935
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/J3P4TRHLWNDIKXF76OLYZNAPTABCZ3U5/#7LXFUDBBBIT23FE44QJYWX3I7U4EHW6M

There is a temporary workaround by hard setting the GLIB versions requested.
This I'll use to un-break the build in Ubuntu for now.
=> http://launchpadlibrarian.net/526861180/open-vm-tools_2%3A11.2.5-2_2%3A11.2.5-2ubuntu1.diff.gz

But mid term I guess you'll need to sort out the inclusion of such headers from CPP context more in general.

@cpaelzer
Copy link
Author

cpaelzer commented Mar 8, 2021

@bzed - FYI in case you want/need to build for the glib2.0 in debian/experimental

@iainlane
Copy link

iainlane commented Mar 8, 2021

Hey just to say that I wouldn't call this a temporary workaround. I think you should apply a patch like this one as general good practice to guard against future deprecations or behaviour changes affecting you until you opt in to them. (In the absence of having it defined you always get the latest stuff available at build time, which might sometimes include breakage like this.)

https://developer.gnome.org/glib/stable/glib-Version-Information.html#GLIB-VERSION-MIN-REQUIRED:CAPS

But if you ever want to be able to lift this requirement to a higher version, to use newer APIs for example, then you'll need to fix the externs, that is true to say.

Cheers!

@cpaelzer
Copy link
Author

cpaelzer commented Mar 8, 2021

Hey just to say that I wouldn't call this a temporary workaround.

Thanks for the clarifications @iainlane !

@dsouders
Copy link
Contributor

dsouders commented Mar 8, 2021

@cpaelzer Thank you for reporting this issue, an internal bug has been filed to track it.

@Conan-Kudo
Copy link

This is causes open-vm-tools to FTBFS on Fedora 34 now as well. ☹️

@johnwvmw
Copy link
Contributor

We are working and validating the fix on Fedora 34 that addresses this and also addresses use of a deprecated function in a newer GTK3. Stay tuned.

@Conan-Kudo
Copy link

Excellent!

Just FYI, I've filed a bug in RHBZ as well, please make sure once this is fixed that this is addressed: https://bugzilla.redhat.com/show_bug.cgi?id=1939718

johnwvmw added a commit that referenced this issue Apr 19, 2021
With glib2.0 releases >= 2.66.3, glib header files inside an
extern "C" block will encounter compilation errors.  This has
impacted several OSS packages.  Consumers of newer versions of glib2.0
must not include glib headers in an extern "C" block.

GTK 3.20 has deprecated gdk_display_get_device_manager(); using the
newer gdk_display_get_default_seat() when the GTK version is >= 3.20.

The return value from read() must be used to avoid an unused result
warning from the compiler.  This can be avoided by using dummy retyping
in the case where the return value is not used or in this case, using
the returned value in a debug log message.

Pull Request: #505
Addresses:    #500
Addresses:    #509
@johnwvmw
Copy link
Contributor

@cpaelzer ,
@bzed,
This issues has been fixed with change 82931a1 on the "devel" branch. This will be part of the next major open-vm-tools release, but the change can be applied to the 11.2.5 open-vm-tools source release.

Closing this issue; please reopen if you have any concerns or problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants