[Pythonmac-SIG] Optional BSD package is required for (useable) Python?

Bob Ippolito bob at redivi.com
Tue May 11 21:31:40 EDT 2004


On May 11, 2004, at 9:14 PM, Tom Pollard wrote:

>
> On May 11, 2004, at 7:16 PM, Bob Ippolito wrote:
>>>> No, /bin/sh doesn't provide the execve functionality required.
>>>
>>> Yes, I've heard you mention this execve issue, but I still don't 
>>> appreciate what the issue is.  My introduction to bundle-builder was 
>>> through the BitPim project <http://bitpim.sourceforge.net/>, which 
>>> distributes a Mac executable built with bundle-builder.  Replacing 
>>> the python startup script with a /bin/sh script in the BitPim bundle 
>>> seemed to work fine, that is, the app still starts up correctly when 
>>> double-clicked in the Finder, and that's the only thing that needs 
>>> to work in this case.
>>
>> It's possible that it works for that app, but it doesn't do what it's 
>> supposed to be doing.  When finder starts an app it assigns a process 
>> serial number to that pid, if you don't use execve then the pid 
>> changes.
>
> You can use 'exec' from a Bourne-shell script, too, if preserving the 
> PID of the startup script is the only issue.  I thought the problem 
> was something more than that.

That should be enough, then.  Not a Bourne-shell scripter.

>> There's a lot of funny things that can happen if you don't obey all 
>> the rules.
>
> What rules are broken by using a shell script?
>
>> For example, maybe you can start more than one simultaneous instance 
>> of BitPim, or some obscure things fail.
>
> "Maybe"?  How?

Maybe as in, I haven't tried it.  If you start a new pid and don't keep 
the PSN information along for the ride and/or don't use LaunchServices 
to start the application I've noticed things like this can happen.

>> I try not to follow the "whatever works" philosophy when developing 
>> software if I can avoid it :)
>
> That's admirable, but it's still not clear to me that there are real 
> problems here that demand the use of a python startup script.  How is 
> python's 'execve' different from the shell's 'exec'?

I never said we should use a Python startup script, only that we one is 
used now and why it was done that way.  Whoever wrote the original 
bundlebuilder must either be insensitive/unaware to the BSD subsystem 
dependency, and/or not a Bourne-shell scripter.

In any case, using a bootstrap script (with any interpreter) should be 
deprecated entirely.  It makes the application start slower, isn't 
compatible with OS X 10.1, and can't provide error reporting to the 
GUI.  I've solved this problem, and my solution (or something very 
close to it) should be used in all cases.

-bob




More information about the Pythonmac-SIG mailing list