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 702554 - Building from git (neither jhbuild nor tarball) automake gives a misleading red herring about HAVE_INTROSPECTION not present
Building from git (neither jhbuild nor tarball) automake gives a misleading r...
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-06-18 12:48 UTC by Andrés G. Aragoneses (IRC: knocte)
Modified: 2014-02-17 21:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.47 KB, patch)
2013-06-18 13:02 UTC, Andrés G. Aragoneses (IRC: knocte)
none Details | Review
proposed patch in case g-i is not a hard dependency for nautilus (1.57 KB, patch)
2013-06-18 13:46 UTC, Andrés G. Aragoneses (IRC: knocte)
committed Details | Review

Description Andrés G. Aragoneses (IRC: knocte) 2013-06-18 12:48:13 UTC
As far as I understand (now) nautilus depends on gobject-introspection. To check for it, it uses a m4 macro that is actually shipped with gobject-introspection itself, so in case the dependency is not met, the call to GOBJECT_INTROSPECTION_CHECK([0.6.4]) is ignored by autoconf.

The consequence of this is that automake then fails with this misleading error message (which leads the developer to believe that there is a bug in the configuration phase, rather than just a missing dependency):

...
eel/Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
libnautilus-extension/Makefile.am:67: error: HAVE_INTROSPECTION does not appear in AM_CONDITIONAL
Comment 1 Andrés G. Aragoneses (IRC: knocte) 2013-06-18 13:02:17 UTC
Created attachment 247135 [details] [review]
proposed patch

This is my proposed patch.

Please note: other bugs in other gnome modules seem to suggest to just simply include the introspection.m4 file (literally copy-pasting it), but obviously this approach looks to be rejected often because it would be then hard to sync that file with upstream all the time.

Another suggested approach by Alex was to use m4_pattern_forbid([^GOBJECT_INTROSPECTION_CHECK]) before calling the macro. The consequence of this is the following error message:

 "error: possibly undefined macro GOBJECT_INTROSPECTION_CHECK"

In my opinion this is not a good approach because:
1) The error is still not very clear, this approach doesn't let you define the error message, so the developer has to guess that the macro GOBJECT_INTROSPECTION_CHECK not being present actually means "please install gobject-introspection".
2) The usage/existence of m4_pattern_forbid seems to be a bit hacky, not very understandable TBH. The reason is that in banshee recently we've had actually the opposite case: autoconf complaining about M4 macros not defined, before the real pkg-config dependency check was called. To fix this, we had to use the opposite tool "m4_pattern_allow". So I don't know how is it possible that banshee processes autoconf with this "Macro check for existance" by default, and not nautilus. I've tried to check about autoconf options, but the only thing I find are different warning categories (not errors), which banshee does not use. And nautilus uses gnome-autogen.sh, which doesn't use special autoconf options either AFAIU.

However, my approach in this patch is a bit better because:
1) it uses "m4_ifdef", a more readable solution.
2) it is also more user-friendly because it would error with "gobject-introspection is required".
3) it would make the call to GOBJECT_INTROSPECTION_CHECK be inside the same block where we check for its existence (as opposed to the use of m4_pattern_forbid, which would make both calls be completely separate, and would mean the increase of likelyhood of the scenario of a developer modifying one and forgetting to modify the other.
Comment 2 Andrés G. Aragoneses (IRC: knocte) 2013-06-18 13:46:52 UTC
Created attachment 247145 [details] [review]
proposed patch in case g-i is not a hard dependency for nautilus

Actually, I'm not sure if G-I is a hard dependency for nautilus, so in case it is not, this would be the alternate patch.

(Note: this is the same approach that anjuta devs have decided to do in bug 622526, https://git.gnome.org/browse/anjuta/commit/?id=ec82284cc305aa6d2c3ebe85554bfe2aa40278bd )
Comment 3 Cosimo Cecchi 2014-02-17 21:17:38 UTC
Pushed this one to git master, thanks.