canonical / snapcraft

Package, distribute, and update any app for Linux and IoT.
https://snapcraft.io
GNU General Public License v3.0
1.19k stars 447 forks source link

error out if core24 classic python snap is created with the non-staged python binary #5144

Open dariuszd21 opened 2 weeks ago

dariuszd21 commented 2 weeks ago

What needs to get done

Add logic to the post_prime of the python plugin to error out if classic snap is created using system python (/usr/bin/python*) https://github.com/canonical/snapcraft/blob/main/snapcraft/parts/plugins/python_common.py#L67

Why it needs to get done

If core24 classic python snap stages python3.12-minimal, but no python3-minimal (symlink to the python binary), virtualenv is created incorrectly (using build host python) and pyvenv.cfg ends up with incorrect entry home = /usr/bin.

That makes this snap unusable on the host with the different Ubuntu version that the given core It also breaks re-building core24 classic python snaps