Bug 852234

Summary: pcp 3.6.6-1 pcp.py fails to compile with python2.4 in epel5
Product: [Fedora] Fedora EPEL Reporter: Mark Goodwin <mgoodwin>
Component: pcpAssignee: Mark Goodwin <mgoodwin>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: el5CC: fche, mgoodwin, nathans, scox
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-10-18 21:37:14 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Attachments:
Description Flags
patch for pcp.py to compile on epel5 with python2.4
none
patch for pmcollectl.py to compile on epel5 none

Description Mark Goodwin 2012-08-27 19:53:00 EDT
building pcp-3.6.6-1 against el5-candidate fails with python4.7 syntax errors.
These errors do not occur with more recent targets (e.g. python2.7 in 
f17-candidate).

=== python ===
python setup.py install --skip-build --root=${DIST_ROOT-/} --record=../../python-pcp.list
running install
running install_lib
creating /var/tmp/pcp-3.6.6-1.el5-root-mockbuild/usr/lib64/python2.4
creating /var/tmp/pcp-3.6.6-1.el5-root-mockbuild/usr/lib64/python2.4/site-packages
copying build/lib.linux-x86_64-2.4/pmapi.so -> /var/tmp/pcp-3.6.6-1.el5-root-mockbuild/usr/lib64/python2.4/site-packages
copying build/lib.linux-x86_64-2.4/pcp.py -> /var/tmp/pcp-3.6.6-1.el5-root-mockbuild/usr/lib64/python2.4/site-packages
copying build/lib.linux-x86_64-2.4/pcpi.py -> /var/tmp/pcp-3.6.6-1.el5-root-mockbuild/usr/lib64/python2.4/site-packages
byte-compiling /var/tmp/pcp-3.6.6-1.el5-root-mockbuild/usr/lib64/python2.4/site-packages/pcp.py to pcp.pyc
  File "/usr/lib64/python2.4/site-packages/pcp.py", line 137
    except KeyError as e:
                     ^
SyntaxError: invalid syntax
byte-compiling /var/tmp/pcp-3.6.6-1.el5-root-mockbuild/usr/lib64/python2.4/site-packages/pcpi.py to pcpi.pyc
writing list of installed files to '../../python-pcp.list'
/usr/bin/gawk --posix '{print} /.pyc$/ {sub(/.pyc$/,".pyo"); print}' < ../../python-pcp.list > ../../python-pcp.list.rpm

After fixing that by 's/as e:/:/', the next build error was :

=== python ===
python setup.py install --skip-build --root=${DIST_ROOT-/} --record=../../python-pcp.list
running install
running install_lib
creating /var/tmp/pcp-3.6.6-1.el5-root-mockbuild/usr/lib64/python2.4
creating /var/tmp/pcp-3.6.6-1.el5-root-mockbuild/usr/lib64/python2.4/site-packages
copying build/lib.linux-x86_64-2.4/pmapi.so -> /var/tmp/pcp-3.6.6-1.el5-root-mockbuild/usr/lib64/python2.4/site-packages
copying build/lib.linux-x86_64-2.4/pcpi.py -> /var/tmp/pcp-3.6.6-1.el5-root-mockbuild/usr/lib64/python2.4/site-packages
copying build/lib.linux-x86_64-2.4/pcp.py -> /var/tmp/pcp-3.6.6-1.el5-root-mockbuild/usr/lib64/python2.4/site-packages
byte-compiling /var/tmp/pcp-3.6.6-1.el5-root-mockbuild/usr/lib64/python2.4/site-packages/pcpi.py to pcpi.pyc
byte-compiling /var/tmp/pcp-3.6.6-1.el5-root-mockbuild/usr/lib64/python2.4/site-packages/pcp.py to pcp.pyc
  File "/usr/lib64/python2.4/site-packages/pcp.py", line 289
    return "pmValueSet@%#lx id=%#lx numval=%d valfmt=%d" % (addressof(self), self.pmid, self.numval, self.valfmt) + (str([" %s" % str(self.vlist[i]) for i in xrange(self.numval)])) if self.valfmt == 0 else ""
                                                                                                                                                                                      ^
SyntaxError: invalid syntax
writing list of installed files to '../../python-pcp.list'
/usr/bin/gawk --posix '{print} /.pyc$/ {sub(/.pyc$/,".pyo"); print}' < ../../python-pcp.list > ../../python-pcp.list.rpm

at which point I gave up. Note also that despite the build failure
the build continued rather than failing, resulting in rpm packaging errors
later on :

Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/pcp-3.6.6-1.el5-root-mockbuild
RPM build errors:
    ...
    File not found: /var/tmp/pcp-3.6.6-1.el5-root-mockbuild/usr/lib64/python2.4/site-packages/pcp.pyc
    File not found: /var/tmp/pcp-3.6.6-1.el5-root-mockbuild/usr/lib64/python2.4/site-packages/pcp.pyo
Child return code was: 1
EXCEPTION: Command failed. See logs for output.
Comment 1 Mark Goodwin 2012-08-27 19:55:06 EDT
Full build log (after fixing the first error) is at :
http://kojipkgs.fedoraproject.org//work/tasks/7886/4427886/build.log
Comment 2 Mark Goodwin 2012-08-27 19:56:38 EDT
sorry: in the above report I mean python2.4 (fails) and python2.7 (works).
Comment 3 Mark Goodwin 2012-08-28 03:04:49 EDT
Created attachment 607421 [details]
patch for pcp.py to compile on epel5 with python2.4

patch to get the epel5 build working, but then pmcollectl needs some work too ...
Comment 4 Mark Goodwin 2012-08-28 03:12:50 EDT
Created attachment 607424 [details]
patch for pmcollectl.py to compile on epel5

patched pmcollectl will compile on epel5, but then it has missing modules
when you try and run it on RHEL5 :

# /tmp/pmcollectl.py 
Traceback (most recent call last):
  File "/tmp/pmcollectl.py", line 35, in ?
    import argparse
ImportError: No module named argparse

So I think this is an uphill battle. We should just make a spec change to
not support python-pcp on RHEL5 (and don't build it or package it for 
el5-candidate).

Longer term, python2.7 for RHEL5 does unofficially exist,
e.g. see http://ftp.srce.hr/redhat/test/el5/x86_64/
So we could push that into epel5 at some point.
Comment 5 Mark Goodwin 2012-08-28 19:56:50 EDT
For the record, the patch in Comment #3 (pcp.py) made it into pcp-3.6.6-1
since it was causing an el5 build failure. We didn't take the pmcollectl
patch at this stage.
Comment 6 Nathan Scott 2012-10-18 21:37:14 EDT
This issue has been resolved in the now released pcp-3.6.9.
Comment 7 Fedora Update System 2012-10-25 18:18:09 EDT
pcp-3.6.9-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/pcp-3.6.9-1.el5
Comment 8 Fedora Update System 2012-10-25 18:18:41 EDT
pcp-3.6.9-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/pcp-3.6.9-1.fc18
Comment 9 Fedora Update System 2012-10-25 18:19:09 EDT
pcp-3.6.9-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/pcp-3.6.9-1.fc16
Comment 10 Fedora Update System 2012-10-25 18:19:36 EDT
pcp-3.6.9-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/pcp-3.6.9-1.el6
Comment 11 Fedora Update System 2012-10-25 18:20:06 EDT
pcp-3.6.9-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/pcp-3.6.9-1.fc17