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

Tom Pollard mlpollard at earthlink.net
Tue May 11 19:08:56 EDT 2004


On May 11, 2004, at 6:25 PM, Bob Ippolito wrote:
> On May 11, 2004, at 4:51 PM, Tom Pollard wrote:
>> There's a python startup script in the package created by 
>> bundle-builder that sets a couple of environment variables and 
>> invokes python to run the bundled script.  It is solely in order to 
>> run this script that the BSD environment needs to be installed.  It 
>> could easily be replaced with a /bin/sh script if it was considered 
>> important to support users who didn't have /usr/bin/python installed 
>> already.  That's the only change that would be required.
>
> 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.

> Perl might, though, but it's not worth doing when your application is 
> going to fall over silently anyway if the BSD subsystem is not there.

My clear impression was that a standalone executable built by 
bundle-builder should no longer need anything from the BSD package, 
once started up.  It's just to execute that first startup script that 
the BSD installation is required.

Also, the BSD 'subsystem' is there whether you install the BSD package, 
or not.  Things like bash, awk, sed, perl, etc., are all part of the 
core BaseSystem package.  The optional BSD package just installs 
additional components (like /usr/bin/python) that are useful for 
working from the Terminal.

So, why would you expect your app to fall over silently if the BSD 
package hadn't been installed?

>> The last time I brought this up, Bob Ippolito explained that this 
>> would make it impossible to use the bundled app as a "regular" app 
>> from both the Finder and the command line, but I never really 
>> appreciated that point.  It sounded like bundle-builder2 would 
>> eliminate the problem in a more robust way, so it didn't seem worth 
>> pursuing.  But, if I was going to ship an app based on the current 
>> bundle-builder, I would definitely hack it to use a shell startup 
>> script instead of the python script.
>
> No, you should use the executable stub I developed instead.  Even if 
> you could find another suitable surrogate scripting language to do the 
> dance, it would silently pass errors to the console, where my stub 
> allows GUI reporting and customized error handling with a lot of nice 
> features that you'd want when shipping a python-dependent application.

Ok, it sounds like, if I actually did have a python app to distribute, 
I'd be stupid not to take advantage of this, then.

Tom




More information about the Pythonmac-SIG mailing list