Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: tromey@redhat.com
Cc: Joel Brobecker <brobecker@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] Add gdb_libdir/python-<version> in front of Python 	search path.
Date: Fri, 21 May 2010 19:39:00 -0000	[thread overview]
Message-ID: <AANLkTikZoPUVnNvSbv8UHIXtGrTFJzjDkFalW63PcEsr@mail.gmail.com> (raw)
In-Reply-To: <m3r5l51bm8.fsf@fleche.redhat.com>

On Fri, May 21, 2010 at 9:08 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Doug" == Doug Evans <dje@google.com> writes:
>
> Doug> I think(!) this is a better approach.  Could be wrong of course. :-)
> Doug> I think adding one directory to sys.path is insufficient, and from
> Doug> what I've read it seems like Py_SetProgramName is the preferred
> Doug> solution to this problem.
>
> I read through this thread.  I also prefer this approach, mostly because
> it doesn't change sys.path for the distro case.
>
> Doug> This patch doesn't currently handle your case, where the relationship
> Doug> between the location of python and gdb at build time is different than
> Doug> at runtime.  I think the solution to that is another config parameter
> Doug> to specify where to find python at run time.  Currently, when given a
> Doug> path, --with-python specifies where to find python at build time, and,
> Doug> for now, also at runtime.
>
> According to the docs you can also override some Py_ functions to allow
> more complete control:
>
> The embedding application can steer the search by calling
> `Py_SetProgramName(FILE)'  _before_ calling `Py_Initialize()'.  Note
> that `PYTHONHOME' still overrides this and `PYTHONPATH' is still
> inserted in front of the standard path.  An application that requires
> total control has to provide its own implementation of `Py_GetPath()' ,
> `Py_GetPrefix()' , `Py_GetExecPrefix()' , and `Py_GetProgramFullPath()'  (all
> defined in `Modules/getpath.c').

I tweaked my patch a bit to only #define WITH_PYTHON_PATH if $build = $host.
I'll let it soak another day and then check in.

[another config parameter to handle where-to-find-build-python vs
where-to-find-runtime-python may yet be a reasonable thing to have,
but I'll leave that for later.  --with-build-python might be a better
choice though]


  reply	other threads:[~2010-05-21 17:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-20 18:40 Add LIBDIR/gdb/python-<version> to " Joel Brobecker
2010-05-20 18:40 ` [PATCH 2/2] Add gdb_libdir/python-<version> in front of " Joel Brobecker
2010-05-20 21:37   ` Jan Kratochvil
2010-05-20 21:49     ` Joel Brobecker
2010-05-20 22:09       ` Jan Kratochvil
2010-05-20 23:03         ` Joel Brobecker
2010-05-21  9:33   ` Doug Evans
2010-05-21 16:01     ` Joel Brobecker
2010-05-21 16:17     ` Tom Tromey
2010-05-21 19:39       ` Doug Evans [this message]
2010-05-20 18:54 ` [PATCH 1/2] Add support for --with-gdb-libdir (default: <prefix>/lib/gdb) Joel Brobecker
2010-05-27 15:04   ` Joel Brobecker
2010-05-28  5:27     ` Doug Evans
2010-05-28 16:08       ` Joel Brobecker
2010-05-20 19:03 ` Add LIBDIR/gdb/python-<version> to Python search path Daniel Jacobowitz
2010-05-20 19:15   ` Joel Brobecker
2010-05-20 19:23     ` Daniel Jacobowitz

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=AANLkTikZoPUVnNvSbv8UHIXtGrTFJzjDkFalW63PcEsr@mail.gmail.com \
    --to=dje@google.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox