Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 591878 - sys-apps/portage-2.3.0 installs to wrong directory when cross-compiling
Summary: sys-apps/portage-2.3.0 installs to wrong directory when cross-compiling
Status: RESOLVED DUPLICATE of bug 582194
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-22 17:31 UTC by Sven Müller
Modified: 2016-08-23 02:43 UTC (History)
0 users

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


Attachments
install.log of portage (install.log,516.38 KB, text/plain)
2016-08-22 17:33 UTC, Sven Müller
Details
make.conf (make.conf,2.02 KB, text/plain)
2016-08-22 17:34 UTC, Sven Müller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Müller 2016-08-22 17:31:33 UTC
Host-machine: x86_64
Target-machine: armv7-a
Target directory: /usr/armv7a-hardfloat-linux-gnueabi/

Expected installation directory: 
/usr/armv7a-hardfloat-linux-gnueabi/usr/lib/python3.4/site-packages/portage
/usr/armv7a-hardfloat-linux-gnueabi/usr/lib/python2.7/site-packages/portage

Current installation directory: 
/usr/armv7a-hardfloat-linux-gnueabi/usr/lib64/python3.4/site-packages/portage
/usr/armv7a-hardfloat-linux-gnueabi/usr/lib64/python2.7/site-packages/portage

Executing emerge inside the arm chroot failes with error:
emerge
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.4/emerge", line 41, in <module>
    import portage
ImportError: No module named 'portage'



Reproducible: Always
Comment 1 Sven Müller 2016-08-22 17:33:10 UTC
Created attachment 443872 [details]
install.log of portage

install part of merging portage
Comment 2 Sven Müller 2016-08-22 17:34:52 UTC
Created attachment 443874 [details]
make.conf

/usr/armv7a-hardfloat-linux-gnueabi/etc/portage/make.conf
Comment 3 Zac Medico gentoo-dev 2016-08-22 19:50:35 UTC
The portage ebuild uses the distutils-r1 eclass, and I believe that the lib64 part of the installation path originates from the PYTHON_SITEDIR variable which is set by the python-utils-r1 eclass.

@python Am I right that python-utils-r1 eclass does not support cross-compiling?
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-08-22 19:54:40 UTC
I doubt anyone of us has any clue. Cross-compilation is only supported by a few people in Gentoo, and is hard to get right. I'd say this could be PEBKAC as well -- wrong setup that results in $(get_libdir) returning lib64.
Comment 5 Zac Medico gentoo-dev 2016-08-22 19:59:04 UTC
In the python-utils-r1 eclass, PYTHON_SITEDIR is assigned as follows:

PYTHON_SITEDIR=$("${PYTHON}" -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())') || die

Thhe get_libdir never enters into the picture, so the cross-compile support would have to be in distutils.sysconfig library, if anywhere.
Comment 6 Sven Müller 2016-08-22 20:25:00 UTC
(In reply to Michał Górny from comment #4)
> I'd say this could be PEBKAC
> as well -- wrong setup that results in $(get_libdir) returning lib64.

Thanks for this analysis. I'm not the only one: 

http://superuser.com/questions/1038509/why-does-portage-complain-for-lack-of-a-portage-python-module

(2nd answer)
Comment 7 Mike Gilbert gentoo-dev 2016-08-23 02:22:24 UTC
This was reported months ago in bug 582194. I don't see any obvious/simple solution.
Comment 8 Zac Medico gentoo-dev 2016-08-23 02:43:25 UTC

*** This bug has been marked as a duplicate of bug 582194 ***