Experimenting with exemaker

Matt Mackall mpm at selenic.com
Tue Mar 8 11:46:01 CST 2011


On Tue, 2011-03-08 at 09:58 -0600, Steve Borho wrote:
> On Mon, Mar 7, 2011 at 10:39 PM, Matt Mackall <mpm at selenic.com> wrote:
> > I've found a neat tool:
> >
> > http://effbot.org/zone/exemaker.htm
> >
> > Given an hg.py, this program makes a 4k hg.exe that:
> >
> > a) finds hg.py in the same directory as it's in
> > b) finds python.exe either in PATH or in the #! line in hg.py
> > c) finds python.dll wherever python.exe is
> > d) loads python.dll and launches hg.py
> >
> > In other words, it emulates the #! behavior of scripts on Windows.
> >
> > This has several advantages:
> >
> > - it gives you a hackable/patchable install
> > - extensions and hooks are more easily installed
> > - third party libraries are more easily added
> > - hgweb becomes easier to set up
> > - Python and hg are decoupled, so Python can be upgraded
> > - a lot of py2exe weirdness is avoided
> > - weirdness with command scripts calling command scripts is avoided
> 
> It 'avoids' py2exe weirdness by performing none of the work.  How is a
> package maintainer supposed to know which Python packages need to be
> included?  Or which DLLs are needed by all of the Mercurial source and
> extensions?

I see this is as an upside. If you forget something (or decide it's not
needed by enough people to warrant it), or package an old or buggy
version, an end user can grab and install their own copy.

In fact, what I'm proposing is a distribution that doesn't include ANY
of its dependencies, including Python (the only one needed by core at
this point).

> > The first item I think is a _really big deal_ as it'll make it much
> > easier for people to get involved in hacking Mercurial on Windows. This
> > is pretty urgently needed as that's where we have the most users and the
> > least developers.
> 
> Windows is not an O/S that supports hackable programs.  If we shipped
> source files in our installer and installed them under C:\Program
> Files\Mercurial it would lead to a maintenance nightmare.  If any user
> edits a .py file installed there, and they do not have write
> privileges in that folder, from Vista on-ward the O/S will save the
> file in a magical user-local folder and from that point onward that is
> the copy of the file the O/S reads from if the user ever opens the
> original file location.

Hmm, first I've heard of that particular piece of byzantine insanity.

Your answer suggests you think the problem isn't worth trying to solve.
Does that mean you thing there are enough Windows developers already?

I'm pretty sure lots of people still do real Python-based development on
Windows, including messing with those horrible egg things, etc.. so
presumably it IS possible to get over this hurdle.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list