all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Cc: guix-devel@gnu.org
Subject: Re: Down with PYTHONPATH!
Date: Fri, 14 Jun 2019 23:29:14 +0200	[thread overview]
Message-ID: <875zp7j1p1.fsf@gnu.org> (raw)
In-Reply-To: <87muikr3bq.fsf@mdc-berlin.de> (Ricardo Wurmus's message of "Fri, 14 Jun 2019 10:14:33 +0200")

Hello!

Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:

> here’s a half-baked idea that I think is worth considering: let’s patch
> our Python package to respect GUIX_PYTHONPATH and use GUIX_PYTHONPATH in
> our wrappers.

Oh!

[...]

> So I propose to avoid using PYTHONPATH, which is similarly dangerous as
> LD_LIBRARY_PATH in that it causes incompatible libraries to be loaded.
> Switching to GUIX_PYTHONPATH is not going to be a complete solution
> (because it doesn’t distinguish between different versions of Python),
> but at the very least it will separate Python applications that use Guix
> from Python applications that don’t.  Right now this is not the case and
> people who use Guix for some things but not for others have a really bad
> time and learn to avoid Guix because it sets PYTHONPATH, which breaks
> their other applications.

The reasoning makes sense to me… but wouldn’t it extend to most of the
*PATH variables?  After all, PERL5LIB or even GUILE_LOAD_PATH could lead
to similar issues, no?

AIUI, the problem is more acute in Python because of pip, and because
people are likely to use both pip and Guix, right?

> If we’re feeling lucky we could even introduce GUIX_PYTHON2_PATH and
> GUIX_PYTHON3_PATH to solve the other half of the problem, namely that
> Python 2 applications will load Python 3 libraries (and vice versa).

My gut reaction is that this is a problem for upstream to solve
(GUILE_LOAD_PATH has the same problem, and AFAICS most PATH variables
are unversioned), but OTOH we’re at the forefront here because we can
usefully mix Python 2 and Python 3 things in an environment.

Thanks,
Ludo’.

  parent reply	other threads:[~2019-06-14 21:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14  8:14 Down with PYTHONPATH! Ricardo Wurmus
2019-06-14 10:12 ` ng0
2019-06-14 21:29 ` Ludovic Courtès [this message]
2019-06-15  7:44   ` Ricardo Wurmus
2019-06-15  9:15 ` Konrad Hinsen
2019-06-17  9:03   ` Ludovic Courtès
2019-06-17 10:20     ` Konrad Hinsen
2019-06-17 15:48       ` Pjotr Prins
2019-06-18 15:46         ` Konrad Hinsen
2019-06-19 11:25           ` Hartmut Goebel
2019-06-17 12:17     ` Hartmut Goebel
2019-06-15 13:35 ` Hartmut Goebel
2019-06-15 14:50   ` Ricardo Wurmus
2019-06-17  9:11   ` Ludovic Courtès
2019-06-17 18:34     ` Ricardo Wurmus
2019-06-18  8:28       ` Hartmut Goebel
2019-07-06 10:45 ` Hartmut Goebel
2019-07-06 16:31   ` Pjotr Prins
2019-07-18  8:20   ` Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875zp7j1p1.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=ricardo.wurmus@mdc-berlin.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.