fix: fix Python venv in core24 classic snaps
Metadata
Current evaluation
Merged a fix for Python virtual environment handling in core24 classic snaps. Updates the pyvenv.cfg home key to the final snap path, resolving Python 3.12 compatibility issues. Squash-merged on August 1, 2024, following transient CI failure resolution.
Suggested action: —
No scores available.
Issue body
Changes to virtual environment handling made our default approach - creating a venv in the build system and then just moving it into the snap - not work for Python 3.12.
My understanding of the issue is that the "home" key in the "pyvenv.cfg" file points to a path in the build system, which obviously does not exist at snap-run-time. This apparently works fine *somehow* in core22 - likely there's some fallback logic that makes the interpreter correctly find the bundled Python libraries, but not in core24. So to address this we update this "home" key to point to its final destination in the snap.
Fixes #4942
- [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `tox run -m lint`?
- [ ] Have you successfully run `tox run -e test-py310`? (supported versions: `py39`, `py310`, `py311`, `py312`)
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged a fix for Python virtual environment handling in core24 classic snaps. Updates the pyvenv.cfg home key to the final snap path, resolving Python 3.12 compatibility issues. Squash-merged on August 1, 2024, following transient CI failure resolution. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Squash-merged to fix Python venv handling in core24 classic snaps. The change updates the pyvenv.cfg home key to point to the snap runtime path instead of the build system, resolving Python 3.12 compatibility issues and closing #4942. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Squash-merged fix for Python venv in core24 classic snaps. Updates pyvenv.cfg home key to the snap destination instead of the build path, resolving Python 3.12 compatibility and closing #4942. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #5407 Unable to build Python snaps using classic confinement with core24 using snapcraft 8.8.0 (8.x/stable) | snapcraft | closed | Resolved as a configuration issue. Classic Python snaps on core24 require explicitly adding python3.12-minimal to stage-packages and adjusting the app command. The developer acknowledged documentation gaps and announced upcoming Python plugin improvements. | |
| #5144 error out if core24 classic python snap is created with the non-staged python binary | snapcraft | open | Feature request to add a post_prime check in the python plugin that errors when a core24 classic snap is built with the host python (/usr/bin/python*) instead of a staged interpreter, which produces a broken pyvenv.cfg (home = /usr/bin). No labels, no comments, no activity for ~2 years. |