[Distutils] Improved error handling in zc.buildout

Jim Fulton jim at zope.com
Sat Mar 17 17:29:07 CET 2007


On Mar 15, 2007, at 8:10 PM, Martin Aspeli wrote:

> Jim Fulton wrote:
>> A major annoyance in zc.buildout has been its poor error handling.
>> Generally, when an error occurred, a a traceback would be printed
>> giving little or no clue about what went wrong or what was going on.
>> Previously, I was focussed on important features.  The latest release
>> focusses on better error reporting and debugging support.  I'd like
>> to continue to provide some emphasis on this, so feedback would be
>> especially appreciated now that I think I've improved error handling
>> quite a bit.
>
> That's great news, Jim!
>
> I had a particular problem before, where the "Plone" egg (which  
> includes
> all the Products.* packages that make up plone, and all the other  
> proper
> eggs as dependencies) would try to compile .py files in filesystem  
> skin
> folders (i.e. Zope Script (Python)'s) and get compile errors (return
> outside function, for example). With workingenv and easy_install, it'd
> report the errors but not stop;

I wonder what you mean by "stop" in this context.  Normally,  
easy_install is used to install a package at a time.  Are you saying  
that easy_install continued to fetch other distributions as  
dependencies even after this error occurs?

> buildout seems to stop.

When buildout invokes setuptools, it does so as a sub-process.  It  
treats a non-0 exit status from the subprocess as an error.


> Better error
> handling would hopefully help diagnose this.

Perhaps the absence of a traceback will make it easier to see errors  
spewed when running the package setup scripts.

> We couldn't find a way to
> stop setuptools from trying to compile those files,

I wonder how setuptools (or more likely distutils) decides what files  
to compile.

(I've always been annoyed by the Zope Python script syntax which  
isn't valid Python. :()

I wonder if it would make sense to get Zope to use a different suffix  
for these things, since they aren't *really* Python code.

> or a way to get  buildout to ignore the errors.

Generally, it seems like a bad idea for buildout to ignore the exit  
status of running easy install.  Perhaps, as Phillip suggested, I  
should try using the --record option and decide that things are fine  
if files actually get installed.  I'll look into that.  It seems off  
that easy_install exits with a non-0 exit status for what is,  
essentially, a warning.

Could you please report this as a buildout bug:

   https://bugs.launchpad.net/zc.buildout/+filebug

including enough information for me to easily reproduce the problem?   
Pointing me at a sample buildout I can check  out and try might be a  
good way to do this.

Jim

--
Jim Fulton			mailto:jim at zope.com		Python Powered!
CTO 				(540) 361-1714			http://www.python.org
Zope Corporation	http://www.zope.com		http://www.zope.org





More information about the Distutils-SIG mailing list