setuptools bug: broken simlinks break setup()

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

setuptools bug: broken simlinks break setup()

Andrew Straw
In setuptools 0.6c5, a broken symlink in the package tree will cause
'setup develop' to fail, even in the file is inconsequential for the
package. I think this is a bug.

Here is the output of running "python setup.py develop" in a package
called flydra with a broken symlink called broken.symlink:

running develop
running egg_info
writing flydra.egg-info/PKG-INFO
writing top-level names to flydra.egg-info/top_level.txt
writing dependency_links to flydra.egg-info/dependency_links.txt
writing entry points to flydra.egg-info/entry_points.txt
error: broken.symlink: No such file or directory

(I would try this using setuptools==dev, but it seems svn.python.org is
down, or at least my connection to it.)

-Andrew
_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: setuptools bug: broken simlinks break setup()

PJ Eby
At 12:23 PM 6/25/2007 -0700, Andrew Straw wrote:

>In setuptools 0.6c5, a broken symlink in the package tree will cause
>'setup develop' to fail, even in the file is inconsequential for the
>package. I think this is a bug.
>
>Here is the output of running "python setup.py develop" in a package
>called flydra with a broken symlink called broken.symlink:
>
>running develop
>running egg_info
>writing flydra.egg-info/PKG-INFO
>writing top-level names to flydra.egg-info/top_level.txt
>writing dependency_links to flydra.egg-info/dependency_links.txt
>writing entry points to flydra.egg-info/entry_points.txt
>error: broken.symlink: No such file or directory
>
>(I would try this using setuptools==dev, but it seems svn.python.org is
>down, or at least my connection to it.)

Uh, where is this broken symlink exactly, and what does it point
to?  What is the contents of your setup.py?  IOW, a minimal data set
for reproducing the error would be helpful, as right now I don't have
any idea where to begin looking for this.

_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: setuptools bug: broken simlinks break setup()

Andrew Straw
OK, I attach a fairly minimal python package. It builds fine normally.
Now, if you add a broken symlink in the source tree, it fails to build.
For example, "ln -s /broken broken.symlink" in the same directory as
setup.py.

Phillip J. Eby wrote:

> At 12:23 PM 6/25/2007 -0700, Andrew Straw wrote:
>> In setuptools 0.6c5, a broken symlink in the package tree will cause
>> 'setup develop' to fail, even in the file is inconsequential for the
>> package. I think this is a bug.
>>
>> Here is the output of running "python setup.py develop" in a package
>> called flydra with a broken symlink called broken.symlink:
>>
>> running develop
>> running egg_info
>> writing flydra.egg-info/PKG-INFO
>> writing top-level names to flydra.egg-info/top_level.txt
>> writing dependency_links to flydra.egg-info/dependency_links.txt
>> writing entry points to flydra.egg-info/entry_points.txt
>> error: broken.symlink: No such file or directory
>>
>> (I would try this using setuptools==dev, but it seems svn.python.org is
>> down, or at least my connection to it.)
>
> Uh, where is this broken symlink exactly, and what does it point to?
> What is the contents of your setup.py?  IOW, a minimal data set for
> reproducing the error would be helpful, as right now I don't have any
> idea where to begin looking for this.
>

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

