Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build the image on a raspberry pi #33

Open
lb803 opened this issue Aug 27, 2020 · 3 comments
Open

Can't build the image on a raspberry pi #33

lb803 opened this issue Aug 27, 2020 · 3 comments

Comments

@lb803
Copy link

lb803 commented Aug 27, 2020

Hi!

I am trying to build this image on a raspberry pi 3 (rasbian), but the process gets stuck at the Dockerfile instruction:

RUN set -ex \
 && pipenv install --system --deploy --python=$(which python3)

This tosses a generic error which is not very interesting. However, if I open a bash shell into the container and I try to install manually the first package that fails with $ pip install cffi==1.14.1 I get this:

root@1f49095b4292:/# pip install cffi==1.14.1
WARNING: The directory '/var/lib/mopidy/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting cffi==1.14.1
  Downloading cffi-1.14.1.tar.gz (468 kB)
     |████████████████████████████████| 468 kB 1.2 MB/s 
Collecting pycparser
  Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB)
     |████████████████████████████████| 112 kB 1.6 MB/s 
Building wheels for collected packages: cffi
  Building wheel for cffi (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_amf63jg/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_amf63jg/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-qwlnbq_k
       cwd: /tmp/pip-install-_amf63jg/cffi/
  Complete output (48 lines):
  unable to execute 'arm-linux-gnueabihf-gcc': No such file or directory
  unable to execute 'arm-linux-gnueabihf-gcc': No such file or directory
  
      No working compiler found, or bogus compiler options passed to
      the compiler from Python's standard "distutils" module.  See
      the error messages above.  Likely, the problem is not related
      to CFFI but generic to the setup.py of any Python package that
      tries to compile C code.  (Hints: on OS/X 10.8, for errors about
      -mno-fused-madd see http://stackoverflow.com/questions/22313407/
      Otherwise, see https://wiki.python.org/moin/CompLangPython or
      the IRC channel #python on irc.freenode.net.)
  
      Trying to continue anyway.  If you are trying to install CFFI from
      a build done in a different context, you can ignore this warning.
  
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-armv7l-3.7
  creating build/lib.linux-armv7l-3.7/cffi
  copying cffi/commontypes.py -> build/lib.linux-armv7l-3.7/cffi
  copying cffi/pkgconfig.py -> build/lib.linux-armv7l-3.7/cffi
  copying cffi/api.py -> build/lib.linux-armv7l-3.7/cffi
  copying cffi/ffiplatform.py -> build/lib.linux-armv7l-3.7/cffi
  copying cffi/recompiler.py -> build/lib.linux-armv7l-3.7/cffi
  copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-3.7/cffi
  copying cffi/model.py -> build/lib.linux-armv7l-3.7/cffi
  copying cffi/vengine_gen.py -> build/lib.linux-armv7l-3.7/cffi
  copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-3.7/cffi
  copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-3.7/cffi
  copying cffi/__init__.py -> build/lib.linux-armv7l-3.7/cffi
  copying cffi/lock.py -> build/lib.linux-armv7l-3.7/cffi
  copying cffi/verifier.py -> build/lib.linux-armv7l-3.7/cffi
  copying cffi/cparser.py -> build/lib.linux-armv7l-3.7/cffi
  copying cffi/error.py -> build/lib.linux-armv7l-3.7/cffi
  copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-3.7/cffi
  copying cffi/_cffi_include.h -> build/lib.linux-armv7l-3.7/cffi
  copying cffi/parse_c_type.h -> build/lib.linux-armv7l-3.7/cffi
  copying cffi/_embedding.h -> build/lib.linux-armv7l-3.7/cffi
  copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-3.7/cffi
  running build_ext
  building '_cffi_backend' extension
  creating build/temp.linux-armv7l-3.7
  creating build/temp.linux-armv7l-3.7/c
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.7m -c c/_cffi_backend.c -o build/temp.linux-armv7l-3.7/c/_cffi_backend.o
  unable to execute 'arm-linux-gnueabihf-gcc': No such file or directory
  error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for cffi
  Running setup.py clean for cffi
Failed to build cffi
DEPRECATION: Could not build wheels for cffi which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
Installing collected packages: pycparser, cffi
    Running setup.py install for cffi ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_amf63jg/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_amf63jg/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-69bt8n_3/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7/cffi
         cwd: /tmp/pip-install-_amf63jg/cffi/
    Complete output (48 lines):
    unable to execute 'arm-linux-gnueabihf-gcc': No such file or directory
    unable to execute 'arm-linux-gnueabihf-gcc': No such file or directory
    
        No working compiler found, or bogus compiler options passed to
        the compiler from Python's standard "distutils" module.  See
        the error messages above.  Likely, the problem is not related
        to CFFI but generic to the setup.py of any Python package that
        tries to compile C code.  (Hints: on OS/X 10.8, for errors about
        -mno-fused-madd see http://stackoverflow.com/questions/22313407/
        Otherwise, see https://wiki.python.org/moin/CompLangPython or
        the IRC channel #python on irc.freenode.net.)
    
        Trying to continue anyway.  If you are trying to install CFFI from
        a build done in a different context, you can ignore this warning.
    
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-armv7l-3.7
    creating build/lib.linux-armv7l-3.7/cffi
    copying cffi/commontypes.py -> build/lib.linux-armv7l-3.7/cffi
    copying cffi/pkgconfig.py -> build/lib.linux-armv7l-3.7/cffi
    copying cffi/api.py -> build/lib.linux-armv7l-3.7/cffi
    copying cffi/ffiplatform.py -> build/lib.linux-armv7l-3.7/cffi
    copying cffi/recompiler.py -> build/lib.linux-armv7l-3.7/cffi
    copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-3.7/cffi
    copying cffi/model.py -> build/lib.linux-armv7l-3.7/cffi
    copying cffi/vengine_gen.py -> build/lib.linux-armv7l-3.7/cffi
    copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-3.7/cffi
    copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-3.7/cffi
    copying cffi/__init__.py -> build/lib.linux-armv7l-3.7/cffi
    copying cffi/lock.py -> build/lib.linux-armv7l-3.7/cffi
    copying cffi/verifier.py -> build/lib.linux-armv7l-3.7/cffi
    copying cffi/cparser.py -> build/lib.linux-armv7l-3.7/cffi
    copying cffi/error.py -> build/lib.linux-armv7l-3.7/cffi
    copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-3.7/cffi
    copying cffi/_cffi_include.h -> build/lib.linux-armv7l-3.7/cffi
    copying cffi/parse_c_type.h -> build/lib.linux-armv7l-3.7/cffi
    copying cffi/_embedding.h -> build/lib.linux-armv7l-3.7/cffi
    copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-3.7/cffi
    running build_ext
    building '_cffi_backend' extension
    creating build/temp.linux-armv7l-3.7
    creating build/temp.linux-armv7l-3.7/c
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.7m -c c/_cffi_backend.c -o build/temp.linux-armv7l-3.7/c/_cffi_backend.o
    unable to execute 'arm-linux-gnueabihf-gcc': No such file or directory
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_amf63jg/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_amf63jg/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-69bt8n_3/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7/cffi Check the logs for full command output.

Any thoughts?
Thanks!!

@scls19fr
Copy link

Hi,

I also tried to deploy Mopidy on a Raspberry Pi 2 model B with Balena Cloud (previously known as Resin.io) using :

deploy button

but deployment failed.

Here is the log:

[Info]     Starting build for docker-mopidy, user ...
[Info]     Dashboard link: https://dashboard.balena-cloud.com/apps/1767487/devices
[Info]     Building on arm03
[Info]     Pulling previous images for caching purposes...
[Success]  Successfully pulled cache images
[Info]     Starting to build main
[Info]     Uploading images
[Success]  Successfully uploaded images
[Error]    Some services failed to build:
[Error]      Service: main
[Error]        Error: The command '/bin/sh -c set -ex  && pipenv install --system --deploy --python=$(which python3)' returned a non-zero code: 1
[Info]     Built on arm03
[Error]    Not deploying release.

So help will be great!

Kind regards

@kferrone
Copy link

kferrone commented Dec 3, 2020

The image should be pushed as a Multi Arch image. Then one would not have to care whether the base arch is amd, arm, aarch, x86, etc.

I attempted to build the image for Arm64 on RaspberryPi with Ubuntu.
I got the following error:

Unable to locate package mopidy-spotify

When I look up this error, all the solutions show the Dockerfile is indeed correct. When I build on Amd64 arch, the image is built just fine.
Is this spotify package not compiled for Arm64?

@embolon
Copy link

embolon commented Jul 11, 2021

Would like to see this officially supported on arm/arm64 as well.

@sunjam sunjam mentioned this issue Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants