GNU bug report logs - #64573
[PATCH 0/3] guix: build: python-build-system: Have applications by default ignore non-Guix libraries in user site dir

Previous Next

Package: guix-patches;

Reported by: Wojtek Kosior <koszko <at> koszko.org>

Date: Tue, 11 Jul 2023 18:13:01 UTC

Severity: normal

Tags: patch

Done: Wojtek Kosior <koszko <at> koszko.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 64573 <at> debbugs.gnu.org (full text, mbox):

From: Wojtek Kosior <koszko <at> koszko.org>
To: Lars-Dominik Braun <lars <at> 6xq.net>
Cc: 64573 <at> debbugs.gnu.org, jgart <jgart <at> dismail.de>
Subject: Re: [bug#64573] [PATCH 0/3] guix: build: python-build-system: Have
 applications by default ignore non-Guix libraries in user site dir
Date: Mon, 17 Jul 2023 16:23:08 +0200
[Message part 1 (text/plain, inline)]
Hi, thanks for reviewing the series

> > These patches modify the python-build-system's procedure responsible for
> > wrapping executables. The modified proc defines a PYTHONNOUSERSITE variable
> > which makes Python applications disregard the user site dir when loading
> > libraries.  
> 
> if we’re patching applications like pip anyways, what stops us from
> just setting site.ENABLE_USER_SITE to False globally in Python’s
> site.py?

I think it would need to be set to True, not False, to have the desired
effect on Guix-installed pip application.

However, we want our change to only affect applications installed with
Guix. So that the user could theoretically still do e.g.

    python3 -m pip install --ignore-installed pip
    ~/.local/bin/pip install xmldiff

Rn I don't see a better way to achieve this than patching
python-build-system and applications like pip.

> Note that our python package currently (unfortunately) bundles and
> exposes pip (through the pip3 command), which would not be affected by
> your change to the python-pip package.

I haven't been aware of that, thanks. Fortunately, the bundled pip is
also unaffected by the change to python-build system. So although this
patch series fails to harden it, it doesn't break it either.

> Also note that we have *two* build systems for Python right now
> (python-build-system and pyproject-build-system) and the new flag
> disable-user-site? would have to be added to both, even though they
> share the wrap phase.

Fair point, thanks.

Should I send an updated patch series that also adds this flag to
pyproject-build-system? And should I include a patch that modifies the
python's bundled pip analogously to how I did with the python-pip
package?

Best,
Wojtek
[Message part 2 (application/pgp-signature, inline)]

This bug report was last modified 1 year and 301 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.