This is the mail archive of the archer@sourceware.org mailing list for the Archer project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [python] Packacking - Python scripts directories


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 <archer@sourceware.org> so far.


Regards,
Jan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]