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

2018-09-03 Thread Miro Hrončok

On 3.9.2018 14:34, Petr Viktorin wrote:

On 08/31/18 13:41, Miro Hrončok wrote:

On 31.8.2018 13:30, Miro Hrončok wrote:

On 31.8.2018 09:05, Igor Gnatenko wrote:
On Wed, Aug 22, 2018 at 10:02 PM Ben Cotton > wrote:


https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error 



    == Summary ==
    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''.)


Why can't we add something like 
`MANGLE_UNVERSIONED_PYTHON_TO=%{__python3}`?



What about the following:

If %_mangle_python_shebnags_to is set, the script will mangle to that 
(unless it's unversioned python again or otherwise invalid).


If %_mangle_python_shebnags_to is not set (the default), the script 
will error (as currently proposed).


Hmm... Given that upstream PEP 394 allows unversioned "python" for 
py2/py3 straddling code, maybe the name could be even shorter?
Maybe what we need is just a way to say the package(r) is aware of 
python3 and the latest (as of now) upstream recommendations. With that 
info, mangling "/usr/bin/env python" to "/usr/bin/python3" is the right 
thing to do.


Probably %_mangle_unversioned_python_shebnags_to becasue that's the only 

    ^^
BTW, if you copy/paste this, be aware there^^ is a typo :)


thing that would be changed.


As Vít pointed out, this is getting needlessly complicated. The packager 
can fix the shebang with a oneliner. Let them do that instead of adding 
an RPM specific oneliner with weird macro definition.


--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok
___
python-devel mailing list -- python-devel@lists.fedoraproject.org
To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org
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/python-devel@lists.fedoraproject.org


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

2018-09-03 Thread Petr Viktorin

On 08/31/18 13:41, Miro Hrončok wrote:

On 31.8.2018 13:30, Miro Hrončok wrote:

On 31.8.2018 09:05, Igor Gnatenko wrote:
On Wed, Aug 22, 2018 at 10:02 PM Ben Cotton > wrote:


https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error 



    == Summary ==
    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''.)


Why can't we add something like 
`MANGLE_UNVERSIONED_PYTHON_TO=%{__python3}`?



What about the following:

If %_mangle_python_shebnags_to is set, the script will mangle to that 
(unless it's unversioned python again or otherwise invalid).


If %_mangle_python_shebnags_to is not set (the default), the script 
will error (as currently proposed).


Hmm... Given that upstream PEP 394 allows unversioned "python" for 
py2/py3 straddling code, maybe the name could be even shorter?
Maybe what we need is just a way to say the package(r) is aware of 
python3 and the latest (as of now) upstream recommendations. With that 
info, mangling "/usr/bin/env python" to "/usr/bin/python3" is the right 
thing to do.


Probably %_mangle_unversioned_python_shebnags_to becasue that's the only 

   ^^
BTW, if you copy/paste this, be aware there^^ is a typo :)


thing that would be changed.



___
python-devel mailing list -- python-devel@lists.fedoraproject.org
To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org
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/python-devel@lists.fedoraproject.org