I was able to simplify the snapcraft.yaml file to just the python plugin (with a random source posted here) and the gnome extension, so I don’t think I’m doing anything wrong (but happy to learn if I am messing something up). Removing the gnome extension from the app makes the error about read only file system disappear.
Error:
+ snapcraftctl build
+ python3 -m venv /root/parts/test/install
+ SNAPCRAFT_PYTHON_VENV_INTERP_PATH=/root/parts/test/install/bin/python3
+ pip install -U pip setuptools wheel
Collecting pip
Using cached pip-22.3.1-py3-none-any.whl (2.1 MB)
Collecting setuptools
Using cached setuptools-65.6.3-py3-none-any.whl (1.2 MB)
Collecting wheel
Using cached wheel-0.38.4-py3-none-any.whl (36 kB)
Installing collected packages: pip, setuptools, wheel
Attempting uninstall: pip
Found existing installation: pip 20.0.2
Uninstalling pip-20.0.2:
ERROR: Could not install packages due to an EnvironmentError: [Errno 30] Read-only file system: '__init__.py'
Failed to build 'test'.
Recommended resolution:
Check the build logs and ensure the part's configuration and sources are correct.
Run the same command again with --debug to shell into the environment if you wish to introspect this failure
So core22 + python plugin + gnome extension seems to also be a no-go
Quick edit: The unable to release is a bit of a red herring. It’s a good thing because the snap doesn’t work as expected because of the broken $SNAP/bin/python3 symlink
user@host:~$ ls -l /snap/atestsnap/x1/bin/python3
lrwxrwxrwx 1 root root 45 Jan 7 22:07 /snap/atestsnap/x1/bin/python3 -> /snap/gnome-42-2204-sdk/48/usr/bin/python3.10
@goodsoftworx Thanks for the link! Looks like they still haven’t solved the issue yet.
I did a diff of the environment in override-build and by looking at a diff between with and without the gnome extension, I think my issue here can be remedied by a simple unset PYTHON_PATH in override-build.
I’m going to try that out and see if it resolves the python symlink issue for core22 then I’ll test it out to see if it fixes the readonly filesystem I was having for core20.
Can only post images so here’s what the diff looks like:
So it didn’t release. The symlinks are still there and it fails to release to the store. My fear is that the gnome extension is being overlayed on top of my snap and thus it’s filesystem has precedence. I’ll check out the override-prime step to see what can be done there, if anything.
The PYTHONPATH needs to be set for runtime. In which folder it’s installed, check it first. Then add that folder in PYTHONPATH. Eg:
If it’s installed /usr/lib/python3/site-packages then