Bug 1508947 - glusterfs: Include path in pkgconfig file is wrong
Summary: glusterfs: Include path in pkgconfig file is wrong
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: libgfapi
Version: mainline
Hardware: All
OS: All
unspecified
low
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact: bugs@gluster.org
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-02 14:40 UTC by Andrea Bolognani
Modified: 2018-03-15 11:19 UTC (History)
1 user (show)

Fixed In Version: glusterfs-4.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-15 11:19:42 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Andrea Bolognani 2017-11-02 14:40:42 UTC
Description of problem:

  The include path in glusterfs-api.pc looks like

    -I${includedir}/glusterfs

  However, client code will include the glusterfs headers using

    #include <glusterfs/api/glfs.h>

  rather than

    #include <api/glfs.h>

  which makes the "/glusterfs" part entirely unnecessary.

  More importantly, on some platforms such as FreeBSD, the header
  files for glusterfs will be installed in /usr/local/include,
  which is *not* part of the compiler's default include path, so
  compilation will fail with something like

    fatal error: 'glusterfs/api/glfs.h' file not found
    #include <glusterfs/api/glfs.h>
             ^~~~~~~~~~~~~~~~~~~~~~

  This prevents libvirt (and undoubtedly other software) to enable
  glusterfs support on FreeBSD.


Version-Release number of selected component (if applicable):

  glusterfs.git master


How reproducible:

  Always.


Steps to Reproduce:

  1. Build and install glusterfs
  2. Build libvirt with glusterfs support enabled


Actual results:

  libvirt can't be built.


Expected results:

  libvirt can be built :)

Comment 1 Worker Ant 2017-11-02 14:46:31 UTC
REVIEW: https://review.gluster.org/18576 (*.pc: Fix include path in Cflags) posted (#2) for review on master by Andrea Bolognani

Comment 2 Worker Ant 2017-11-08 11:12:10 UTC
COMMIT: https://review.gluster.org/18576 committed in master by  

------------- *.pc: Fix include path in Cflags

The include path in glusterfs-api.pc looks like

  -I${includedir}/glusterfs

However, client code will include the glusterfs headers using

  #include <glusterfs/api/glfs.h>

rather than

  #include <api/glfs.h>

which makes the "/glusterfs" part entirely unnecessary.

More importantly, on some platforms such as FreeBSD, the header files
for glusterfs will be installed in /usr/local/include, which is *not*
part of the compiler's default include path, so compilation will fail
with something like

  fatal error: 'glusterfs/api/glfs.h' file not found
  #include <glusterfs/api/glfs.h>
           ^~~~~~~~~~~~~~~~~~~~~~

The fix is to simply drop the extra "/glusterfs". The same change
is applied to other *.pc files as well, althought I haven't actually
tested those.

A test program (gfapi-load-volfile) and the glfsxmp example
application were using the wrong include paths, so they had to be
fixed as well.

Change-Id: I9a16de47fee7ab9c12d1cb823bbe061a69352670
BUG: 1508947
Signed-off-by: Andrea Bolognani <abologna>

Comment 3 Shyamsundar 2018-03-15 11:19:42 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-4.0.0, please open a new bug report.

glusterfs-4.0.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://lists.gluster.org/pipermail/announce/2018-March/000092.html
[2] https://www.gluster.org/pipermail/gluster-users/


Note You need to log in before you can comment on or make changes to this bug.