setup: Ubuntu setup Python >= 3.11 installation workaround #23707
+34
−28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note
This PR is heavily based on work by @MaEtUgR in #23126
Solved Problem
Starting with Python 3.11 installing packages into externally managed python installations is restricted. This leads to installation problems on Ubuntu 24.04 which uses Python 3.12 by default. As discussed in #23126 the best way to make the installation work on Ubuntu 24.04 would be to introduce full virtual environment support. This is already tackled by #23126 and #23228 but doesn't work as expected yet. Therefore as a temporary workaround
--break-system-packages
should be used similary to what was added for the Arch install in #21340.Alternatives
Finish virtual environment PRs.
Test coverage
Tested on Ubuntu 24.04 VM and Docker container.
Testing steps:
Test Dockerfile: