From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17959 invoked by alias); 2 Mar 2009 17:30:37 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 17600 invoked by uid 22791); 2 Mar 2009 17:30:35 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_24,J_CHICKENPOX_34,J_CHICKENPOX_92,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Date: Mon, 02 Mar 2009 17:30:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: archer@sourceware.org Subject: Re: [python] Packacking - Python scripts directories Message-ID: <20090302173007.GA10961@host0.dyn.jankratochvil.net> References: <20090301192941.GA22627@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-SW-Source: 2009-q1/txt/msg00311.txt.bz2 On Mon, 02 Mar 2009 17:35:50 +0100, Tom Tromey wrote: > I think the issue here is that we make the "gdb" module internally, > then play games to get python to understand that it can satisfy future > imports by reading from that directory. > > If there's a better way, let's do it. I expected something like: - from os.path import exists\n\ - ipy = gdb.pythonlibdir + '/gdb/__init__.py'\n\ - if exists (ipy):\n\ - execfile (ipy)\n\ + try:\n\ + import gdb.__init__\n\ + except ImportError:\n\ + pass\n\ But the error checking and module names from variable gets more complicated so I did not even prepare the patch. > Yeah. We have to preserve relocatability because various other > gdb-using groups want it. OK, understood now. > I think the default setup should be to install the python scripts > somewhere under $prefix, then have a separate option to tell configure > to find the system python directory and use that instead. As default --prefix is `/usr/local' and the default installation directory is `/usr/lib/python2.5/site-packages' I see now it cannot be used as the upstream GDB default. This also makes the `sys.path.insert(0, gdb.pythonlibdir)' requirement also still valid, OK. So currently IMO should be changed: * datadir and pythondir should be two separate directories (with possibly the same default as now). * pythondir should be also relocatable if possible by default. * /usr/include/pythonX.Y should be found by get_python_inc() in configure.ac. * gdb.spec would use --with-pythondir=`python ... 'get_python_lib();'' So as a result just datadir should be separated from pythondir but otherwise I agree with it all now, thanks for the explanation. > Jan> Checked-in > Jan> [archer-jankratochvil-python] ebd9eefcf0e56102c40cfd104eb1c290526b3f51 which > > We're going to have to clear up this distinction with multiple > branches. I don't want us to lose changes due to branch confusion. > > What if I merge master->archer-tromey-python again and we switch to that? For the Fedora and [archer] branch there is a requirement of the merge with [archer-jankratochvil-type-refcount] (for [archer-jankratochvil-vla]): 49f350efd1b7ea38798e77eb8951440160fd7c81 acd14fd258b498d2faa5dc34751c43da5c8e476f 7f4036e06538041e6bd97c5f57616517c003b3a5 - as the fixes show the [archer-tromey-python] branch can bring in a perfectly valid change which crashes on the merge with [archer-jankratochvil-type-refcount] due to different TYPE_OBJFILE. There is also the problem of [archer-tromey-python] compatibility with [archer-tromey-charset] due to the [archer-tromey-charset] change f0fab6ed91c0d78127a52afc1965003efe5e64f5, fixed by: 807b1035c00186e947eab716ffd5d8993b9ca8a8 32697aed4550cbdc8ede26167bdca21f36ecb8f6 1d3229a480d990e3af9c4d53c385501fad3f7a42 64015dc38f646586318cbd09be01f93580a7aa96 - IMO [archer-tromey-python] should import f0fab6ed91c0d78127a52afc1965003efe5e64f5 and redo the four fixes. And the installation directories (sowere in: ebd9eefcf0e56102c40cfd104eb1c290526b3f51 The branches compatibility fixes above (separate from the technical conflicts resolution) have not been posted to so far. Regards, Jan