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

Python plugin is broken in core24 #4942

Closed
tigarmo opened this issue Jul 29, 2024 · 2 comments
Closed

Python plugin is broken in core24 #4942

tigarmo opened this issue Jul 29, 2024 · 2 comments
Labels

Comments

@tigarmo
Copy link
Contributor

tigarmo commented Jul 29, 2024

Bug Description

See https://forum.snapcraft.io/t/upgrading-classic-snap-to-core24-using-snapcraft-8-3-causes-python-3-12-errors-at-runtime/41045
In short, it looks like the changes to virtual environments in Python 3.12 are not working with the python plugin.

To Reproduce

.

Environment

.

snapcraft.yaml

.

Relevant log output

.

Additional context

We still need confirmation but this fix should work and is feasible for us.

Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3162.

This message was autogenerated

tigarmo added a commit that referenced this issue Jul 31, 2024
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
tigarmo added a commit that referenced this issue Jul 31, 2024
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
tigarmo added a commit that referenced this issue Jul 31, 2024
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
@tigarmo
Copy link
Contributor Author

tigarmo commented Aug 1, 2024

Fixed in #4946

@tigarmo tigarmo closed this as completed Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant