public inbox for gentoo-python@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Gilbert <floppym@gentoo.org>
To: djc@gentoo.org
Cc: gentoo-python@lists.gentoo.org
Subject: Re: [gentoo-python] Testing dev-lang/python version bumps
Date: Sat, 28 Apr 2012 13:14:38 -0400	[thread overview]
Message-ID: <4F9C257E.1060305@gentoo.org> (raw)
In-Reply-To: <4F9AD65B.3090903@gentoo.org>

[-- Attachment #1: Type: text/plain, Size: 2057 bytes --]

On 04/27/2012 01:24 PM, Mike Gilbert wrote:
> On 04/27/2012 01:17 PM, Mike Gilbert wrote:
>> On 04/27/2012 12:35 PM, Dirkjan Ochtman wrote:
>>>>> 3. Added 61_all_process_data.patch, for which the goal seems somewhat unclear.
>>>> This is some logic for python-wrapper that was in the 2.7.2 patchset as
>>>> well. If you want to drop it, I'm sure that will require some
>>>> re-engineering of python-wrapper.
>>>
>>> Right. Do you know what this fixes, and how/why it will be
>>> re-engineered? As long as we don't know these things, I'd prefer to
>>> leave the patch out rather than include it.
>>>
>>
>> I have been bitten in the past by removing things that I don't fully
>> understand, so I'm trying to avoid doing that. I guess I can drop it and
>> see what happens.
>>
> 
> I will add investigating this patch to my todo list. Hopefully Arfrever
> can explain the rationale to me, and I can relay that.
> 
> Otherwise, I will have to figure it out the hard way.
> 

Had a chat with Arfrever last night about this.

The variables introduced in 61_all_process_data.patch are there to make
the scripts created by python_generate_wrapper_scripts as transparent as
possible. Specifically, they are used to manipulate sys.argv[0] in
python, argv[1] in C, and the "process name" as set by
prctl(PR_SET_NAME, ...).

This allows /usr/bin/A (wrapper) to call /usr/bin/A-2.7 (real script),
but still have /usr/bin/A in sys.argv[0].

This is mainly useful for supporting python scripts which vary their
behavior based on sys.argv[0]. The eclean program from gentoolkit does
this, for example. That's probably not the best example since it does
not use a python.eclass generated wrapper, but it illustrates the concept.

The process name is used by utilities like killall to find the process
to kill. I believe it is also used in top's display.

Arfrever also claims that this should help start-stop-daemon to detect
which process to kill, but I have not been able to verify this claim.
See bug 286191 for reference.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 230 bytes --]

  reply	other threads:[~2012-04-28 17:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-22  1:12 [gentoo-python] Testing dev-lang/python version bumps Mike Gilbert
2012-04-27 13:03 ` Dirkjan Ochtman
2012-04-27 15:13   ` Mike Gilbert
2012-04-27 16:35     ` Dirkjan Ochtman
2012-04-27 17:17       ` Mike Gilbert
2012-04-27 17:24         ` Mike Gilbert
2012-04-28 17:14           ` Mike Gilbert [this message]
2012-04-28 17:53       ` Mike Gilbert
2012-04-30  6:40         ` Dirkjan Ochtman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F9C257E.1060305@gentoo.org \
    --to=floppym@gentoo.org \
    --cc=djc@gentoo.org \
    --cc=gentoo-python@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox