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

Support for building on Ubuntu 22.04 #193

Closed
nuclearsandwich opened this issue Nov 2, 2022 · 13 comments · Fixed by #231
Closed

Support for building on Ubuntu 22.04 #193

nuclearsandwich opened this issue Nov 2, 2022 · 13 comments · Fixed by #231
Assignees
Labels
L-python Language: Python
Milestone

Comments

@nuclearsandwich
Copy link
Contributor

nuclearsandwich commented Nov 2, 2022

Update:

Now that ikos supports llvm 14, there are build issues with python recorded in #193 (comment)


ikos currently requires llvm 9 which is no longer available in Ubuntu 22.04.

LLVM 11, 12, 13, and 14 are all packaged in 22.04. As a side note, Debian Bullseye (the current stable release) provides LLVM 11 and 13 but not 12 and 14 was not yet released.

It looks like the pending work on LLVM 10 has stalled #162.
Looking at the above release coverage, 13 would probably the next version to target in order to build on current (and likely at least one future) releases of Debian and Ubuntu.

@ivanperez-keera
Copy link
Collaborator

@nuclearsandwich we are in LLVM 14 now. Are you able to try again?

If you have a Docker image for this (maybe as part of Space ROS), I can try it quickly as well.

Thanks!

@ivanperez-keera
Copy link
Collaborator

The following Dockerfile is not Space ROS specific, but still relevant:

#171 (comment)

@ivanperez-keera
Copy link
Collaborator

ivanperez-keera commented Jul 11, 2023

@nuclearsandwich Please let me know about this. As far as I can see, ikos is building on jammy which Space ROS is based on. The last release from December supports LLVM 14. If anything else is needed, please let me know. Otherwise, I think we can close this issue.

EDIT: LLVM 14 is in Ubuntu 22.04, as per: https://launchpad.net/ubuntu/jammy/+package/llvm-14

@ivanperez-keera
Copy link
Collaborator

Email sent to @nuclearsandwich . Will close in 3 days if no answer is received.

@nuclearsandwich
Copy link
Contributor Author

Thanks for the message, I gave building another go and hit the following error:

/src/ikos/b/analyzer/python/setup.py:42: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.core import setup
Traceback (most recent call last):
  File "/src/ikos/b/analyzer/python/setup.py", line 42, in <module>
    from distutils.core import setup
ModuleNotFoundError: No module named 'distutils.core'
make[2]: *** [analyzer/CMakeFiles/ikos-python.dir/build.make:90: analyzer/python/build/lib/ikos/__init__.py] Error 1
make[1]: *** [CMakeFiles/Makefile2:1644: analyzer/CMakeFiles/ikos-python.dir/all] Error 2

If no one is looking at this yet, I think I can at least start a patch to switch away from distutils.

@ivanperez-keera
Copy link
Collaborator

Thanks @nuclearsandwich

See this docker file: #171 (comment)

It installs distutils manually in this step:

# Install all dependencies
RUN apt-get install --yes [... bunch of packages ...] python3-distutils

@nuclearsandwich
Copy link
Contributor Author

It installs distutils manually in this step:

Thanks for the tip! (What are we both doing on a Friday night?)

Distutils is long deprecated and slated for removal in Python 3.12. In truth, I thought it was already gone which is I why I offered to submit a patch. Do you think it makes more sense to proceed with distutils for Ubuntu 22.04 or address the underlying issue? Python 3.12 is, I believe, going to be released in October and will almost certainly also be used for Ubuntu 24.04 in April, so even if we use distutils for Jammy it buys us a half a year or so.

@ivanperez-keera
Copy link
Collaborator

If it is a simple fix, I'd say let's remove distutils. If it's a bit more complex, we can partition this in two: one issue (and PR) that provides a build for 22.04 and updates the installation instructions, and one issue (and PR) that removes the dependency on distutils (adjusting the installation instructions accordingly).

Partitioning this issue in two makes the whole thing a tiny bit bigger, but it provides an immediate official workaround and it makes it easier to complete and process (because in spite of our Friday night efforts, we are likely to be interrupted by high priority things).

@nuclearsandwich
Copy link
Contributor Author

Sounds good, I'll take a shot over the weekend and see how far I get.

@ivanperez-keera ivanperez-keera added this to the ikos 3.2 milestone Jul 15, 2023
@ivanperez-keera
Copy link
Collaborator

Whichever decision we make, I think it's safe to plan closing this issue in the next release. I'm assigning this to the next milestone.

@ivanperez-keera
Copy link
Collaborator

ivanperez-keera commented Jul 25, 2023

Given the current state of things, I'm inclined to first use python3-distutils, and separately deal with upgrading from distutils. That will make this combined problem easier to chew.

Apart from adding that dependency to build instructions or some dockerfile (elsewhere), is there anything else that needs to be done?

@ivanperez-keera
Copy link
Collaborator

Tagging @nuclearsandwich for awareness.

ivanperez-keera added a commit to ivanperez-keera/ikos that referenced this issue Nov 4, 2023
Distutils is deprecated (https://peps.python.org/pep-0632/).

This commit replaces the import of distutils with an import of setuptools,
which is one of the recommended replacements.
ivanperez-keera added a commit to ivanperez-keera/ikos that referenced this issue Nov 4, 2023
Distutils is deprecated (https://peps.python.org/pep-0632/).

This commit replaces the import of distutils with an import of setuptools,
which is one of the recommended replacements.
ivanperez-keera added a commit to ivanperez-keera/ikos that referenced this issue Nov 4, 2023
…).

Distutils is deprecated (https://peps.python.org/pep-0632/).

This commit replaces the import of distutils with an import of setuptools,
which is one of the recommended replacements.

Installation using setuptools also generates an egg file during installation.
@ivanperez-keera
Copy link
Collaborator

I just sent a PR with the proposed change @nuclearsandwich . You are welcome to try it.

@ivanperez-keera ivanperez-keera added the L-python Language: Python label Nov 4, 2023
@ivanperez-keera ivanperez-keera self-assigned this Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L-python Language: Python
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants