After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 598837 - Please check for libice
Please check for libice
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: general
2.28.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-games-general-maint
GNOME Games maintainers
Depends on:
Blocks:
 
 
Reported: 2009-10-18 12:04 UTC by Luca Bruno
Modified: 2010-06-08 05:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
check for libice when using libsm (629 bytes, patch)
2009-10-18 14:14 UTC, Luca Bruno
none Details | Review

Description Luca Bruno 2009-10-18 12:04:28 UTC
Hello,
libgames-support/eggsmclient-xsmp.c is using libICE symbols but in configure.in you only check for libsm. Linking fails without -lICE.
Comment 1 Luca Bruno 2009-10-18 14:14:52 UTC
Created attachment 145731 [details] [review]
check for libice when using libsm
Comment 2 Christian Persch 2009-10-18 19:41:06 UTC
This looks wrong to me. On my system, sm.pc contains

Requires: ice xproto

Was this changed? If so, when, where (your distro only, or upstream), and why?
Comment 3 Luca Bruno 2009-10-19 11:28:07 UTC
As per sm.pc.in it's:
Requires: ice xproto
Requires.private: ice
Cflags: -I${includedir}
Libs: -L${libdir} -lSM

That means pkg-config sm --libs only outputs -lSM, so you're not linking against ICE.
Comment 4 Christian Persch 2009-10-19 12:11:05 UTC
Not so, here:

$ pkg-config --libs sm
-lSM -lICE
$ pkg-config --version
0.22

Requires: means that ice's libs are pulled in too. Did pkg-config break this?
Comment 5 Thomas Andersen 2009-10-19 14:24:50 UTC
This is on karmic:

$ pkg-config --libs sm
-lSM  
$ pkg-config --version
0.22

However this is /usr/lib/pkgconfig/sm.pc:

prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: SM
Description: X Session Management Library
Version: 1.1.0
Requires.private: ice xproto
Cflags: -I${includedir}
Libs: -L${libdir} -lSM
Comment 6 Thomas Andersen 2009-10-19 14:27:02 UTC
From ubuntu change log in libsm 2:1.1.0-2

libsm (2:1.1.0-2) unstable; urgency=low

  * Upload to unstable.

 -- Julien Cristau <jcristau@debian.org>  Mon, 16 Feb 2009 01:33:27 +0100

libsm (2:1.1.0-1) experimental; urgency=low

  [ Brice Goglin ]
  * Use ${binary:Version} instead of the deprecated ${Source-Version}.

  [ Julien Cristau ]
  * New upstream release.
    - generate client IDs using libuuid instead of gethostbyname()
  * Switch to running autoreconf at build time; clean up in debian/rules
    clean, and build-depend on automake, libtool and xutils-dev.
  * Drop -1 debian revisions from build-deps.
  * Stop handling nostrip explicitly in debian/rules (dh_strip does it
    already), and allow parallel builds using sample code from policy.
  * Add myself to Uploaders.
  * Don't export a dependency on ice in sm.pc.
Comment 7 Luca Bruno 2009-10-19 17:04:25 UTC
(In reply to comment #4)
> Requires: means that ice's libs are pulled in too. Did pkg-config break this?

No, but in the .pc there's Requires.private: ice, that might be the reason.
Comment 8 Christian Persch 2009-10-19 17:23:45 UTC
Upstream still has the Requires: ice [http://cgit.freedesktop.org/xorg/lib/libSM/tree/sm.pc.in], so this is an ubuntu-only change. I can't find any bug filed for this on libsm at bfo, nor can I find a launchpad bug for this change in ubuntu. Turns out this originated in debian, but there's no bug filed in debian either where one might find an explanation.

Now this change is totally wrong, and should be reverted immediately in debian and ubuntu. However, that still means that it's broken at least in jaunty, so I guess we'll have to make this change :-(((
Comment 9 Christian Persch 2009-10-19 17:29:09 UTC
Ubuntu really seems not wanting one to file bugs, but after jumping through many hoops I finally succeeded to file a bug on launchpad for this! See https://bugs.launchpad.net/ubuntu/+source/libsm/+bug/455614 .
Comment 10 Christian Persch 2009-10-19 17:35:33 UTC
Also I found many other Gnome modules that use eggsmclient and only check for sm but not ice, too (e.g. totem, gedit, evince, gnome-terminal). Are we expected to fix them all just so debian & ubuntu can continue with this nonsense‽
Comment 11 Christian Persch 2009-10-19 18:27:49 UTC
Re comment 5: If you're on karmic, which has this broken pc file, does linking fail for you too like comment 0 says? I don't think so, at least you haven't complained so far :) — and jaunty's broken too, so we should have heard about this earlier...
Comment 12 Thomas Andersen 2009-10-19 20:34:09 UTC
Builds/links just fine here on karmic. Did on jaunty as well.
Comment 13 Robert Ancell 2009-10-23 03:45:49 UTC
Builds fine on Ubuntu because libSM includes the ICE headers with the full path from /usr/include and ld automatically brings in libICE as it is a dependency of libSM.

The change in Ubuntu should be fixed because it is:
a) inconsistent between OSs
b) removes dependency information (pkg-config cannot detect that libSM will not work without libICE)
c) cannot handle libICE headers being installed in a different location (e.g. by overriding PKG_CONFIG_PATH for a test version).

However, as eggsmclient-xsmp.c explicitly includes libICE headers it should require libICE CFLAGS and LIBS.
Comment 14 Robert Ancell 2009-10-28 02:36:09 UTC
b) and c) are not true as the header information is still provided by pkg-config.

This change is correct according to the pkg-config authors:
http://err.no/personal/blog/2008/Mar/25

a) still stands.  I have no idea why Debian considers this of great importance to change and not to request upstream to make the change but it will have to be raised with them.

Note that Luca's patch is valid as libgames-support/eggsmclient-xsmp.c contains references to libICE thus it must link against it.
Comment 15 Josselin Mouette 2010-01-14 09:09:38 UTC
I can answer for a). 

One of our goals in Debian is to reduce the number of unneeded dependencies. The largest source of such dependencies is brought - now that libtool has been half-nuked - by pkg-config files using abusive Requires.

Reducing the number of undeeded direct dependencies is of great importance, since it eases transitions between versions of libraries a lot, be it for introducing new symbols or when changing sonames.
Comment 16 Christian Persch 2010-01-14 13:25:38 UTC
(In reply to comment #15)
> Reducing the number of undeeded direct dependencies is of great importance,
> since it eases transitions between versions of libraries a lot, be it for
> introducing new symbols or when changing sonames.

So to make things easier for you when the library changes ABI in future, you break the library API/ABI yourself by changing its .pc file? Seems rather strange to me.
Comment 17 Josselin Mouette 2010-01-14 13:34:49 UTC
(In reply to comment #16)
> So to make things easier for you when the library changes ABI in future, you
> break the library API/ABI yourself by changing its .pc file? Seems rather
> strange to me.

Applications relying on a side effect of the former dependency system in .pc files (which has been fixed by introducing Requires.private) are, from my POV, buggy to begin with.

Similarly they will break when using the “gold” branch of binutils (which I hope to see some day by default) if they use an indirect dependency without linking to it.

I’d also add you might consider this part of the API, although I find this reasoning a bit twisted, but not of the ABI: execution of existing packages is not affected in any way by changes in the .pc files. Transient compilation breakage is accepted, but runtime breakage is not.
Comment 18 Emilio Pozuelo Monfort 2010-01-14 16:56:46 UTC
(In reply to comment #16)
> So to make things easier for you when the library changes ABI in future, you
> break the library API/ABI yourself by changing its .pc file? Seems rather
> strange to me.

That's unrelated. Per comment #13, gnome-games is already buggy. Isn't it?

"However, as eggsmclient-xsmp.c explicitly includes libICE headers it should
require libICE CFLAGS and LIBS."
Comment 19 Robert Ancell 2010-06-08 05:43:37 UTC
Pushed the patch due to comment #13.