Bug 1626684 - Make ambiguous python shebangs error
Summary: Make ambiguous python shebangs error
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: Changes Tracking
Version: 30
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-09-07 21:17 UTC by Ben Cotton
Modified: 2019-08-27 10:55 UTC (History)
4 users (show)

Fixed In Version: redhat-rpm-config-120-1.fc30
Clone Of:
Environment:
Last Closed: 2019-08-27 10:55:35 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ben Cotton 2018-09-07 21:17:50 UTC
This is a tracking bug for Change: Make ambiguous python shebangs error
For more details, see: https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error

The /usr/lib/rpm/redhat/brp-mangle-shebangs buildroot policy script will be changed to make the build fail when it sees an ambiguous python shebang, such as #!/usr/bin/python or #!/usr/bin/env python. (The script has been warning in these cases for 2 Fedora releases already, saying This will become an ERROR.)

Comment 1 Miro Hrončok 2018-09-09 20:50:39 UTC
Upstream PR: https://github.com/fedora-python/brp-mangle-shebangs/pull/1

Comment 2 Miro Hrončok 2018-09-09 20:53:23 UTC
Note to self from https://pagure.io/fesco/issue/1979#comment-530129

I'll work with Taskotron people to get the list of packages where this [the Taskotron check for ambiguous python shebang] failed for the latest rawhide build and I will send an e-mail to the maintainers.

Comment 3 Miro Hrončok 2018-09-10 11:27:54 UTC
(In reply to Miro Hrončok from comment #2)
> Note to self from https://pagure.io/fesco/issue/1979#comment-530129
> 
> I'll work with Taskotron people to get the list of packages where this [the
> Taskotron check for ambiguous python shebang] failed for the latest rawhide
> build and I will send an e-mail to the maintainers.

https://lists.fedoraproject.org/archives/list/python-devel%40lists.fedoraproject.org/message/TYCAE254X7TQZAYONW2TRQ53QLA5WSIT/

Comment 4 Gwyn Ciesla 2018-09-10 14:59:15 UTC
Please update the wiki page to specify that if a package using this tool is python2, it must BR python2-devel in order to use the macros as specified. Many packages with shebangs needing fixing don't otherwise need to BR python2-devel.

Comment 5 Miro Hrončok 2018-09-10 15:06:40 UTC
Added:

Note: The examples bellow use some python macros (%{__pythonX} and %{pyX_shbang_opts}). BuildRequire python3-devel (and/or python2-devel) to get those.

Comment 6 Miro Hrončok 2018-09-10 16:28:04 UTC
Fedora PR: https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/39

Comment 7 Gwyn Ciesla 2018-09-10 16:30:25 UTC
Thank you!

Comment 8 Miro Hrončok 2018-09-18 13:22:03 UTC
Built in rawhide. Ambiguous python shebang will error from now on.

https://koji.fedoraproject.org/koji/taskinfo?taskID=29749600

The fact is documented in https://fedoraproject.org/wiki/Packaging:Python#Multiple_Python_Runtimes

Comment 9 Adam Williamson 2019-01-28 16:43:39 UTC
How is this *possibly* a self-contained change? Isn't it more or less the exact *opposite* of a self-contained change, given that its entire impact is on the building of other packages?

Comment 10 Miro Hrončok 2019-01-28 17:03:58 UTC
This is how:

1. there was a warning already for 2 releases
2. the fix is trivial
3. FESCo approved it as a self contained change as long as I e-mail the maintainers of affected packages
4. the impact is on limited set of packages only

I guess this might have been a system wide change, but it would not change anything about how this was executed. Also it was implemented early, so there was plenty of time.

Note that if this blocks you anyhow, I'm always happy to help.

How would this be any better as a system wide change?

Comment 11 Adam Williamson 2019-01-28 17:22:28 UTC
"How would this be any better as a system wide change?"

It would make us more likely to notice it as something that could potentially affect the distro overall when reviewing the Change list, as the list is split into system-wide (at the top) and self-contained (at the bottom). Though I tend not to trust the distinction any more so I do wind up looking at all of them anyway. :)

Comment 12 Miro Hrončok 2019-01-28 17:51:33 UTC
Note to self: Consult QA on future self-contained change proposals about system wide potential.

Comment 13 Adam Williamson 2019-01-28 22:31:11 UTC
to be clear - I'm not actually too worried about this Change at all, as you say, the error is clear and it is always going to be an easy fix. It just seemed like an obvious category error when I was browsing the list.


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