pcp
[Top] [All Lists]

pcp chroot build broken

To: pcp <pcp@xxxxxxxxxxx>
Subject: pcp chroot build broken
From: Mark Goodwin <mgoodwin@xxxxxxxxxx>
Date: Fri, 03 Feb 2012 14:25:52 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0

This commit breaks a chroot build where pcp headers are not installed:

  commit 878062a4532dd31328f7f3595bf99202b2407ba1
  Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
  Date:   Wed Dec 28 10:25:33 2011 +1100

    Drive a stake into the heart of the symlinked <pcp> in the build

    We don't need
        ln -s $(TOPDIR)/src/include pcp
    throughout the build.

    There was a previous attempt to clean this up, but some of the PMDAs
    were apparently spared ... no such mercy this time!


I agree it's time this cruft was purged, but for now it's busted - the
rpmbuild driven chroot build fails in src/pmdas/simple/simple.h :

=== simple ===
gcc -fpic -fno-strict-aliasing -D_GNU_SOURCE -I. -Wall -g -DPCP_DEBUG -DPCP_VERSION=\"3.5.12\" -DASYNC_API -I../../../src/include -c -o simple.o simple.c
simple.c:21:23: fatal error: pcp/pmapi.h: No such file or directory
compilation terminated.
gmake[3]: *** [simple.o] Error 1
gmake[2]: *** [default_pcp] Error 2
gmake[1]: *** [default_pcp] Error 2
gmake[1]: Leaving directory `/builddir/build/BUILD/pcp-3.5.12/src'
make: *** [default_pcp] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.TBb4cw (%build)

It would also fail in a non-chroot build on a system that doesn't have
pcp-libs-devel installed.

There are a few ways to finally fix this :

(a) move src/include/*.h to src/include/pcp/*.h and then change all
    code to e.g. #include <pcp/pmapi.h>, or

(b) change all affected code to e.g. #include "pmapi.h" rather than
    #include <pcp/pmapi.h>, or

(c) in src/include, symlink pcp -> . (see attached patch).

We need to fix this - at the moment we're exposed to subtle errors
where some code is including /usr/include/pcp/*.h yet other code is
including those headers directly from the source tree.

I prefer (a), at least because our demo code is clean and consistent.

Thoughts?

-- Mark


Attachment: fix_pcp_include.patch
Description: Text Data

<Prev in Thread] Current Thread [Next in Thread>