[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 1/6] configure: Look for auxiliary Python installations
From: |
Eric Blake |
Subject: |
Re: [PATCH v3 1/6] configure: Look for auxiliary Python installations |
Date: |
Fri, 24 Feb 2023 12:04:32 -0600 |
User-agent: |
NeoMutt/20220429 |
On Tue, Feb 21, 2023 at 12:03:44PM +0100, Paolo Bonzini wrote:
> >
> > This configure loop will prefer, in order:
> >
> > 1. Whatever is specified in $PYTHON
> > 2. python3
> > 3. python (Which is usually 2.x, but might be 3.x on some platforms.)
> > 4. python3.11 down through python3.6
> >
> > +
> > python=
> > +first_python=
> > explicit_python=no
> > -for binary in "${PYTHON-python3}" python
> > +# Check for $PYTHON, python3, python, then explicitly-versioned
> > interpreters.
> > +for binary in "${PYTHON-python3}" ${PYTHON:+python3} python \
> > + python3.11 python3.10 python3.9 \
> > + python3.8 python3.7 python3.6
>
> I think if PYTHON is set we shouldn't look at anything else.
Now that you mention that, it does sound more like what autoconf does
(if the user specified something, honor it; otherwise, find the best
match in a list of candidates).
>
> Paolo
>
> > do
> > if has "$binary"
> > then
> > python=$(command -v "$binary")
> > - break
> > + if test -z "$first_python"; then
> > + first_python=$python
> > + fi
> > + if check_py_version "$python"; then
> > + # This one is good.
> > + first_python=
> > + break
> > + fi
One easy way to do that is add this here:
if test -n "$PYTHON"; then break; fi
> > fi
> > done
> > +# If first_python is set, we didn't find a suitable binary.
> > +# Use this one for possible future error messages.
> > +if test -n "$first_python"; then
> > + python="$first_python"
> > +fi
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
- [PATCH v3 0/6] Python: Drop support for Python 3.6, John Snow, 2023/02/20
- [PATCH v3 6/6] Python: Drop support for Python 3.6, John Snow, 2023/02/20
- [PATCH v3 3/6] DO-NOT-MERGE: testing: Add Python >= 3.7 to Centos, OpenSuSE, John Snow, 2023/02/20
- [PATCH v3 5/6] meson: prefer 'sphinx-build' to 'sphinx-build-3', John Snow, 2023/02/20
- Re: [PATCH v3 5/6] meson: prefer 'sphinx-build' to 'sphinx-build-3', Markus Armbruster, 2023/02/21
- Re: [PATCH v3 5/6] meson: prefer 'sphinx-build' to 'sphinx-build-3', John Snow, 2023/02/21
- Re: [PATCH v3 5/6] meson: prefer 'sphinx-build' to 'sphinx-build-3', Markus Armbruster, 2023/02/22
- Re: [PATCH v3 5/6] meson: prefer 'sphinx-build' to 'sphinx-build-3', John Snow, 2023/02/22
- Re: [PATCH v3 5/6] meson: prefer 'sphinx-build' to 'sphinx-build-3', Markus Armbruster, 2023/02/23
- Re: [PATCH v3 5/6] meson: prefer 'sphinx-build' to 'sphinx-build-3', Paolo Bonzini, 2023/02/23