Bug 813651 - FTBFS of bash-completion-1.99-1 (attempt to byte-compile shell scripts)
FTBFS of bash-completion-1.99-1 (attempt to byte-compile shell scripts)
Product: Fedora
Classification: Fedora
Component: bash-completion (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Ville Skyttä
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-04-18 02:41 EDT by Matěj Cepl
Modified: 2012-06-22 14:55 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-06-22 14:55:56 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
suggested patch on .spec file (355 bytes, patch)
2012-04-18 02:41 EDT, Matěj Cepl
no flags Details | Diff

  None (edit)
Description Matěj Cepl 2012-04-18 02:41:51 EDT
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):

How reproducible:
100% (even in koji)

Steps to Reproduce:
1.rpmbuild --rebuild bash-completion-1.99-1.fc18.src.rpm
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 15:18:10 EDT
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 13:32:02 EDT
bash-completion-2.0-1.fc17 has been submitted as an update for Fedora 17.
Comment 3 Fedora Update System 2012-06-20 15:31:50 EDT
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:
then log in and leave karma (feedback).
Comment 4 Fedora Update System 2012-06-22 14:55:56 EDT
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.

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