easy_install кросс-скомпилированного модуля python netifaces 0.8 завершается сбоем, поскольку он "не может найти подходящее распределение"
Я кросс-компилирую модуль Python 'netifaces' для ARM, используя набор инструментов Digi Embedded Linux на 32-битном хосте Ubuntu 12.04.4, но у меня возникают проблемы с установкой моего целевого устройства для правильной установки. В конечном счете, я хотел бы включить артефакты netifaces в мои rootfs, но это происходит после этого.
Вот мои шаги для кросс-компиляции:
$ wget https://pypi.python.org/packages/source/n/netifaces/netifaces-0.8.tar.gz
$ tar xzf netifaces-0.8.tar.gz
$ cd netifaces-0.8
$ PYTHONXCPREFIX=/path/to/digi/sysroot/with/xc-python2.7/added/usr CROSS_COMPILE=arm-cortex_a8-linux-gnueabi- CC="arm-cortex_a8-linux-gnueabi-gcc -pthread" LDSHARED="arm-cortex_a8-linux-gnueabi-gcc -pthread -shared" LDFLAGS="-L/path/to/digi/sysroot/with/xc-python2.7/added/usr/lib -L/path/to/digi/sysroot/with/xc-python2.7/added/lib" python setup.py build -x bdist_egg --plat-name=linux-arm
options (after parsing config files):
options (after parsing command line):
option dict for 'aliases' command:
{}
option dict for 'bdist_egg' command:
{'plat_name': ('command line', 'linux-arm')}
option dict for 'build' command:
{'cross_compile': ('command line', 1), 'debug': ('command line', 1)}
option dict for 'egg_info' command:
{'tag_build': ('setup.cfg', ''),
'tag_date': ('setup.cfg', '0'),
'tag_svn_revision': ('setup.cfg', '0')}
running build
Distribution.get_command_obj(): creating 'build' command object
setting options for 'build' command:
debug = 1 (from command line)
cross_compile = 1 (from command line)
Setting prefix
running build_ext
Distribution.get_command_obj(): creating 'build_ext' command object
checking for getifaddrs...found.
checking for getnameinfo...found.
checking for optional header files...netash/ash.h netatalk/at.h netax25/ax25.h neteconet/ec.h netipx/ipx.h netpacket/packet.h linux/irda.h linux/atm.h linux/llc.h linux/tipc.h linux/dn.h.
checking whether struct sockaddr has a length field...no.
checking which sockaddr_xxx structs are defined...at ax25 in in6 ipx un ash ec ll atmpvc atmsvc dn irda llc.
building 'netifaces' extension
arm-cortex_a8-linux-gnueabi-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -g -DNETIFACES_VERSION=0.8 -DHAVE_GETIFADDRS=1 -DHAVE_GETNAMEINFO=1 -DHAVE_NETASH_ASH_H=1 -DHAVE_NETATALK_AT_H=1 -DHAVE_NETAX25_AX25_H=1 -DHAVE_NETECONET_EC_H=1 -DHAVE_NETIPX_IPX_H=1 -DHAVE_NETPACKET_PACKET_H=1 -DHAVE_LINUX_IRDA_H=1 -DHAVE_LINUX_ATM_H=1 -DHAVE_LINUX_LLC_H=1 -DHAVE_LINUX_TIPC_H=1 -DHAVE_LINUX_DN_H=1 -DHAVE_SOCKADDR_AT=1 -DHAVE_SOCKADDR_AX25=1 -DHAVE_SOCKADDR_IN=1 -DHAVE_SOCKADDR_IN6=1 -DHAVE_SOCKADDR_IPX=1 -DHAVE_SOCKADDR_UN=1 -DHAVE_SOCKADDR_ASH=1 -DHAVE_SOCKADDR_EC=1 -DHAVE_SOCKADDR_LL=1 -DHAVE_SOCKADDR_ATMPVC=1 -DHAVE_SOCKADDR_ATMSVC=1 -DHAVE_SOCKADDR_DN=1 -DHAVE_SOCKADDR_IRDA=1 -DHAVE_SOCKADDR_LLC=1 -I/path/to/digi/sysroot/with/xc-python2.7/added/usr/include/python2.7 -c netifaces.c -o build/temp.linux-i686-2.7/netifaces.o
creating build/lib.linux-i686-2.7
arm-cortex_a8-linux-gnueabi-gcc -pthread -shared -L/path/to/digi/sysroot/with/xc-python2.7/added/usr/lib -L/path/to/digi/sysroot/with/xc-python2.7/added/lib -g build/temp.linux-i686-2.7/netifaces.o -o build/lib.linux-i686-2.7/netifaces.so
running bdist_egg
Distribution.get_command_obj(): creating 'bdist_egg' command object
setting options for 'bdist_egg' command:
plat_name = linux-arm (from command line)
Distribution.get_command_obj(): creating 'egg_info' command object
setting options for 'egg_info' command:
tag_build = (from setup.cfg)
tag_date = 0 (from setup.cfg)
tag_svn_revision = 0 (from setup.cfg)
Distribution.get_command_obj(): creating 'bdist' command object
running egg_info
writing netifaces.egg-info/PKG-INFO
writing top-level names to netifaces.egg-info/top_level.txt
writing dependency_links to netifaces.egg-info/dependency_links.txt
reading manifest file 'netifaces.egg-info/SOURCES.txt'
include_pattern: applying regex r'^netifaces\.egg\-info/.*[^/]*\Z(?ms)'
adding netifaces.egg-info/PKG-INFO
adding netifaces.egg-info/SOURCES.txt
adding netifaces.egg-info/top_level.txt
adding netifaces.egg-info/dependency_links.txt
exclude_pattern: applying regex r'^build/.*'
exclude_pattern: applying regex r'^netifaces\-0\.8/.*'
exclude_pattern: applying regex r'\/(RCS|CVS|\.svn)\/'
writing manifest file 'netifaces.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-i686/egg
Distribution.get_command_obj(): creating 'install' command object
pre-finalize_{unix,other}:
prefix: None
exec_prefix: None
home: None
user: 0
install_base: None
install_platbase: None
root: None
install_purelib: None
install_platlib: None
install_lib: None
install_headers: None
install_scripts: None
install_data: None
compile: None
compile: True
optimize: None
force: None
skip_build: 0
record: None
install_layout: None
old_and_unmanageable: None
single_version_externally_managed: None
post-finalize_{unix,other}():
prefix: /usr
exec_prefix: /usr
home: None
user: 0
install_base: /usr
install_platbase: /usr
root: None
install_purelib: $base/local/lib/python$py_version_short/dist-packages
install_platlib: $platbase/local/lib/python$py_version_short/dist-packages
install_lib: None
install_headers: $base/local/include/python$py_version_short/$dist_name
install_scripts: $base/local/bin
install_data: $base/local
compile: None
compile: True
optimize: None
force: None
skip_build: 0
record: None
install_layout: None
old_and_unmanageable: None
single_version_externally_managed: None
post-expand_basedirs():
prefix: /usr
exec_prefix: /usr
home: None
user: 0
install_base: /usr
install_platbase: /usr
root: None
install_purelib: $base/local/lib/python$py_version_short/dist-packages
install_platlib: $platbase/local/lib/python$py_version_short/dist-packages
install_lib: None
install_headers: $base/local/include/python$py_version_short/$dist_name
install_scripts: $base/local/bin
install_data: $base/local
compile: None
compile: True
optimize: None
force: None
skip_build: 0
record: None
install_layout: None
old_and_unmanageable: None
single_version_externally_managed: None
config vars:
{'base': '/usr',
'dist_fullname': 'netifaces-0.8',
'dist_name': 'netifaces',
'dist_version': '0.8',
'exec_prefix': '/path/to/digi/sysroot/with/xc-python2.7/added/usr',
'platbase': '/usr',
'prefix': '/path/to/digi/sysroot/with/xc-python2.7/added/usr',
'py_version': '2.7.3',
'py_version_nodot': '27',
'py_version_short': '2.7',
'sys_exec_prefix': '/path/to/digi/sysroot/with/xc-python2.7/added/usr',
'sys_prefix': '/path/to/digi/sysroot/with/xc-python2.7/added/usr',
'userbase': '/home/myuser/.local',
'usersite': '/home/myuser/.local/lib/python2.7/site-packages'}
post-expand_dirs():
prefix: /usr
exec_prefix: /usr
home: None
user: 0
install_base: /usr
install_platbase: /usr
root: None
install_purelib: /usr/local/lib/python2.7/dist-packages
install_platlib: /usr/local/lib/python2.7/dist-packages
install_lib: None
install_headers: /usr/local/include/python2.7/netifaces
install_scripts: /usr/local/bin
install_data: /usr/local
compile: None
compile: True
optimize: None
force: None
skip_build: 0
record: None
install_layout: None
old_and_unmanageable: None
single_version_externally_managed: None
after prepending root:
prefix: /usr
exec_prefix: /usr
home: None
user: 0
install_base: /usr
install_platbase: /usr
root: None
install_purelib: /usr/local/lib/python2.7/dist-packages
install_platlib: /usr/local/lib/python2.7/dist-packages
install_lib: /usr/local/lib/python2.7/dist-packages/
install_headers: /usr/local/include/python2.7/netifaces
install_scripts: /usr/local/bin
install_data: /usr/local
compile: None
compile: True
optimize: None
force: None
skip_build: 0
record: None
install_layout: None
old_and_unmanageable: None
single_version_externally_managed: None
Distribution.get_command_obj(): creating 'install_lib' command object
running install_lib
creating build/bdist.linux-i686
creating build/bdist.linux-i686/egg
copying build/lib.linux-i686-2.7/netifaces.so -> build/bdist.linux-i686/egg
creating stub loader for netifaces.so
byte-compiling build/bdist.linux-i686/egg/netifaces.py to netifaces.pyc
creating build/bdist.linux-i686/egg/EGG-INFO
copying netifaces.egg-info/PKG-INFO -> build/bdist.linux-i686/egg/EGG-INFO
copying netifaces.egg-info/SOURCES.txt -> build/bdist.linux-i686/egg/EGG-INFO
copying netifaces.egg-info/dependency_links.txt -> build/bdist.linux-i686/egg/EGG-INFO
copying netifaces.egg-info/top_level.txt -> build/bdist.linux-i686/egg/EGG-INFO
writing build/bdist.linux-i686/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/netifaces-0.8-py2.7-linux-arm.egg' and adding 'build/bdist.linux-i686/egg' to it
removing 'build/bdist.linux-i686/egg' (and everything under it)
(У приведенного выше фрагмента есть пути изменения, чтобы защитить невинных.)
Я знаю, что компиляция была для ARM (а не хоста), так как следующее выглядит корректно:
$ file build/lib.linux-i686-2.7/netifaces.so
build/lib.linux-i686-2.7/netifaces.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped
Это дает мне артефакт dist/netifaces-0.8-py2.7-linux-arm.egg. Я копирую этот артефакт на целевое устройство и запускаю easy_install (пункт не доступен). Я не хочу, чтобы целевое устройство выходило в Интернет, чтобы получать данные из pypi, так как это устройство должно иметь контролируемую конфигурацию, и на устройстве нет резидентных компиляторов для компиляции пакетов pypi. Это ошибки вроде так:
# uname -a
Linux devicename 2.6.35.14 #1 Thu May 15 10:25:00 CDT 2014 armv7l GNU/Linux
# python --version
Python 2.7.3
# easy_install -v -H None -f ./ netifaces-0.8-py2.7-linux-arm.egg
Processing netifaces-0.8-py2.7-linux-arm.egg
Copying netifaces-0.8-py2.7-linux-arm.egg to /usr/lib/python2.7/site-packages
Adding netifaces 0.8 to easy-install.pth file
Saving /usr/lib/python2.7/site-packages/easy-install.pth
Installed /usr/lib/python2.7/site-packages/netifaces-0.8-py2.7-linux-arm.egg
Processing dependencies for netifaces==0.8
Searching for netifaces==0.8
Note: Bypassing https://pypi.python.org/simple/netifaces/ (disallowed host; see http://bit.ly/1dg9ijs for details).
Couldn't find index page for 'netifaces' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Note: Bypassing https://pypi.python.org/simple/ (disallowed host; see http://bit.ly/1dg9ijs for details).
No local packages or download links found for netifaces==0.8
error: Could not find suitable distribution for Requirement.parse('netifaces==0.8')
Я также попробовал вышеупомянутую команду с просто 'netifaces' в качестве аргумента пакета, но безрезультатно.
Я получаю другой результат, когда удаляю аргумент '-H None' (позволяя ему перейти к pypi), но это, очевидно, приводит к ошибкам, потому что нет доступного компилятора. Я не хочу использовать этот подход в любом случае, но я включаю его здесь для полноты.
# easy_install -v -f ./ netifaces-0.8-py2.7-linux-arm.egg
Processing netifaces-0.8-py2.7-linux-arm.egg
Copying netifaces-0.8-py2.7-linux-arm.egg to /usr/lib/python2.7/site-packages
Adding netifaces 0.8 to easy-install.pth file
Saving /usr/lib/python2.7/site-packages/easy-install.pth
Installed /usr/lib/python2.7/site-packages/netifaces-0.8-py2.7-linux-arm.egg
Processing dependencies for netifaces==0.8
Searching for netifaces==0.8
Reading https://pypi.python.org/simple/netifaces/
Found link: https://pypi.python.org/packages/2.6/n/netifaces/netifaces-0.10.1-py2.6-win32.egg#md5=c8c5f7e4a403dd416b435ad8eddefed1
Found link: https://pypi.python.org/packages/2.6/n/netifaces/netifaces-0.10.1.win32-py2.6.exe#md5=bf229517b6b3d40ad0991fc6b504043d
Found link: https://pypi.python.org/packages/2.6/n/netifaces/netifaces-0.10.2-py2.6-win32.egg#md5=07fb22d2408bf2969c18cfa1711bd5d6
Found link: https://pypi.python.org/packages/2.6/n/netifaces/netifaces-0.10.2.win32-py2.6.exe#md5=e55e5fd188e4e6fda21942b665a2fca3
Found link: https://pypi.python.org/packages/2.6/n/netifaces/netifaces-0.10.3-py2.6-win32.egg#md5=1b0c3b5a76bd543d45ec4d6fa50f29f4
Found link: https://pypi.python.org/packages/2.6/n/netifaces/netifaces-0.10.3.win32-py2.6.exe#md5=da9e984985970d7ced4dd69314ac0e14
Found link: https://pypi.python.org/packages/2.7/n/netifaces/netifaces-0.10.0-py2.7-linux-x86_64.egg#md5=4bf3f4a83c84d7c7fab7f50958948c2f
Found link: https://pypi.python.org/packages/2.7/n/netifaces/netifaces-0.10.0-py2.7-macosx-10.9-intel.egg#md5=c1f80786a62a088a0d882a7291fc0003
Found link: https://pypi.python.org/packages/2.7/n/netifaces/netifaces-0.10.0-py2.7-win32.egg#md5=5dc7c3e416371423ac966fcb152272ff
Found link: https://pypi.python.org/packages/2.7/n/netifaces/netifaces-0.10.1-py2.7-win32.egg#md5=0295b17dc388d2cb5ac73a50dbd2e6e4
Found link: https://pypi.python.org/packages/2.7/n/netifaces/netifaces-0.10.1.win32-py2.7.exe#md5=b1584b3a9db0c763c94511f4e508f4fe
Found link: https://pypi.python.org/packages/2.7/n/netifaces/netifaces-0.10.2-py2.7-win32.egg#md5=cd06faf5faccc13f71bad4bde03de3c1
Found link: https://pypi.python.org/packages/2.7/n/netifaces/netifaces-0.10.2.win32-py2.7.exe#md5=9b2e1fb6a8c4a4325e33884fafeb7882
Found link: https://pypi.python.org/packages/2.7/n/netifaces/netifaces-0.10.3-py2.7-win32.egg#md5=aacaa28c603070e4347630d76e5a5df9
Found link: https://pypi.python.org/packages/2.7/n/netifaces/netifaces-0.10.3.win32-py2.7.exe#md5=78647c9bade6880b99c7462a46648bc5
Found link: https://pypi.python.org/packages/3.3/n/netifaces/netifaces-0.10.1-py3.3-win32.egg#md5=f10939775f4ec4806e0d43582f090925
Found link: https://pypi.python.org/packages/3.3/n/netifaces/netifaces-0.10.1.win32-py3.3.exe#md5=11b6f9f84eb42f53d574dfd9f1326164
Found link: https://pypi.python.org/packages/3.3/n/netifaces/netifaces-0.10.2-py3.3-win32.egg#md5=1a0b71b320246eaed195bd61c4dce4e1
Found link: https://pypi.python.org/packages/3.3/n/netifaces/netifaces-0.10.2.win32-py3.3.exe#md5=d2738c8bf7401f860a813a9e20ab168d
Found link: https://pypi.python.org/packages/3.3/n/netifaces/netifaces-0.10.3-py3.3-win32.egg#md5=95a1732bd403d7afb1ab02ca230cc40c
Found link: https://pypi.python.org/packages/3.3/n/netifaces/netifaces-0.10.3.win32-py3.3.exe#md5=68f654fe15512642a708e40f5dc0b5b0
Found link: https://pypi.python.org/packages/3.4/n/netifaces/netifaces-0.10.0-py3.4-linux-x86_64.egg#md5=a0653891e193ab87e33f6688c229e2e8
Found link: https://pypi.python.org/packages/3.4/n/netifaces/netifaces-0.10.0-py3.4-macosx-10.6-intel.egg#md5=12fe125c18eb1103efa1b5b24d8eafb6
Found link: https://pypi.python.org/packages/3.4/n/netifaces/netifaces-0.10.0-py3.4-win32.egg#md5=1c96ff8e56893e2a87292481c9a1e385
Found link: https://pypi.python.org/packages/3.4/n/netifaces/netifaces-0.10.1-py3.4-win32.egg#md5=7ccc760d873a547d967876e180094f31
Found link: https://pypi.python.org/packages/3.4/n/netifaces/netifaces-0.10.1.win32-py3.4.exe#md5=c191ecd57dd0d5d479a7d5b3607bd889
Found link: https://pypi.python.org/packages/3.4/n/netifaces/netifaces-0.10.2-py3.4-win32.egg#md5=d2aa751f68d96c3f81a1065527a7bccf
Found link: https://pypi.python.org/packages/3.4/n/netifaces/netifaces-0.10.2.win32-py3.4.exe#md5=911b9bd3621b6beee6c7547051ecdf6f
Found link: https://pypi.python.org/packages/3.4/n/netifaces/netifaces-0.10.3-py3.4-win32.egg#md5=dcc30c3564308115b86046bb45659ccb
Found link: https://pypi.python.org/packages/3.4/n/netifaces/netifaces-0.10.3.win32-py3.4.exe#md5=d62ab19a1cc07bfafcfb1a9f7660231b
Found link: https://pypi.python.org/packages/source/n/netifaces/netifaces-0.10.0.tar.gz#md5=bbe634bd373b3f05df5f4ac23bc92a8f
Found link: https://pypi.python.org/packages/source/n/netifaces/netifaces-0.10.1.tar.gz#md5=4f92ca84e8cb1ce547998e7212ac313d
Found link: https://pypi.python.org/packages/source/n/netifaces/netifaces-0.10.2.tar.gz#md5=acb11ba95d892519825e170d814ee296
Found link: https://pypi.python.org/packages/source/n/netifaces/netifaces-0.10.3.tar.gz#md5=b96913473e1dcc3c4a7c43bc15d10e26
Found link: https://pypi.python.org/packages/source/n/netifaces/netifaces-0.10.4.tar.gz#md5=36da76e2cfadd24cc7510c2c0012eb1e
Found link: https://pypi.python.org/packages/source/n/netifaces/netifaces-0.8.tar.gz#md5=e57e5983f4c286fac5f8068fbfc5c873
Found link: http://alastairs-place.net/projects/netifaces/netifaces-0.8.tar.gz#md5=e57e5983f4c286fac5f8068fbfc5c873
Best match: netifaces 0.8
Downloading https://pypi.python.org/packages/source/n/netifaces/netifaces-0.8.tar.gz#md5=e57e5983f4c286fac5f8068fbfc5c873
Validating md5 checksum for /tmp/easy_install-k1bwIN/netifaces-0.8.tar.gz
Processing netifaces-0.8.tar.gz
Unpacking netifaces-0.8 to /tmp/easy_install-k1bwIN/netifaces-0.8
Unpacking netifaces-0.8/PKG-INFO to /tmp/easy_install-k1bwIN/netifaces-0.8/PKG-INFO
Unpacking netifaces-0.8/README to /tmp/easy_install-k1bwIN/netifaces-0.8/README
Unpacking netifaces-0.8/netifaces.c to /tmp/easy_install-k1bwIN/netifaces-0.8/netifaces.c
Unpacking netifaces-0.8/netifaces.egg-info to /tmp/easy_install-k1bwIN/netifaces-0.8/netifaces.egg-info
Unpacking netifaces-0.8/netifaces.egg-info/PKG-INFO to /tmp/easy_install-k1bwIN/netifaces-0.8/netifaces.egg-info/PKG-INFO
Unpacking netifaces-0.8/netifaces.egg-info/SOURCES.txt to /tmp/easy_install-k1bwIN/netifaces-0.8/netifaces.egg-info/SOURCES.txt
Unpacking netifaces-0.8/netifaces.egg-info/dependency_links.txt to /tmp/easy_install-k1bwIN/netifaces-0.8/netifaces.egg-info/dependency_links.txt
Unpacking netifaces-0.8/netifaces.egg-info/top_level.txt to /tmp/easy_install-k1bwIN/netifaces-0.8/netifaces.egg-info/top_level.txt
Unpacking netifaces-0.8/setup.cfg to /tmp/easy_install-k1bwIN/netifaces-0.8/setup.cfg
Unpacking netifaces-0.8/setup.py to /tmp/easy_install-k1bwIN/netifaces-0.8/setup.py
Reading configuration from /tmp/easy_install-k1bwIN/netifaces-0.8/setup.cfg
Adding new section [easy_install] to /tmp/easy_install-k1bwIN/netifaces-0.8/setup.cfg
Setting easy_install.find-links to '.' in /tmp/easy_install-k1bwIN/netifaces-0.8/setup.cfg
Writing /tmp/easy_install-k1bwIN/netifaces-0.8/setup.cfg
Running netifaces-0.8/setup.py bdist_egg --dist-dir /tmp/easy_install-k1bwIN/netifaces-0.8/egg-dist-tmp-1l9yta
running bdist_egg
running egg_info
writing netifaces.egg-info/PKG-INFO
writing top-level names to netifaces.egg-info/top_level.txt
writing dependency_links to netifaces.egg-info/dependency_links.txt
reading manifest file 'netifaces.egg-info/SOURCES.txt'
writing manifest file 'netifaces.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-armv7l/egg
running install_lib
running build_ext
checking for getifaddrs...not found.
checking for getnameinfo...not found.
checking for socket IOCTLs...not found.
checking for optional header files...none found.
checking whether struct sockaddr has a length field...no.
checking which sockaddr_xxx structs are defined...none!
building 'netifaces' extension
arm-cortex_a8-linux-gnueabi-gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DNETIFACES_VERSION=0.8 -I/usr/include/python2.7 -c netifaces.c -o build/temp.linux-armv7l-2.7/netifaces.o
unable to execute arm-cortex_a8-linux-gnueabi-gcc: No such file or directory
error: Setup script exited with error: command 'arm-cortex_a8-linux-gnueabi-gcc' failed with exit status 1
Так почему же easy_install не находит подходящий дистрибутив, когда я пытаюсь установить локально скомпилированное локально резидентное яйцо bdist? Насколько я могу судить, яйцо отформатировано правильно, и его артефакты предназначены для ARM. Я не пошел на исправление файлов или чего-либо в исходном tar.gz. Что я делаю неправильно?