Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue15205] distutils dereferences symlinks on Mac OS X but not on Linux

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jun 27, 2012, 5:53 AM

Post #1 of 7 (117 views)
Permalink
[issue15205] distutils dereferences symlinks on Mac OS X but not on Linux

New submission from Ollie Walsh <ollie.walsh [at] gmail>:

Hi,

This is related to #12585.

Distutils sdist builds a package tree using hardlinks to the source if supported by the OS. This is then tarred/zipped/etc...

If the source contains symbolic links to external files:

On Linux (and apparently Solaris) they are not dereferenced and the resulting package is broken.

On OSX (and apparently all BSD kernels) a hardlink to a symlink will dereference the symlink first and the resulting tgz package is ok. However I would expect issue #8876 to be more likely as the symlink could references a different filesystem which would case hardlinking to fail.


In #12585 I assume that zip dereferences the symlinks which masks the issue.

distutils2 appears to always copy instead of hardlinking resolving all of these issues.

distutils can be monkey patched to do the same:
http://article.gmane.org/gmane.comp.python.distutils.devel/2078

----------
assignee: eric.araujo
components: Distutils
messages: 164149
nosy: eric.araujo, ollie.walsh [at] gmail, tarek
priority: normal
severity: normal
status: open
title: distutils dereferences symlinks on Mac OS X but not on Linux
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15205>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 27, 2012, 6:33 AM

Post #2 of 7 (106 views)
Permalink
[issue15205] distutils dereferences symlinks on Mac OS X but not on Linux [In reply to]

Changes by Eric V. Smith <eric [at] trueblade>:


----------
nosy: +eric.smith

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15205>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 27, 2012, 8:53 AM

Post #3 of 7 (103 views)
Permalink
[issue15205] distutils dereferences symlinks on Mac OS X but not on Linux [In reply to]

Changes by Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA [at] GMail>:


----------
nosy: +Arfrever

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15205>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 2, 2012, 1:27 PM

Post #4 of 7 (102 views)
Permalink
[issue15205] distutils dereferences symlinks on Mac OS X but not on Linux [In reply to]

Éric Araujo <merwok [at] netwok> added the comment:

As I said in the other bug, symlinks handling in not fully specified: some functions (like copy_file and copy_tree) have arguments to control copy/link/symlink, but the higher-level commands don’t expose that choice to the user. At present I am not sure if having symlinks in a distribution makes sense, and if the install command (or platform-specific systems for bdists) supports it. I am not sure what the correct behavior would be here.

(BTW the example you link to is not at all monkey-patching, but clean extension of distutils using the provided hooks. :)

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15205>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 2, 2012, 1:41 PM

Post #5 of 7 (101 views)
Permalink
[issue15205] distutils dereferences symlinks on Mac OS X but not on Linux [In reply to]

Éric Araujo <merwok [at] netwok> added the comment:

(Hm OK “del os.link” is definitely a hack :)

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15205>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 4, 2012, 4:05 AM

Post #6 of 7 (97 views)
Permalink
[issue15205] distutils dereferences symlinks on Mac OS X but not on Linux [In reply to]

Ollie Walsh <ollie.walsh [at] gmail> added the comment:

Hi,

> As I said in the other bug, symlinks handling in not fully specified

Yes. I've mostly submitted a bug report in case anybody else encounters the problem.

> At present I am not sure if having symlinks in a distribution makes sense

I agree.
In my case symlinks are being used to restructure a large legacy module into smaller packages. When creating sdists the symlinks are dereferenced on another developer's host (OSX) and all is well but they on my host (Linux) I get packages with broken symlinks.

> BTW the example you link to is not at all monkey-patching

My mistake. When I worked around this issue I did monkey-patch sdist. I also just wrapped the source path is os.path.readlink() before hardlinking. I think the approach in that link is a much better solution so I have referred to it instead.

-Ollie

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15205>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 4, 2012, 4:07 AM

Post #7 of 7 (95 views)
Permalink
[issue15205] distutils dereferences symlinks on Mac OS X but not on Linux [In reply to]

Ollie Walsh <ollie.walsh [at] gmail> added the comment:

PS that should be os.readlink()

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15205>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.