Re: Fedora 30 Self-Contained Change proposal: Make ambiguous python shebangs error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/22/2018 11:58 AM, Ben Cotton wrote:
> https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error
> 
> == Summary ==
> The <code>/usr/lib/rpm/redhat/brp-mangle-shebangs</code> buildroot
> policy script will be changed to make the build fail when it sees an
> ambiguous python shebang, such as <code>#!/usr/bin/python</code> or
> <code>#!/usr/bin/env python</code>. (The script has been warning in
> these cases for 2 Fedora releases already, saying ''This will become
> an ERROR''.)
> 
> == Owner ==
> * Name: Miro Hrončok (churchyard)
> * Email: <mhroncok@xxxxxxxxxx>
> 
> == Detailed Description ==
> The buildroot policy script in
> <code>/usr/lib/rpm/redhat/brp-mangle-shebangs</code> currently changes
> all python shebangs to python2 with a message like:
> 
>      *** WARNING: mangling shebang in /usr/bin/taskotron_result from
> #!/usr/bin/python to #!/usr/bin/python2. This will become an ERROR,
> fix it manually!
> 
> We will change it to:
> 
>       *** ERROR: ambiguous python shebang in
> /usr/bin/taskotron_result: #!/usr/bin/python. Change it to python3 (or
> python2) explicitly.
> 
> The script will exit with nonzero exit code, rendering the build failed.
> 
> The warning and a promise of the error was there for 2 releases (28
> and 29). Taskotron check was also present.
> 
> There are standard mechanics to avoid this buildroot policy script or
> to block certain files form it. Those remain intact by this change.
> For details see
> https://fedoraproject.org/wiki/Packaging:Guidelines#Shebang_lines and
> https://fedoraproject.org/wiki/Packaging:Guidelines#BRP_.28BuildRoot_Policy.29_Scripts
> sections of the packaging guidelines.
> 
> == Benefit to Fedora ==
> Packagers will be notified by build error if they accidentally have
> python2 shebangs (and python2 dependency) they didn't anticipate. It's
> up to them to decide what to do with such files, no automation can
> know.
> 
> == Scope ==
> * Proposal owners: change the script, change Python Packaging
> Guidelines (https://fedoraproject.org/wiki/Packaging:Python#Multiple_Python_Runtimes)
> 
> * Other developers: fix their packages if they fail because of this
> * Policies and guidelines: Adjust Python Packaging Guidelines
> (https://fedoraproject.org/wiki/Packaging:Python#Multiple_Python_Runtimes)
> slightly.
> 

Is there going to be an RPM macro or script packagers can use to
fix the shebangs in their project or will they need to fix these
manually?

-Tom

> * Trademark approval: N/A (not needed for this Change)
> 
> == How To Test ==
> Have an RPM package that tries to ship files with ambiguous python
> shebang. Observe the warning on Fedora 29 and the error on Fedora 30.
> 
> == User Experience ==
> Users should not notice this, expect there might be less unneeded
> python2 dependencies created by accident.
> 
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux