Comment 3 for bug 158756

Revision history for this message
Jim Fulton (jim-zope) wrote : Re: [Bug 158756] Re: system path should be ignorable/overridable

On Nov 19, 2007, at 9:09 AM, Andi Zeidler wrote:

> hi jim, martijn,
>
> On Oct 30, 2007 Jim Fulton wrote:
>> Generated scripts always put eggs found at the start of the path.
>> buildout, like setuptools, searches site packages for eggs to install
>> and probably selects these some times, so I think this largely boils
>> down to the rules for finding eggs in the first place.
>
> we've just run into a problem that very same or anyway closely related
> problem, and i was about to file a bug after some analysis i just did.
> sparing you a long read with all the details i think the essential
> problem here is that `bootstrap.py` uses a globally, non-eggish
> setuptools if it finds one. that results in `.../site-packages` to be
> inserted into `sys.path` in `bin/buildout` as well as the other
> scripts
> in `bin/`, i.e. `bin/instance`.

I don't believe this has anything to do with it. Buildout, as a
matter of policy, includes whatever Python path is used to run the
buildout, regardless of where it finds the setuptools eggs. It would
be fairly straightforward task to have an option to search only
buildout-defined directories for eggs.

> now if you install, let's say a zope2 instance via buildout and
> additionally have some globally installed eggs like `zope.interface`
> (as
> commonly installed system-wide by installing twisted, for example),
> starting up the zope instance will pick up the global egg instead of
> the
> module coming from your zope installation, because `.../site-packages`
> comes before `parts/zope2/lib/python` in the modified `sys.path`.
> obviously this would cause problems if the versions differ.
>
> however, if setuptools isn't installed as a "regular" package in the
> system, but either not at all or as an egg via `easy_install`,
> `bootstrap.py` will download or copy it into its `eggs/` directory and
> `.../site-packages` will not be included into `sys.path`, effectively
> fixing these problems.

Have you seen this "fix" the problem? I'm 99% that when constructing
working sets (paths) that the entire Python path is searched
regardless of where setuptools is installed.

> on the other hand people need setuptools and we
> cannot tell everyone to not use packages but install it via
> `easy_install` instead. but i think this could be fixed by changing
> `bootstrap.py` to insist in always using an egg for setuptools, that
> is
> even downloading it when a setuptools package already exists in the
> system. or would that have other implications?

I don't believe this is a bootstrapping issue.

Jim

--
Jim Fulton
Zope Corporation