Bug 813651

Summary: FTBFS of bash-completion-1.99-1 (attempt to byte-compile shell scripts)
Product: [Fedora] Fedora Reporter: Matěj Cepl <mcepl>
Component: bash-completionAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: mcepl, sheltren, ville.skytta
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-22 18:55:56 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:
Attachments:
Description Flags
suggested patch on .spec file none

Description Matěj Cepl 2012-04-18 06:41:51 UTC
Created attachment 578244 [details]
suggested patch on .spec file

Description of problem:
bash-completion contains in completions one shell script and three other symlinks called *.py. rpmbuild tries to run /usr/lib/rpm/brp-python-bytecompile on those scripts with disasterous results:

+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
Compiling /builddir/build/BUILDROOT/bash-completion-1.99-1.fc18.noarch/usr/share/bash-completion/completions/asciidoc.py ...
SyntaxError: ('invalid syntax', ('/usr/share/bash-completion/completions/asciidoc.py', 5, 15, '    COMPREPLY+=( $( compgen -W \'article book manpage\' -- "$cur" ) )\n'))
Compiling /builddir/build/BUILDROOT/bash-completion-1.99-1.fc18.noarch/usr/share/bash-completion/completions/btdownloadcurses.py ...
SyntaxError: ('invalid syntax', ('/usr/share/bash-completion/completions/btdownloadcurses.py', 5, 13, '    local cur prev words cword\n'))
Compiling /builddir/build/BUILDROOT/bash-completion-1.99-1.fc18.noarch/usr/share/bash-completion/completions/btdownloadgui.py ...
SyntaxError: ('invalid syntax', ('/usr/share/bash-completion/completions/btdownloadgui.py', 5, 13, '    local cur prev words cword\n'))
Compiling /builddir/build/BUILDROOT/bash-completion-1.99-1.fc18.noarch/usr/share/bash-completion/completions/btdownloadheadless.py ...
SyntaxError: ('invalid syntax', ('/usr/share/bash-completion/completions/btdownloadheadless.py', 5, 13, '    local cur prev words cword\n'))
RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.57NPQT (%install)
    Macro %__isa_name has empty body
    Macro %__isa_bits has empty body
    Bad exit status from /var/tmp/rpm-tmp.57NPQT (%install)
Child returncode was: 1
EXCEPTION: Command failed. See logs for output.

(tried also in koji http://koji.fedoraproject.org/koji/taskinfo?taskID=4000853)

Version-Release number of selected component (if applicable):
bash-completion-1.99-1.fc18

How reproducible:
100% (even in koji)

Steps to Reproduce:
1.rpmbuild --rebuild bash-completion-1.99-1.fc18.src.rpm
2.
3.
  
Actual results:
build fails

Expected results:
it shouldn't

Additional info:
As bash-completion really doesn't contain any true Python scripts, the best line of attack is IMHO just to switch of bytecompilation of Python scripts (see https://fedoraproject.org/wiki/Packaging:Python#Bytecompiling_with_the_correct_python_version) by adding this redefinition to the top of the spec file (on one line):

%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

see attached diff

Comment 1 Ville Skyttä 2012-05-31 19:18:10 UTC
Thanks for the report.  This seems to be a cleaner fix:

    %global _python_bytecompile_errors_terminate_build 0

Comment 2 Fedora Update System 2012-06-19 17:32:02 UTC
bash-completion-2.0-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/bash-completion-2.0-1.fc17

Comment 3 Fedora Update System 2012-06-20 19:31:50 UTC
Package bash-completion-2.0-1.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing bash-completion-2.0-1.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-9735/bash-completion-2.0-1.fc17
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2012-06-22 18:55:56 UTC
bash-completion-2.0-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.