#945 Koji build fail due to ambiguous python shebang.
Closed: Fixed 3 years ago Opened 3 years ago by franzh.

When I was building koji on RHEL8, I got errors:

DEPRECATION WARNING: python2 invoked with /usr/bin/python.
    Use /usr/bin/python3 or /usr/bin/python2
    /usr/bin/python will be removed or switched to Python 3 in the future.
    If you cannot make the switch now, please follow instructions at https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build#Quick_Opt-Out
DEPRECATION WARNING: python2 invoked with /usr/bin/python.
    Use /usr/bin/python3 or /usr/bin/python2
    /usr/bin/python will be removed or switched to Python 3 in the future.
    If you cannot make the switch now, please follow instructions at https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build#Quick_Opt-Out
+ /usr/lib/rpm/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-mangle-shebangs '' ''
*** ERROR: ambiguous python shebang in /usr/sbin/koji-shadow: #!/usr/bin/python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/sbin/kojivmd: #!/usr/bin/python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/sbin/kojira: #!/usr/bin/python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/sbin/kojid: #!/usr/bin/python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/sbin/koji-gc: #!/usr/bin/python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/lib/python2.7/site-packages/koji/context.py: #!/usr/bin/python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/libexec/kojid/mergerepos: #!/usr/bin/python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/bin/koji: #!/usr/bin/python. Change it to python3 (or python2) explicitly.
error: Bad exit status from /var/tmp/rpm-tmp.yzCUno (%install)

After discussing with @mikem , we will default use /usr/bin/python2 to run scripts.

Scripts need to update:

$ grep -rnH '^#!/usr/bin/python' .
./builder/kojid:1:#!/usr/bin/python
./builder/mergerepos:1:#!/usr/bin/python
./tests/test_lib/test_parsers.py:1:#!/usr/bin/python
./tests/test_lib/test_fixEncoding.py:1:#!/usr/bin/python
./runtests:1:#!/usr/bin/python
./vm/kojikamid.py:1:#!/usr/bin/python
./vm/kojivmd:1:#!/usr/bin/python
./util/kojira:1:#!/usr/bin/python
./util/koji-gc:1:#!/usr/bin/python
./util/koji-shadow:1:#!/usr/bin/python
./devtools/fakeweb:1:#!/usr/bin/python
./devtools/fakehub:1:#!/usr/bin/python
./cli/koji:1:#!/usr/bin/python
./koji/context.py:1:#!/usr/bin/python

Metadata Update from @franzh:
- Issue set to the milestone: 1.16.1

3 years ago

Login to comment on this ticket.

Metadata