This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] ignore PYTHONHOME environment variable.
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Doug Evans <dje at google dot com>
- Cc: Jan Kratochvil <jan dot kratochvil at redhat dot com>, gdb-patches at sourceware dot org, David Malcolm <dmalcolm at redhat dot com>
- Date: Tue, 14 Dec 2010 11:12:10 +0400
- Subject: Re: [RFA] ignore PYTHONHOME environment variable.
- References: <1290474202-885-1-git-send-email-brobecker@adacore.com> <20101123030037.GA19962@host0.dyn.jankratochvil.net> <AANLkTiko2FVL+ktF9JTBRedYz_wvsq_eP4rU3rLcOYmF@mail.gmail.com> <20101123163045.GA1737@host0.dyn.jankratochvil.net> <AANLkTi=W+PnwOfNkRRe5OMz0qm5vCghhduO5ve1Qk3zH@mail.gmail.com> <20101123173054.GW2634@adacore.com>
Hey Jan, Hey Doug,
I really apologize for the delay in getting back to this.
On Tue, Nov 23, 2010 at 09:30:54AM -0800, Joel Brobecker wrote:
> > <jan.kratochvil@redhat.com> wrote:
> > > But PYTHONHOME=$HOME for some user overrides of system Python would
> > > no longer work. ?What would $PYTHONHOME otherwise be useful for?
> >
> > OTOH what if one wanted to debug a python with a different PYTHONHOME?
> > GDB_PYTHONHOME? [not my idea, but seems reasonable]
>
> I think you indeed need something like that. I don't think we can trust
> PYTHONHOME, because it might point to something that's incompatible.
Jan: Does your objection still stand, or are you satisfied if we add
a GDB_PYTHONHOME environment variable to control the Python home?
Note that, if PYTHONHOME was used purely to access user scripts, then
they should be using PYTHONPATH instead.
> But I think I would prefer something like this:
>
> if "GDB_PYTHONHOME" is defined
> Py_SetPythonHome (getenv ("GDB_PYTHONHOME"));
> #ifdef WITH_PYTHON_PATH
> else
> /* We override any value that the PYTHONHOME might have, as we want
> to make sure that we use the Python library that comes with GDB. */
> Py_SetPythonHome (ldirname (python_libdir));
> #endif
>
> The latter makes GDB_PYTHONHOME always active, regardless of how
> GDB was linked against Python.
Doug: Does this seem reasonable to you?
--
Joel