lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200304093138.6aced5a0@coco.lan>
Date:   Wed, 4 Mar 2020 09:31:38 +0100
From:   Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To:     Markus Heiser <markus.heiser@...marit.de>
Cc:     "Bird, Tim" <Tim.Bird@...y.com>, Jonathan Corbet <corbet@....net>,
        "tbird20d@...il.com" <tbird20d@...il.com>,
        "linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] scripts/sphinx-pre-install: add '-p python3' to
 virtualenv

Em Wed, 4 Mar 2020 07:20:48 +0100
Markus Heiser <markus.heiser@...marit.de> escreveu:

> Am 04.03.20 um 06:42 schrieb Mauro Carvalho Chehab:
> > Em Tue, 3 Mar 2020 17:07:48 +0000
> > "Bird, Tim" <Tim.Bird@...y.com> escreveu:
> >   
> >>> -----Original Message-----
> >>> From: Jonathan Corbet <corbet@....net>
> >>>
> >>> On Mon, 24 Feb 2020 18:34:41 -0700
> >>> tbird20d@...il.com wrote:
> >>>      
> >>>> With Ubuntu 16.04 (and presumably Debian distros of the same age),
> >>>> the instructions for setting up a python virtual environment should
> >>>> do so with the python 3 interpreter.  On these older distros, the
> >>>> default python (and virtualenv command) might be python2 based.
> >>>>
> >>>> Some of the packages that sphinx relies on are now only available
> >>>> for python3.  If you don't specify the python3 interpreter for
> >>>> the virtualenv, you get errors when doing the pip installs for
> >>>> various packages
> >>>>
> >>>> Fix this by adding '-p python3' to the virtualenv recommendation
> >>>> line.
> >>>>
> >>>> Signed-off-by: Tim Bird <tim.bird@...y.com>  
> >>>
> >>> I've applied this, even though it feels a bit fragile to me.  But Python
> >>> stuff can be a bit that way, sometimes, I guess.  
> >>
> >> I agree it seems a bit wonky.  
> > 
> > Well, we could, instead, add some code that would be checking python and pip
> > versions, but still distros could be doing some backports with could
> > cause side-effects. So, checking for distro versions as done in this patch
> > seems a lot safer.
> >   
> >> The less fragile approach would have been to just
> >> always add the '-p python3' option to the virtualenv setup hint,
> >> but Mauro seemed to want something more fine-tuned.  
> > 
> > Yeah, I asked for a more fine-tuned version.
> > 
> > Depending on python/pip version, adding a -p python3 seems to cause
> > troubles (at least I found some bug reports about that). I may be
> > wrong (it was a long time ago), but, before adding the logic that checks
> > for "python3" I guess I tried first add -p python3, but, back then,
> > I found some troubles (probably with some old Fedora version).
> > 
> > So, better to use this syntax only on distros we know it will
> > work as expected.
> >   
> >> As far as the string parsing goes, I think that the format of strings
> >> returned by lsb-release (and the predecesors that sphinx_pre_install
> >> checks) is unlikely to change.  
> > 
> > Since when we added this script, we didn't have any troubles yet with
> > the part of the code with checks the distribution version. So, I guess
> > that the lsb-release related checks are pretty much reliable.
> >   
> 
> With py3 the recommended way to install virtual environments is::
> 
>    python3 -m venv sphinx-env
> 
> This (python3) is what worked for me on RHEL/CentOS (dnf),
> archlinux and debian/ubuntu (tested from 16.04 up to 20.04).

Hmm... from:

	https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/

This works since Python version 3.3. It sounds doable to use it.

Yet, if we'll be switching to this method, the script should check if
the version is 3.3 or newer. The logic inside get_sphinx_fname() would 
also require some changes, as it won't need to install anymore the 
virtualenv program for Python >= 3.3.

> 
> I am not familiar with the sphinx-pre-install script but may be
> one of you is able to apply such a patch?
> 
> 
>   -- Markus --


Thanks,
Mauro

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