Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 301647 - current way to disable pyc compiling can cause cross-device link in python_copy_sources
Summary: current way to disable pyc compiling can cause cross-device link in python_co...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: All FreeBSD
: High normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-20 17:29 UTC by Naohiro Aota
Modified: 2010-03-04 18:56 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Naohiro Aota gentoo-dev 2010-01-20 17:29:28 UTC
In some ebuilds in dev-python/*, we have these lines.

>	# disable pyc compiling
>	mv py-compile py-compile.orig
>	ln -s $(type -P true) py-compile

This make "py-compile" to be symlink to "/usr/bin/true" on FreeBSD. Then python_copy_sources() (defined in python.eclass) try to hardlink "py-compile", but we cannot make hardlink to symlink itself on FreeBSD (or some other systems). Instead we get hardlink to original file ("/usr/bin/true" here). This can cause cross-device link.


Reproducible: Always

Steps to Reproduce:
1.mkdir /tmp/portage
2.mount -t tmpfs none /tmp/portage
3.PORTAGE_TMPDIR="/tmp/portage" emerge pygobject

Actual Results:  
emerge fail with "cp: /tmp/portage/portage/dev-python/pygobject-2.20.0/work/pygobject-2.20.0-2.6/py-compile: Cross-device link"
Comment 1 Alexis Ballier gentoo-dev 2010-01-20 19:09:29 UTC
I suppose python people should have read: http://www.opengroup.org/onlinepubs/9699919799/utilities/cp.html


the -l option to cp isn't standard; it happens to follow symbolic links on FreeBSD but not on linux with gnu cp. The no_link option should always be set to 1 in python_copy_sources if userland_GNU isn't set.
Comment 2 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-03-04 18:56:22 UTC
--no-link option was removed some time ago for a different reason.