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 703571 - Avoid doubling up on geocode-glib in include path
Avoid doubling up on geocode-glib in include path
Status: RESOLVED FIXED
Product: geocode-glib
Classification: Other
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: geocode-glib maintainer(s)
geocode-glib maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-07-03 18:48 UTC by Andreas Henriksson
Modified: 2013-07-12 20:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Avoid doubling up on geocode-glib in include path (2.92 KB, patch)
2013-07-03 18:48 UTC, Andreas Henriksson
needs-work Details | Review
Make include directory API versioned (2.29 KB, patch)
2013-07-04 13:26 UTC, Andreas Henriksson
accepted-commit_now Details | Review
Make include directory API versioned (2.29 KB, patch)
2013-07-07 18:59 UTC, Andreas Henriksson
committed Details | Review
Unify include paths to be the same everywhere (6.43 KB, patch)
2013-07-07 19:00 UTC, Andreas Henriksson
committed Details | Review
Symlink geocode-glib.h into subdir to avoid breakage (1.49 KB, patch)
2013-07-07 19:00 UTC, Andreas Henriksson
rejected Details | Review

Description Andreas Henriksson 2013-07-03 18:48:05 UTC
Previously, both the `pkg-config --cflags geocode-glib-1.0`
and the path in the modified (not all) include files
both contained the geocode-glib sub-directory.
This only worked when geocode-glib/*.h was installed in
/usr/include (or similar system location). When you actually
rely on what pkg-config provides, it will fail....

Example from building geoclue2 with geocode-glib installed
in /opt/geoclue-glib/ :

make[3]: Entering directory `/home/gem/opt/maps/geoclue2/src'
gcc -DHAVE_CONFIG_H -I. -I..    -pthread -I/opt/geocode-glib/include/geocode-glib -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gio-unix-2.0/   -DLOCALEDIR="\"/opt/geoclue2/share/locale\"" -g -O2 -w -MT geoclue-gclue-locator.o -MD -MP -MF .deps/geoclue-gclue-locator.Tpo -c -o geoclue-gclue-locator.o `test -f 'gclue-locator.c' || echo './'`gclue-locator.c
In file included from gclue-locator.h:6:0,
                 from gclue-locator.c:4:
/opt/geocode-glib/include/geocode-glib/geocode-glib.h:28:43: fatal error: geocode-glib/geocode-location.h: No such file or directory
 #include <geocode-glib/geocode-location.h>
                                           ^
compilation terminated.
make[3]: *** [geoclue-gclue-locator.o] Error 1

Use "..." style include rather then just stripping <geocode-glib/...>
down to <...> to be consistent with style in
geocode-glib/geocode-ipclient.h, geocode-glib/geocode-place.h and
geocode-glib/geocode-glib-private.h.
Comment 1 Andreas Henriksson 2013-07-03 18:48:07 UTC
Created attachment 248343 [details] [review]
Avoid doubling up on geocode-glib in include path
Comment 2 Bastien Nocera 2013-07-04 11:07:47 UTC
Review of attachment 248343 [details] [review]:

I'd rather do the reverse, keep the namespaced includes, and have the files installed under:
/usr/include/geocode-glib-1.0/geocode-glib/geocode-glib.h

/usr/include/geocode-glib-1.0 would be the in the pkg-config includes.

The versioning of the includes directory allows parallel installation, in case we change the API.
Comment 3 Andreas Henriksson 2013-07-04 13:26:31 UTC
Created attachment 248378 [details] [review]
Make include directory API versioned

Note that this will break users of geocode-glib which did not
use the geocode-glib/ subdirectory prefix in the include path
(like geoclue2), according to how the pkg-config file was layed
out before.

Remaining cleanup is to unify the internal include paths inside
geocode-glib to be either "..." or <geocode-glib/...>.

While forcing geocode-glib uses to update their include paths
and internally cleaning up the include paths, this might also
be a good time to drop the filename prefix on header files
since both subdirectory and filename prefix in include paths
seems redundant.
Comment 4 Andreas Henriksson 2013-07-04 13:29:12 UTC
Please comment on the new patch and if ok I'll follow up with an additional patch to clean up the (internal) include paths in the header files (including or excluding renaming them, however you like it).
Comment 5 Bastien Nocera 2013-07-05 08:22:05 UTC
Review of attachment 248378 [details] [review]:

Looks good.
Comment 6 Andreas Henriksson 2013-07-07 18:59:49 UTC
Created attachment 248558 [details] [review]
Make include directory API versioned

Note that this will break users of geocode-glib which did not
use the geocode-glib/ subdirectory prefix in the include path
(like geoclue2), according to how the pkg-config file was layed
out before.

Remaining cleanup is to unify the internal include paths inside
geocode-glib to be either "..." or <geocode-glib/...>.

While forcing geocode-glib uses to update their include paths
and internally cleaning up the include paths, this might also
be a good time to drop the filename prefix on header files
since both subdirectory and filename prefix in include paths
seems redundant.
Comment 7 Andreas Henriksson 2013-07-07 19:00:00 UTC
Created attachment 248559 [details] [review]
Unify include paths to be the same everywhere

Change from "geocode-*.h" and <geocode-*.h> to
<geocode-glib/geocode-*.h> where it wasn't using
that style already.
Comment 8 Andreas Henriksson 2013-07-07 19:00:04 UTC
Created attachment 248560 [details] [review]
Symlink geocode-glib.h into subdir to avoid breakage

Atleast geoclue2 does #include <geocode-glib.h>
which will break with the new api-versioned
include path with additional subdirectory.
This is a workaround to avoid causing breakage
until everyone has updated their include paths.
Comment 9 Andreas Henriksson 2013-07-07 19:27:12 UTC
Rebased on current master (no real changes to first patch) with two additional patches. Please tell me if you see any reason it's not ok to push those as well. 

(Might drop the last one if I can sync with zeenix about pushing a fix for geocode2 at the same time, but haven't been able to reach him yet.... fwiw, Empathy seems fine without it and I don't know of any other users of geocode-glib to check.)
Comment 10 Andreas Henriksson 2013-07-10 08:38:32 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 11 Bastien Nocera 2013-07-10 11:18:07 UTC
Can you please avoid committing patches when they haven't been reviewed?
Comment 12 Bastien Nocera 2013-07-10 11:20:18 UTC
Comment on attachment 248560 [details] [review]
Symlink geocode-glib.h into subdir to avoid breakage

I'd rather we fixed the (very few) users of the API. geocode-glib is unstable right now so breakage is expected.
Comment 13 Bastien Nocera 2013-07-10 11:20:42 UTC
I've reverted that last patch.
Comment 14 Andreas Henriksson 2013-07-10 11:39:10 UTC
Ok... zeenix is on vacation right now, so geoclue2 probably won't be fixed for some time...
Comment 15 Allison Karlitskaya (desrt) 2013-07-12 17:29:11 UTC
The "Symlink geocode-glib.h into subdir to avoid breakage" patch doesn't appear to have been reverted and it's breaking DESTDIR installs (eg: jhbuild).

Someone should actually revert that...
Comment 16 Matthias Clasen 2013-07-12 17:46:39 UTC
zeenix should be back next week, anyway
Comment 17 Bastien Nocera 2013-07-12 20:18:10 UTC
The revert is now pushed (my dead SSD probably has that patch...).

geoclue2 will be broken until somebody pushes a (trivial) fix.