Bug 539635 - Noise from brp-python-bytecompile for non-python packages
Summary: Noise from brp-python-bytecompile for non-python packages
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: Python3F13
TreeView+ depends on / blocked
 
Reported: 2009-11-20 18:39 UTC by Dave Malcolm
Modified: 2009-12-08 14:39 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
: 557607 (view as bug list)
Environment:
Last Closed: 2009-12-08 14:39:27 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Dave Malcolm 2009-11-20 18:39:36 UTC
From: https://www.redhat.com/archives/fedora-devel-list/2009-November/msg01536.html

On Fri, 2009-11-20 at 09:53 -0700, Jerry James wrote:
I'm looking into the build failures Matt identified.  With my shiny
> new Rawhide VM, I'm seeing this output on a local build of a package
> with no python sources:
> 
> [ ... successful build messages ...]
> + /usr/lib/rpm/brp-python-bytecompile
> Bytecompiling .py files below [BUILDROOT]/usr/lib*/python*/ using
> /usr/bin/python*
> Usage: /usr/bin/python-config
> [--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--help]
> Usage: /usr/bin/python-config
> [--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--help]
> + /usr/lib/rpm/redhat/brp-python-hardlink
> [ ... successful build messages ...]
> 
> The rpm build is completing, so I'm not worried about this particular
> package.  Is this going to cause problems with packages that do have
> python sources, or is this just because nothing matches
> /usr/lib*/python*/ in the build root?  It looks like python_binary =
> /usr/bin/python*, which can match any of these:
> 
> /usr/bin/python
> /usr/bin/python-config
> /usr/bin/python2
> /usr/bin/python2.6
> /usr/bin/python2.6-config
> 
Sorry; looks like my fault.

I updated /usr/lib/rpm/brp-python-bytecompile to better cope with the python 2 vs python 3 split; this was in bug 531117.

From my reading, what's happening is that I coded it with the (incorrect) assumption that files exist which match   
  $RPM_BUILD_ROOT/usr/lib*/python*/

When at least one such file exists, I believe the shell expands the glob and thus we iterate over the library subdirectories, byte-compiling all .py files in them with the appropriate version of python.

When no such directory exists, the shell fails to expand it, and retains it as the text string:
  your_build_root/usr/lib*/python*/
and thus one iteration of that loop happens, and we get the two error messages.

So I believe this is harmless but messy.

Comment 1 Panu Matilainen 2009-12-08 14:39:27 UTC
Harmless but ugly... fixed in rpm-4.8.0-0.beta1.2


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