Bug 539635

Summary: Noise from brp-python-bytecompile for non-python packages
Product: [Fedora] Fedora Reporter: Dave Malcolm <dmalcolm>
Component: rpmAssignee: Panu Matilainen <pmatilai>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: ffesti, jnovy, pmatilai
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 557607 (view as bug list) Environment:
Last Closed: 2009-12-08 14:39:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 530636    

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