On Feb 19, 2008, at 7:08 AM, Phillip J. Eby wrote:

At 08:32 PM 2/18/2008 -0800, Philip Jenvey wrote:

It looks like it's due to the fact that simplejson includes an
optional C speedup extension. It overrides the distutils build_ext
command so it can swallow any compiler errors (and skip building the
extension). I guess it must be faking out setuptools into thinking
there'll be a native_libs.txt when there won't be. I'm going to
investigate it more this week.

Hrm. It's actually a setuptools bug. The bdist_egg command either creates or deletes native_libs.txt in the working .egg-info directory, then copies to the built egg's EGG-INFO. However, there's no reason for it to be in .egg-info, since native_libs.txt is only relevant for zipped .egg files.

The specific problem is that the source distribution of simplejson contains a native_libs.txt, which is therefore listed in the SOURCES.txt... which is then used by the metadata copier to copy it into EGG-INFO... right after it gets deleted by bdist_egg.

So, basically, bdist_egg should be writing or delete native_libs.txt only from EGG-INFO, and to fix the problem in existing builds, the egg_info command will need to always delete native_libs from the .egg-info.

How does this patch look?

I also made the extract_constant tests skip on Jython/IronPython, so every test should pass on these platforms.

Attachment: native_libs-fix-r60849.diff
Description: Binary data




I also just noticed there's problems with ez_setup.py on jython on
Windows -- though this might not be setuptools fault -- just FYI,
it's on my radar to investigate that as well before your final release.

Ok.


We're ok for Jython on Windows, the problems I saw were all Jython's fault.

What I was particularly worried about was stray open file handles -- they could prevent a file from being os.unlink'd (since Windows doesn't allow you to delete a file when it's still in use). This kind of thing is particularly evil for Jython because Java's gc may not finalize and close our left open file objects as immediately as CPython's does.

setuptools didn't have any stray file handles that seemed to cause problems for me, but I went through the codebase and found some anyway, patch #2:

Attachment: close_fp-r60849.diff
Description: Binary data


--
Philip Jenvey
_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to