Bug 1508947

Summary: glusterfs: Include path in pkgconfig file is wrong
Product: [Community] GlusterFS Reporter: Andrea Bolognani <abologna>
Component: libgfapiAssignee: bugs <bugs>
Status: CLOSED CURRENTRELEASE QA Contact: bugs <bugs>
Severity: low Docs Contact:
Priority: unspecified    
Version: mainlineCC: bugs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: glusterfs-4.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-15 11:19:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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/