2018-02-05 12:00 GMT+01:00 Petr Viktorin <pviktori(a)redhat.com>:
On 02/05/2018 09:32 AM, Guido Aulisi wrote:
>
> Hi,
> according to latest python guides, we should avoid calling generic
> unversioned python command
>
>
(
https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build#...)
>
> But what should we do if it's called inside waf? waf is provided
> upstream, should we patch it to call either python2 or python3, or use
> PYTHON_DISALLOW_AMBIGUOUS_VERSION=0?
>
> I got this problem in recent ardour5 rawhide builds
> (
https://apps.fedoraproject.org/koschei/package/ardour5?collection=f28).
> Now I'm seeing that builds are back to normal and python2 has been
> downgraded.
>
> Thanks
Thanks for the question, and sorry for the inconvenience!
The python2 message is, so far, only a warning. I see the log contains a
different error: "--freedesktop requires itstool > 2.0.0 to translate
files.".
Could you check if that's not causing the failure?
I found that the check for itstool fails because it gets the
deprecation warning as input, there's a mistake in
output = subprocess.Popen("itstool --version", shell=True,
stderr=subprocess.STDOUT,
stdout=subprocess.PIPE).communicate()[0].splitlines()
stderr is redirected to stdout, so itstool gets DEPRECATION and
version [u'WARNING:']
I will report this upstream, it seems to me that the redirection of
stderr is a mistake.
If the python2 message is breaking your build, then please file a bug
and
set an environment variable, as described in the Change. (Do file the bug,
though – that ensures we'll contact you before we remove the workaround.)
Background:
We do want everyone to avoid calling /usr/bin/python, but we realize it's
not always easy. That's why we added the warning -- it will allow us to grep
the logs to figure out what is using it (and why). And of course, in simple
cases it can be fixed right away.
Some tools do fail if there's extra output on stderr; that's the reason for
the "Quick Opt-Out" workaround.
It looks like waf will be one of the tougher things to figure out. After the
mass rebuild we'll see the effect on the whole distribution, and hopefully
come up with a better strategy for bundled waf.
I will file a bug for waf, if it's the correct thing to do.
--
Petr Viktorin
Many thanks for your reply
Guido Aulisi