From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3138 invoked by alias); 14 Dec 2010 07:12:31 -0000 Received: (qmail 3126 invoked by uid 22791); 14 Dec 2010 07:12:29 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Dec 2010 07:12:24 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9F1E02BAB98; Tue, 14 Dec 2010 02:12:22 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hKq8eVmk8zFn; Tue, 14 Dec 2010 02:12:22 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 198A32BAB68; Tue, 14 Dec 2010 02:12:22 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 366CF145B58; Tue, 14 Dec 2010 08:12:10 +0100 (CET) Date: Tue, 14 Dec 2010 07:12:00 -0000 From: Joel Brobecker To: Doug Evans Cc: Jan Kratochvil , gdb-patches@sourceware.org, David Malcolm Subject: Re: [RFA] ignore PYTHONHOME environment variable. Message-ID: <20101214071210.GQ2596@adacore.com> References: <1290474202-885-1-git-send-email-brobecker@adacore.com> <20101123030037.GA19962@host0.dyn.jankratochvil.net> <20101123163045.GA1737@host0.dyn.jankratochvil.net> <20101123173054.GW2634@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20101123173054.GW2634@adacore.com> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-12/txt/msg00214.txt.bz2 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: > > 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