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

Build errors #1

Open
ghost opened this issue Apr 18, 2019 · 3 comments
Open

Build errors #1

ghost opened this issue Apr 18, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented Apr 18, 2019

Hi, I discovered your repo from here: raspberrypi/tools#81 (comment).
I'm trying to use your scripts to cross-compile at least Qt5.12 for RPi3B+ with EGLFS and GPU drivers. Launching the setup.py script leads to an error:

The version specified ('') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.

I tried to get rid of it adding a dummy version (i.e. 1.0).
Then I issued python setup.py build and it created the skeleton of the project.

Now I don't know how to launch the building. I tried with sudo python setup.py install but it returned a lot of errors:

running install
running bdist_egg
running egg_info
creating pydo.egg-info
writing pydo.egg-info/PKG-INFO
writing top-level names to pydo.egg-info/top_level.txt
writing dependency_links to pydo.egg-info/dependency_links.txt
writing entry points to pydo.egg-info/entry_points.txt
writing manifest file 'pydo.egg-info/SOURCES.txt'
reading manifest file 'pydo.egg-info/SOURCES.txt'
writing manifest file 'pydo.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/pydo
copying build/lib.linux-x86_64-2.7/pydo/loghelper.py -> build/bdist.linux-x86_64/egg/pydo
copying build/lib.linux-x86_64-2.7/pydo/utils.py -> build/bdist.linux-x86_64/egg/pydo
copying build/lib.linux-x86_64-2.7/pydo/__main__.py -> build/bdist.linux-x86_64/egg/pydo
copying build/lib.linux-x86_64-2.7/pydo/commands.py -> build/bdist.linux-x86_64/egg/pydo
copying build/lib.linux-x86_64-2.7/pydo/scanners.py -> build/bdist.linux-x86_64/egg/pydo
copying build/lib.linux-x86_64-2.7/pydo/__init__.py -> build/bdist.linux-x86_64/egg/pydo
byte-compiling build/bdist.linux-x86_64/egg/pydo/loghelper.py to loghelper.pyc
  File "build/bdist.linux-x86_64/egg/pydo/loghelper.py", line 16
    name = f'{module.__name__.partition(".")[2]}:{frame.function}'
                                                                 ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/pydo/utils.py to utils.pyc
  File "build/bdist.linux-x86_64/egg/pydo/utils.py", line 23
    logger.debug(f'textwrap output: {repr(result)}')
                                                  ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/pydo/__main__.py to __main__.pyc
  File "build/bdist.linux-x86_64/egg/pydo/__main__.py", line 90
    print(f'{module.partition(".")[2]}:{f.__name__}')
                                                   ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/pydo/commands.py to commands.pyc
  File "build/bdist.linux-x86_64/egg/pydo/commands.py", line 38
    name = f'{_module.__name__.partition(".")[2]}:{f.__name__}'
                                                              ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/pydo/scanners.py to scanners.pyc
  File "build/bdist.linux-x86_64/egg/pydo/scanners.py", line 19
    yield from d.rglob('*')
             ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/pydo/__init__.py to __init__.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying pydo.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pydo.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pydo.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pydo.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pydo.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/pydo-1.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing pydo-1.0-py2.7.egg
Copying pydo-1.0-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding pydo 1.0 to easy-install.pth file
Installing pydo script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/pydo-1.0-py2.7.egg
Processing dependencies for pydo==1.0
Finished processing dependencies for pydo==1.0

Perhaps there are some prerequisites I need to install before?

@ali1234
Copy link
Owner

ali1234 commented Apr 18, 2019

Only Python 3.6+ is supported.

@ghost
Copy link
Author

ghost commented Apr 18, 2019

Upgraded my distro and now the build/install commands complete successfully in few seconds!

But I don't understand how to launch the build of the target system with Qt5.12 from the output files created. Perhaps I mis-understood something, but when you said:

I ended up writing a custom build tool (https://github.com/ali1234/pydo/) to manage all the ever growing list of workarounds in https://github.com/ali1234/rpi-ramdisk. In addition to the final ramdisk target it produces tgz files with the runtime libraries which you can just unpack on regular raspbian and add to the ld config. It constructs the sysroot directly from debs using multistrap and then applies all the workarounds. It downloads my abe toolchain binary releases from github. Then it builds the kernel (twice) and all the selected packages (eg Qt, gstreamer etc). You also get a qt-host directory that you can use for cross compiling outside rpi-ramdisk. qmake from that dir will set up the environment to compile against the rpi-ramdisk sysroot. It does produce Qt EGLFS executables that run on Pi Zero, but they are a bit slow compared to Pi 3.

I understand that launching this script will do all the things you described (ramdisk target, sysroot, cross-compile toolchain, Qt5, etc...) automatically.

@ali1234
Copy link
Owner

ali1234 commented Apr 18, 2019

Recursive clone rpi-ramdisk, install all the packages in the README, then run pydo --init . in the top of the repository. Copy a config with cp configs/qmldemo.config.py config.py. Then run pydo build to build everything or pydo packages.qt:build to just build Qt. The runtime will be in packages/qt/qt.tar.gz and qmake for cross compiling is at packages/qt/qt-host/bin/qmake

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

1 participant