Re: Using Py_SetPythonHome

Jan Kratochvil
2012-09-21T17:28:07Z

On Fri, 21 Sep 2012 17:57:58 +0200, Joel Brobecker wrote:
> > This is creating OS-in-an-application designs reimplementing what OS
> > should do.
>
> Really? You keep dismissing the model where everything is managed by
> a GNU/Linux distribution, and this has been a regular source of
> fustration. Some users, myself included (and I am not speaking as
> an AdaCore employee), routinely install software from sources, and
> I keep everything separate from the system installs, because it's
> easier to manage. Are you going to deny that this is a legitimate
> situation?

It may be a perfectly legitimate situation, I do not argue with this part.
I argue that no other system application does what GDB does. If some changes
should be done they should be done in a system, not in one application.

The question is whether such behavior is at least native for GNU Toolchain
which has various specifics.

I have discovered now that default build of GCC really uses something like
relocate_gdb_directory for its own components (like cc1), it does not use
constant compiled-in path like normal applications do. This justifies
relocate_gdb_directory for the default build of GDB, it was not clear to me.
This also means GCC is violating standard system packaging practices.

But gcj still loads external dependency --with-ecj-jar=/path/to/eclipse-ecj.jar
from its original location, without any relocation:

2833 stat("/home/jkratoch/redhat/gcchead2-root-moved/bin/../lib/gcc/../../share/java/libgcj-4.8.0.jar", {st_mode=S_IFREG|0644, st_size=10619110, ...}) = 0
2834 execve("/home/jkratoch/redhat/gcchead2-root-moved/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/ecj1", ...], [/* 54 vars */] <unfinished ...>
- relocated
2834 access("/home/jkratoch/redhat/gcchead2-root/eclipse-ecj.jar", F_OK) = -1 ENOENT (No such file or directory)
- not relocated

Is this gcj behavior considered a bug or not? eclipse-ecj.jar is external
(==part of a different system rpm/deb) to GCC like Python is external to GDB.

I did mind about relocate_gdb_directory, when that part seems native to GNU
Toolchain I leave the Python configuration to Python maintainers. There is
already an IMO-incorrect part of GDB setting Py_SetProgramName so
Py_SetPythonHome may be a part of it, I do not know Python to say more.
Python itself is already violating packaging standards (single directory for
both source .py and arch-dependent .pyc/pyo, incorrect use of -rdynamic, there
may be more) so I understand applications using Python may also violate it.

Regards,
Jan