From: Hartmut Goebel <h.goebel@crazy-compilers.com>
To: guix-devel@gnu.org
Subject: Re: Down with PYTHONPATH!
Date: Sat, 15 Jun 2019 15:35:56 +0200 [thread overview]
Message-ID: <c4a496dd-7e4d-9173-a498-f8d3e3981a18@crazy-compilers.com> (raw)
In-Reply-To: <87muikr3bq.fsf@mdc-berlin.de>
Am 14.06.19 um 10:14 schrieb Ricardo Wurmus:
I welcome your initiative. Fixing this finally is on my todo-list since
long.
> 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.
I have a *strong* opinion against this, as this would just replace one
cludge by another one. See below for rational.
IMO the only sustainable solution it to patch the interpreter
(Modules/getpath.c) to determine the correct "installation path"
(profile). I did quite some work on this last year, but had no time to
finish it. I still have no time for finishing, but I should be able to
hand-over my results (including prepared patches for Python 3.7).
Rational for GUIX_PYTHONPATH being a cludge (IMHO)
- Constraint: We must keep the expected behavior of PYTHONPATH as
documented for CPython. This esp. means, we must not simply substitute
in the source PYTHON_PATH by GUIX_PYTHONPATH, but need to *add* code.
- When implementing GUIX_PYTHONPATH in site.py or site-cutomize.py, it
will fail if python is run using -S (disable the import of the module
site, and thus site-customize).
- When implementing GUIX_PYTHONPATH in getpath.c, we need to copy the
current code for PYTHONPATH, which means we will end up with a not so
short patch. And even then, this special care needs to be taken to not
leak GUIX_PYTHONPATH from one profile to the other.
- We still need a wrapper (which caused a lot of problems, we already
solve. But maybe other problem will arise).
- If patching getpath.c anyway, we could go for interpreter to determine
the correct "installation path" (see above).
--
Regards
Hartmut Goebel
| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
next prev parent reply other threads:[~2019-06-15 13:36 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
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 [this message]
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=c4a496dd-7e4d-9173-a498-f8d3e3981a18@crazy-compilers.com \
--to=h.goebel@crazy-compilers.com \
--cc=guix-devel@gnu.org \
/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.