This is the mail archive of the 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/'\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
* 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]):
- 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:
- IMO [archer-tromey-python] should import
f0fab6ed91c0d78127a52afc1965003efe5e64f5 and redo the four fixes.

And the installation directories (sowere in:

The branches compatibility fixes above (separate from the technical conflicts
resolution) have not been posted to <> so far.


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