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

PiAware will not build on Ubuntu 24.04. #575

Open
jprochazka opened this issue Jun 28, 2024 · 8 comments
Open

PiAware will not build on Ubuntu 24.04. #575

jprochazka opened this issue Jun 28, 2024 · 8 comments
Assignees

Comments

@jprochazka
Copy link
Owner

jprochazka commented Jun 28, 2024

NOTE: This issue affects any release using Python 3.12 or greater not just Nobel.

The PiAware build halts with the following error when trying to build the PiAware package.

  File "/home/joe/adsb-receiver/build/piaware_builder/package-bookworm/debian/venv/lib/python3.12/site-packages/cx_Freeze/finder.py", line 33, in <module>
    IMPORT_STAR = opcode.opmap["IMPORT_STAR"]
                  ~~~~~~~~~~~~^^^^^^^^^^^^^^^
KeyError: 'IMPORT_STAR'

It would appear that cx_Freeze does not support Paython 3.12 which is the version of Python installed on Ubuntu Noble Numbat or the Ubuntu team has not yet updated things on their end. A fix for this issue appears to be available from the cx_Freeze developers but at this time the newer release supporting Python 3.12 is not available via the Ubuntu package repositories. I have been trying to implement a fix located in the following post from the cx_Freeze issue tracker using pipx and pip in a venv with no joy.

marcelotduarte/cx_Freeze#2153

Needless to say, the workaround is getting a bit more complicated than I would like it as far as this project is concerned. I am thinking that Noble Numbat support will need to be put on hold until a more permanent and stable solution is found.

Update:

After reading a post by @abcd567a on the FlightAware forums and looking through the bash scripts he kindly offered up to the community I found that it is possible to build PiAware on Nobel but it entails ditching MLAT functionality. IMO this is still a no go and until FlightAware team finds a fix or better yet the Ubuntu team gets on top updating cx_Freeze if it is in fact at a stable stage, Nobel support is still a no go unless anyone else has any ideas.

Update Two:

PiAware's MLAT code is using the asyncore module which was deprecated in version 3.6 and announced for removal in version 3.12 at the time of its release. Until the software is updated to use asyncio which is recommended in the Python documentation or some other solution it appears PiAware with MLAT support installations on systems using Python 3.12+ will not be possible.

https://peps.python.org/pep-0594/#asyncore

@abcd567a
Copy link

abcd567a commented Jul 4, 2024

I have tried to resolve this issue in March 2024 with marcelotdurate (author of cx_Freeze) and obj Oliver Jowet (author of mlat-client). Please see following thread in Flightaware forums:

https://discussions.flightaware.com/t/ubuntu-24-04-noble-numbat-desktop-server-install-piaware-dump1090-fa-dump978-fa-and-piaware-web/90939)


mlat-client-incompatability-with-python3 12


mlat-client-asyncio-python3 12


@jprochazka
Copy link
Owner Author

Thanks for the information @abcd567a.
Looks the addition of Nobel support will be a matter of waiting on updates from third parties.

@abcd567a
Copy link

abcd567a commented Jul 7, 2024

Yes, the work required is to update mlat-client source code to be compatible with python3.12 which uses asyncio instead of asyncore used by python3.11 and earlier.

Debian 13 Trixi Sed (still) uses python3.11, and hence Raspberry Pi OS Trixie will also use python3.11. As a result there seems to be no urgency for Flightaware to update mlat-client source code.

EDIT:

Just now ran sudo apt update and sudo apt upgrade on Debian Trixie SID, and python3 which used to be python3.11 got upgraded to python3.12.

Now same problem of fa-mlat-client on Debian 13 Trixie as on Ubuntu 24.04 Noble 😠


image


Screenshot_20240705_090830_Samsung Internet

@jprochazka
Copy link
Owner Author

jprochazka commented Jul 8, 2024

Makes sense being the asyncore module was marked as deprecated in Python 3.6 when it was released and marked for removal in 3.12. I am sure a fix will be incoming shortly, defiantly sometime before Trixie is released is my guess. :)

https://peps.python.org/pep-0594/#asyncore

@jprochazka
Copy link
Owner Author

jprochazka commented Jul 19, 2024

It looks as though someone packaged up the old asyncore module and made it available for those using Python 3.12+. I will begin work on support for Noble Numbat hopefully tonight. If things go well look for a release supporting Ubuntu 24.04 to be made available sometime this weekend.

https://packages.ubuntu.com/noble/python3-pyasyncore

pyasyncore on PyPi
Github Repository

“This package contains the asyncore module as found in Python versions prior to 3.12. It is provided so that existing code relying on import asyncore is able to continue being used without significant refactoring.”

Credit to @abcd567a for mentioning this in the FlightAware forums.

@jprochazka jprochazka self-assigned this Jul 19, 2024
@jprochazka
Copy link
Owner Author

Still encountering the KeyError: 'IMPORT_STAR' error as outlined originally.

@jprochazka
Copy link
Owner Author

I submitted a pull request to the piaware_builder repository which should fix this issue. I have experienced success on my end utilizing these changes.

@jprochazka
Copy link
Owner Author

jprochazka commented Jul 24, 2024

The master branch currently contains scripting to use my fork of piaware_builder which I have experienced success with. This will be the case until either the mentioned pull request is accepted, or another fix is merged into the piaware_builder repository. PiAware Trixie and Noble PiAware installs using this fork should be considered as use at your own risk until a fix is merged into the official piaware_builder repository.

All other distributions use the official piaware_build repository when building and installing PiAware.

This issue will remain open until an official fix is in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants