Subject: Re: Python binaries for mozilla

Mark Hammond wrote:
I've been thinking about and playing with ways to create a Python XPI for
Mozilla. As I've mentioned before, this XPI needs to bundle Python itself
along with the 'pyxpcom' and new 'nsdom' packages. We don't want to rely on
a pre-installed Python (that places too much burden on the end user and too
much scope for error), but at the same time we want to co-exist with any
installed Pythons.

Here are my thoughts - I welcome all feedback, particularly from the
ActiveState guys who already have some experience in this area. For the
sake of this discussion, let's assume Python 2.4 (although I'm leaning
towards jumping straight to 2.5 once officially released.) Also, let's
assume Windows (other OS' will be very similar)

Spoken like a windows developer ;)

Actually, OS X is quite different, but we've solved those issues already. This mostly has to do with Python being a framework on OSX, and how frameworks have to be bundled in application bundles. So for directory locations, you'll find it to be extremely different than on windows/linux.

The XPI installs:

I think we should write up the locations of stuff as it is in Komodo. We've gotten to our layout through a lot of painful experience and thought (yes, also painful). I don't think you're far off from what we have though.


* On non-windows platforms, will there be a need to "patch" our .so files to
remove the reference to /usr/local, or whatever was used when pyxpcom was
actually build? I seem to recall Shane mentioning something about that.
Any other non-windows issues I remain oblivious to?

Trent is the expert on the relocation stuff, but yes, OSX and unix platforms will need binary relocation done.

* By default, the PYTHONPATH is not correct - specifically 'python24/DLLs'
etc are not on it. If you set PYTHONHOME manually to
"c:\path\to\mozilla\bin\python24", ...

it works correctly. I think the pyxpcom
loader should be modified to check if 'bin/python24' exists, and set
PYTHONHOME accordingly. The directory will not exist for people who build
moz and python from source, so should continue to work as now. Thoughts or

Yet another place Trent should comment :)

* Firefox needs to be restarted after installation so the new components are
registered. I haven't worked out how to do that.

You dont. When a XPI is installed, the user gets a message that the extension is not available until they restart.