simplepack.tar.gz (492 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: setuptools bug: broken simlinks break setup()

PJ Eby
At 01:51 PM 6/25/2007 -0700, Andrew Straw wrote:
>OK, I attach a fairly minimal python package. It builds fine normally.
>Now, if you add a broken symlink in the source tree, it fails to build.
>For example, "ln -s /broken broken.symlink" in the same directory as
>setup.py.

Tried it on Cygwin w/setuptools 0.6c6, nothing different happens with
the symlink.  What platform are you on?

_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: setuptools bug: broken simlinks break setup()

Andrew Straw
Phillip J. Eby wrote:

> What platform are you on?

Ubuntu GNU/Linux: both 6.10 x86_64 Python 2.4 as well as 7.04 i686
Python 2.5.
_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: setuptools bug: broken simlinks break setup()

Nathan R. Yergler-4
I just tried it and saw the error as Andrew described.

On 6/25/07, Andrew Straw <[hidden email]> wrote:

> Phillip J. Eby wrote:
>
> > What platform are you on?
>
> Ubuntu GNU/Linux: both 6.10 x86_64 Python 2.4 as well as 7.04 i686
> Python 2.5.
> _______________________________________________
> Distutils-SIG maillist  -  [hidden email]
> http://mail.python.org/mailman/listinfo/distutils-sig
>
_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: setuptools bug: broken simlinks break setup()

Jim Fulton

This is an ongoing problem for me with emacs, which intentionally  
uses broken links to implement lock files.  Arguably, this is emacs'  
fault, but I'd love to see a change to setuptools that made it ignore  
broken links.

Jim

On Jun 26, 2007, at 10:26 AM, Nathan R. Yergler wrote:

> I just tried it and saw the error as Andrew described.
>
> On 6/25/07, Andrew Straw <[hidden email]> wrote:
>> Phillip J. Eby wrote:
>>
>>> What platform are you on?
>>
>> Ubuntu GNU/Linux: both 6.10 x86_64 Python 2.4 as well as 7.04 i686
>> Python 2.5.
>> _______________________________________________
>> Distutils-SIG maillist  -  [hidden email]
>> http://mail.python.org/mailman/listinfo/distutils-sig
>>
> _______________________________________________
> Distutils-SIG maillist  -  [hidden email]
> http://mail.python.org/mailman/listinfo/distutils-sig

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



_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: setuptools bug: broken simlinks break setup()

PJ Eby
At 10:43 AM 6/26/2007 -0400, Jim Fulton wrote:

>This is an ongoing problem for me with emacs, which intentionally
>uses broken links to implement lock files.  Arguably, this is emacs'
>fault, but I'd love to see a change to setuptools that made it ignore
>broken links.
>
>Jim

Actually, as it turns out, it's distutils fault (well, the error is, anyway):

$ DISTUTILS_DEBUG=y python2.3 setup.py develop
...
Traceback (most recent call last):
   ...
   File "/usr/lib/python2.3/distutils/filelist.py", line 48, in findall
     self.allfiles = findall(dir)
   File "/usr/lib/python2.3/distutils/filelist.py", line 298, in findall
     stat = os.stat(fullname)
OSError: [Errno 2] No such file or directory: 'broken.symlink'

I'll add a workaround in setuptools, but somebody should fix the
distutils, too.    It looks like the 'findall()' function should be
reimplemented with 'os.walk()'.

_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: setuptools bug: broken simlinks break setup()

PJ Eby
In reply to this post by Andrew Straw
At 12:23 PM 6/25/2007 -0700, Andrew Straw wrote:

>In setuptools 0.6c5, a broken symlink in the package tree will cause
>'setup develop' to fail, even in the file is inconsequential for the
>package. I think this is a bug.
>
>Here is the output of running "python setup.py develop" in a package
>called flydra with a broken symlink called broken.symlink:
>
>running develop
>running egg_info
>writing flydra.egg-info/PKG-INFO
>writing top-level names to flydra.egg-info/top_level.txt
>writing dependency_links to flydra.egg-info/dependency_links.txt
>writing entry points to flydra.egg-info/entry_points.txt
>error: broken.symlink: No such file or directory
>
>(I would try this using setuptools==dev, but it seems svn.python.org is
>down, or at least my connection to it.)

Okay, I've confirmed it's a distutils bug, and the following patch
implements a workaround for it in setuptools.  It'll be included in
setuptools 0.6c7:

Index: setuptools/__init__.py
===================================================================
--- setuptools/__init__.py      (revision 55712)
+++ setuptools/__init__.py      (working copy)
@@ -65,18 +65,17 @@



+def findall(dir = os.curdir):
+    """Find all files under 'dir' and return the list of full filenames
+    (relative to 'dir').
+    """
+    all_files = []
+    for base, dirs, files in os.walk(dir):
+        if base!=os.curdir:
+            files = [os.path.join(base, f) for f in files]
+        all_files.extend(filter(os.path.isfile, files))
+    return all_files

+import distutils.filelist
+distutils.filelist.findall = findall    # fix findall bug in distutils.

-
-
-
-
-
-
-
-
-
-
-
-
-

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